Integrate composer prompt into design system
parent
434d874598
commit
b47714fb11
|
@ -4,6 +4,7 @@ import {colors} from '../../lib/styles'
|
||||||
import {useStores} from '../../../state'
|
import {useStores} from '../../../state'
|
||||||
import {UserAvatar} from '../util/UserAvatar'
|
import {UserAvatar} from '../util/UserAvatar'
|
||||||
import {Text} from '../util/text/Text'
|
import {Text} from '../util/text/Text'
|
||||||
|
import {usePalette} from '../../lib/hooks/usePalette'
|
||||||
|
|
||||||
export function ComposePrompt({
|
export function ComposePrompt({
|
||||||
noAvi = false,
|
noAvi = false,
|
||||||
|
@ -16,13 +17,19 @@ export function ComposePrompt({
|
||||||
btn?: string
|
btn?: string
|
||||||
onPressCompose: () => void
|
onPressCompose: () => void
|
||||||
}) {
|
}) {
|
||||||
|
const pal = usePalette('default')
|
||||||
const store = useStores()
|
const store = useStores()
|
||||||
const onPressAvatar = () => {
|
const onPressAvatar = () => {
|
||||||
store.nav.navigate(`/profile/${store.me.handle}`)
|
store.nav.navigate(`/profile/${store.me.handle}`)
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={[styles.container, noAvi ? styles.noAviContainer : undefined]}
|
style={[
|
||||||
|
pal.view,
|
||||||
|
pal.border,
|
||||||
|
styles.container,
|
||||||
|
noAvi ? styles.noAviContainer : undefined,
|
||||||
|
]}
|
||||||
onPress={onPressCompose}>
|
onPress={onPressCompose}>
|
||||||
{!noAvi ? (
|
{!noAvi ? (
|
||||||
<TouchableOpacity style={styles.avatar} onPress={onPressAvatar}>
|
<TouchableOpacity style={styles.avatar} onPress={onPressAvatar}>
|
||||||
|
@ -35,10 +42,14 @@ export function ComposePrompt({
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
) : undefined}
|
) : undefined}
|
||||||
<View style={styles.textContainer}>
|
<View style={styles.textContainer}>
|
||||||
<Text style={styles.text}>{text}</Text>
|
<Text type="h5" style={[pal.textLight, {fontWeight: 'normal'}]}>
|
||||||
|
{text}
|
||||||
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.btn}>
|
<View style={[styles.btn, {backgroundColor: pal.colors.backgroundLight}]}>
|
||||||
<Text style={styles.btnText}>{btn}</Text>
|
<Text type="button" style={pal.textLight}>
|
||||||
|
{btn}
|
||||||
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)
|
)
|
||||||
|
@ -50,9 +61,7 @@ const styles = StyleSheet.create({
|
||||||
paddingVertical: 10,
|
paddingVertical: 10,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
backgroundColor: colors.white,
|
|
||||||
borderTopWidth: 1,
|
borderTopWidth: 1,
|
||||||
borderTopColor: colors.gray2,
|
|
||||||
},
|
},
|
||||||
noAviContainer: {
|
noAviContainer: {
|
||||||
paddingVertical: 14,
|
paddingVertical: 14,
|
||||||
|
@ -64,17 +73,9 @@ const styles = StyleSheet.create({
|
||||||
marginLeft: 10,
|
marginLeft: 10,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
text: {
|
|
||||||
color: colors.gray4,
|
|
||||||
fontSize: 17,
|
|
||||||
},
|
|
||||||
btn: {
|
btn: {
|
||||||
backgroundColor: colors.gray1,
|
|
||||||
paddingVertical: 6,
|
paddingVertical: 6,
|
||||||
paddingHorizontal: 14,
|
paddingHorizontal: 14,
|
||||||
borderRadius: 30,
|
borderRadius: 30,
|
||||||
},
|
},
|
||||||
btnText: {
|
|
||||||
color: colors.gray5,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -180,8 +180,7 @@ export const PostThreadItem = observer(function PostThreadItem({
|
||||||
) : undefined}
|
) : undefined}
|
||||||
<PostEmbeds embed={item.post.embed} style={s.mb10} />
|
<PostEmbeds embed={item.post.embed} style={s.mb10} />
|
||||||
{item._isHighlightedPost && hasEngagement ? (
|
{item._isHighlightedPost && hasEngagement ? (
|
||||||
<View
|
<View style={[styles.expandedInfo, pal.border]}>
|
||||||
style={[styles.expandedInfo, {borderColor: pal.colors.border}]}>
|
|
||||||
{item.post.repostCount ? (
|
{item.post.repostCount ? (
|
||||||
<Link
|
<Link
|
||||||
style={styles.expandedInfoItem}
|
style={styles.expandedInfoItem}
|
||||||
|
|
|
@ -111,6 +111,7 @@ const styles = StyleSheet.create({
|
||||||
},
|
},
|
||||||
extOuter: {
|
extOuter: {
|
||||||
padding: 10,
|
padding: 10,
|
||||||
|
borderWidth: 1,
|
||||||
},
|
},
|
||||||
extDescription: {
|
extDescription: {
|
||||||
marginTop: 4,
|
marginTop: 4,
|
||||||
|
|
|
@ -18,7 +18,6 @@ export function usePalette(color: PaletteColorName): UsePaletteValue {
|
||||||
backgroundColor: palette.background,
|
backgroundColor: palette.background,
|
||||||
},
|
},
|
||||||
border: {
|
border: {
|
||||||
borderWidth: 1,
|
|
||||||
borderColor: palette.border,
|
borderColor: palette.border,
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
|
|
|
@ -6,7 +6,7 @@ export const defaultTheme: Theme = {
|
||||||
palette: {
|
palette: {
|
||||||
default: {
|
default: {
|
||||||
background: colors.white,
|
background: colors.white,
|
||||||
backgroundLight: colors.gray2,
|
backgroundLight: colors.gray1,
|
||||||
text: colors.black,
|
text: colors.black,
|
||||||
textLight: colors.gray5,
|
textLight: colors.gray5,
|
||||||
textInverted: colors.white,
|
textInverted: colors.white,
|
||||||
|
|
|
@ -176,6 +176,7 @@ function PaletteView({palette}: {palette: PaletteColorName}) {
|
||||||
pal.view,
|
pal.view,
|
||||||
pal.border,
|
pal.border,
|
||||||
{
|
{
|
||||||
|
borderWidth: 1,
|
||||||
padding: 10,
|
padding: 10,
|
||||||
marginBottom: 5,
|
marginBottom: 5,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue