swagged up hover state
This commit is contained in:
@@ -41,7 +41,7 @@ import {
|
|||||||
BulletList_Filled_Corner0_Rounded as ListFilled,
|
BulletList_Filled_Corner0_Rounded as ListFilled,
|
||||||
BulletList_Stroke2_Corner0_Rounded as List,
|
BulletList_Stroke2_Corner0_Rounded as List,
|
||||||
} from '#/components/icons/BulletList'
|
} from '#/components/icons/BulletList'
|
||||||
import {ChevronBottom_Stroke2_Corner0_Rounded as ChevronDownIcon} from '#/components/icons/Chevron'
|
import {DotGrid_Stroke2_Corner0_Rounded as EllipsisIcon} from '#/components/icons/DotGrid'
|
||||||
import {EditBig_Stroke2_Corner0_Rounded as EditBig} from '#/components/icons/EditBig'
|
import {EditBig_Stroke2_Corner0_Rounded as EditBig} from '#/components/icons/EditBig'
|
||||||
import {
|
import {
|
||||||
Hashtag_Filled_Corner0_Rounded as HashtagFilled,
|
Hashtag_Filled_Corner0_Rounded as HashtagFilled,
|
||||||
@@ -103,34 +103,60 @@ function ProfileCard() {
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[a.my_md, gtTablet && [a.align_start, a.pl_md]]}>
|
<View style={[a.my_md, gtTablet && [a.w_full, a.align_start]]}>
|
||||||
{!isLoading && profile ? (
|
{!isLoading && profile ? (
|
||||||
<Menu.Root>
|
<Menu.Root>
|
||||||
<Menu.Trigger label={_(msg`Switch accounts`)}>
|
<Menu.Trigger label={_(msg`Switch accounts`)}>
|
||||||
{({props, state}) => (
|
{({props, state, control}) => {
|
||||||
<Button label={props.accessibilityLabel} {...props}>
|
const active =
|
||||||
|
gtTablet && // desktop only
|
||||||
|
(state.hovered ||
|
||||||
|
state.focused ||
|
||||||
|
state.pressed ||
|
||||||
|
control.isOpen)
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
label={props.accessibilityLabel}
|
||||||
|
{...props}
|
||||||
|
style={[
|
||||||
|
a.w_full,
|
||||||
|
a.transition_color,
|
||||||
|
active && t.atoms.bg_contrast_25,
|
||||||
|
a.rounded_full,
|
||||||
|
a.justify_between,
|
||||||
|
a.align_center,
|
||||||
|
a.flex_row,
|
||||||
|
gtTablet && a.px_lg,
|
||||||
|
]}>
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
a.transition_transform,
|
||||||
|
{
|
||||||
|
transitionDuration: '250ms',
|
||||||
|
transformOrigin: 'center left',
|
||||||
|
},
|
||||||
|
active && {transform: [{scale: 0.5}]},
|
||||||
|
]}>
|
||||||
<UserAvatar
|
<UserAvatar
|
||||||
avatar={profile.avatar}
|
avatar={profile.avatar}
|
||||||
size={size}
|
size={size}
|
||||||
type={profile?.associated?.labeler ? 'labeler' : 'user'}
|
type={profile?.associated?.labeler ? 'labeler' : 'user'}
|
||||||
/>
|
/>
|
||||||
<View
|
</View>
|
||||||
|
{gtTablet && (
|
||||||
|
<EllipsisIcon
|
||||||
|
aria-hidden={true}
|
||||||
style={[
|
style={[
|
||||||
a.absolute,
|
t.atoms.text_contrast_medium,
|
||||||
a.inset_0,
|
|
||||||
a.transition_opacity,
|
a.transition_opacity,
|
||||||
{opacity: state.hovered ? 0.6 : 0},
|
{opacity: active ? 1 : 0},
|
||||||
a.justify_center,
|
]}
|
||||||
a.align_center,
|
|
||||||
t.atoms.bg,
|
|
||||||
]}>
|
|
||||||
<ChevronDownIcon
|
|
||||||
style={[t.atoms.text_contrast_high]}
|
|
||||||
size="sm"
|
size="sm"
|
||||||
/>
|
/>
|
||||||
</View>
|
|
||||||
</Button>
|
|
||||||
)}
|
)}
|
||||||
|
</Button>
|
||||||
|
)
|
||||||
|
}}
|
||||||
</Menu.Trigger>
|
</Menu.Trigger>
|
||||||
<Menu.Outer>
|
<Menu.Outer>
|
||||||
{otherAccounts && otherAccounts.length > 0 && (
|
{otherAccounts && otherAccounts.length > 0 && (
|
||||||
|
|||||||
Reference in New Issue
Block a user