Update compose prompts for web
This commit is contained in:
parent
cd96c94d3a
commit
e6b63e3f53
5 changed files with 77 additions and 6 deletions
|
@ -3,7 +3,7 @@ import {StyleSheet, TouchableOpacity, View} from 'react-native'
|
|||
import {Text} from '../util/text/Text'
|
||||
import {usePalette} from '../../lib/hooks/usePalette'
|
||||
|
||||
export function PromptButtons({
|
||||
export function ComposerPrompt({
|
||||
onPressCompose,
|
||||
}: {
|
||||
onPressCompose: (imagesOpen?: boolean) => void
|
41
src/view/com/posts/ComposerPrompt.web.tsx
Normal file
41
src/view/com/posts/ComposerPrompt.web.tsx
Normal file
|
@ -0,0 +1,41 @@
|
|||
import React from 'react'
|
||||
import {StyleSheet, TouchableWithoutFeedback, View} from 'react-native'
|
||||
import {Text} from '../util/text/Text'
|
||||
import {usePalette} from '../../lib/hooks/usePalette'
|
||||
import {s} from '../../lib/styles'
|
||||
|
||||
export function ComposerPrompt({
|
||||
onPressCompose,
|
||||
}: {
|
||||
onPressCompose: (imagesOpen?: boolean) => void
|
||||
}) {
|
||||
const pal = usePalette('default')
|
||||
return (
|
||||
<TouchableWithoutFeedback onPress={() => onPressCompose(false)}>
|
||||
<View style={[pal.view, pal.border, styles.container]}>
|
||||
<Text type="xl" style={pal.textLight}>
|
||||
What's up?
|
||||
</Text>
|
||||
<View style={s.flex1} />
|
||||
<View style={[styles.btn, pal.btn]}>
|
||||
<Text>Post</Text>
|
||||
</View>
|
||||
</View>
|
||||
</TouchableWithoutFeedback>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
paddingVertical: 16,
|
||||
paddingHorizontal: 18,
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
borderTopWidth: 1,
|
||||
},
|
||||
btn: {
|
||||
paddingVertical: 6,
|
||||
paddingHorizontal: 14,
|
||||
borderRadius: 30,
|
||||
},
|
||||
})
|
|
@ -13,7 +13,7 @@ import {EmptyState} from '../util/EmptyState'
|
|||
import {ErrorMessage} from '../util/error/ErrorMessage'
|
||||
import {FeedModel} from '../../../state/models/feed-view'
|
||||
import {FeedItem} from './FeedItem'
|
||||
import {PromptButtons} from './PromptButtons'
|
||||
import {ComposerPrompt} from './ComposerPrompt'
|
||||
import {OnScrollCb} from '../../lib/hooks/useOnMainScroll'
|
||||
import {s} from '../../lib/styles'
|
||||
|
||||
|
@ -43,7 +43,7 @@ export const Feed = observer(function Feed({
|
|||
// like PureComponent, shouldComponentUpdate, etc
|
||||
const renderItem = ({item}: {item: any}) => {
|
||||
if (item === COMPOSE_PROMPT_ITEM) {
|
||||
return <PromptButtons onPressCompose={onPressCompose} />
|
||||
return <ComposerPrompt onPressCompose={onPressCompose} />
|
||||
} else if (item === EMPTY_FEED_ITEM) {
|
||||
return (
|
||||
<EmptyState
|
||||
|
@ -87,7 +87,7 @@ export const Feed = observer(function Feed({
|
|||
return (
|
||||
<View testID={testID} style={style}>
|
||||
<CenteredView>
|
||||
{!data && <PromptButtons onPressCompose={onPressCompose} />}
|
||||
{!data && <ComposerPrompt onPressCompose={onPressCompose} />}
|
||||
{feed.isLoading && !data && <PostFeedLoadingPlaceholder />}
|
||||
{feed.hasError && (
|
||||
<ErrorMessage
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue