make share button dropdown work

This commit is contained in:
Hailey
2024-06-09 16:32:37 -07:00
parent 5198190797
commit 95cf29633e
+18 -15
View File
@@ -1,5 +1,5 @@
import React from 'react' import React from 'react'
import {View} from 'react-native' import {Pressable, View} from 'react-native'
import {AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api' import {AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api'
import {msg, Plural, Trans} from '@lingui/macro' import {msg, Plural, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
@@ -123,20 +123,23 @@ function Header({
<View style={[a.flex_row, a.gap_sm]}> <View style={[a.flex_row, a.gap_sm]}>
<Menu.Root> <Menu.Root>
<Menu.Trigger label={_(msg`Repost or quote post`)}> <Menu.Trigger label={_(msg`Repost or quote post`)}>
{({props}) => { {({props, state}) => (
return ( <Pressable
<Button style={[
label={_(msg`Share`)} a.px_lg,
variant="solid" a.py_xs,
color="primary" a.align_center,
size="small" a.justify_center,
{...props}> a.rounded_sm,
<ButtonText> {backgroundColor: t.palette.primary_500},
<Trans>Share</Trans> state.hovered && {backgroundColor: t.palette.primary_600},
</ButtonText> ]}
</Button> {...props}>
) <Text style={[a.font_bold]}>
}} <Trans>Share</Trans>
</Text>
</Pressable>
)}
</Menu.Trigger> </Menu.Trigger>
<Menu.Outer style={{minWidth: 170}}> <Menu.Outer style={{minWidth: 170}}>
<Menu.Group> <Menu.Group>