Make reply prompt more subtle on desktop (#5569)
* make reply prompt more subtle on desktop * fix alignment * Tweak transition timing --------- Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -901,4 +901,32 @@ export const atoms = {
|
|||||||
hidden: {
|
hidden: {
|
||||||
display: 'none',
|
display: 'none',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Transition
|
||||||
|
*/
|
||||||
|
transition_none: web({
|
||||||
|
transitionProperty: 'none',
|
||||||
|
}),
|
||||||
|
transition_all: web({
|
||||||
|
transitionProperty: 'all',
|
||||||
|
transitionTimingFunction: 'cubic-bezier(0.17, 0.73, 0.14, 1)',
|
||||||
|
transitionDuration: '100ms',
|
||||||
|
}),
|
||||||
|
transition_color: web({
|
||||||
|
transitionProperty:
|
||||||
|
'color, background-color, border-color, text-decoration-color, fill, stroke',
|
||||||
|
transitionTimingFunction: 'cubic-bezier(0.17, 0.73, 0.14, 1)',
|
||||||
|
transitionDuration: '100ms',
|
||||||
|
}),
|
||||||
|
transition_opacity: web({
|
||||||
|
transitionProperty: 'opacity',
|
||||||
|
transitionTimingFunction: 'cubic-bezier(0.17, 0.73, 0.14, 1)',
|
||||||
|
transitionDuration: '100ms',
|
||||||
|
}),
|
||||||
|
transition_transform: web({
|
||||||
|
transitionProperty: 'transform',
|
||||||
|
transitionTimingFunction: 'cubic-bezier(0.17, 0.73, 0.14, 1)',
|
||||||
|
transitionDuration: '100ms',
|
||||||
|
}),
|
||||||
} as const
|
} as const
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import {useLingui} from '@lingui/react'
|
|||||||
|
|
||||||
import {PressableScale} from '#/lib/custom-animations/PressableScale'
|
import {PressableScale} from '#/lib/custom-animations/PressableScale'
|
||||||
import {useHaptics} from '#/lib/haptics'
|
import {useHaptics} from '#/lib/haptics'
|
||||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
|
||||||
import {useHapticsDisabled} from '#/state/preferences'
|
import {useHapticsDisabled} from '#/state/preferences'
|
||||||
import {useProfileQuery} from '#/state/queries/profile'
|
import {useProfileQuery} from '#/state/queries/profile'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import {UserAvatar} from '#/view/com/util/UserAvatar'
|
import {UserAvatar} from '#/view/com/util/UserAvatar'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
||||||
|
import {useInteractionState} from '#/components/hooks/useInteractionState'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
export function PostThreadComposePrompt({
|
export function PostThreadComposePrompt({
|
||||||
@@ -21,10 +21,15 @@ export function PostThreadComposePrompt({
|
|||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
const {data: profile} = useProfileQuery({did: currentAccount?.did})
|
const {data: profile} = useProfileQuery({did: currentAccount?.did})
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const {isTabletOrDesktop} = useWebMediaQueries()
|
const {gtMobile} = useBreakpoints()
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const playHaptics = useHaptics()
|
const playHaptics = useHaptics()
|
||||||
const isHapticsDisabled = useHapticsDisabled()
|
const isHapticsDisabled = useHapticsDisabled()
|
||||||
|
const {
|
||||||
|
state: hovered,
|
||||||
|
onIn: onHoverIn,
|
||||||
|
onOut: onHoverOut,
|
||||||
|
} = useInteractionState()
|
||||||
|
|
||||||
const onPress = () => {
|
const onPress = () => {
|
||||||
playHaptics('Light')
|
playHaptics('Light')
|
||||||
@@ -42,13 +47,15 @@ export function PostThreadComposePrompt({
|
|||||||
accessibilityLabel={_(msg`Compose reply`)}
|
accessibilityLabel={_(msg`Compose reply`)}
|
||||||
accessibilityHint={_(msg`Opens composer`)}
|
accessibilityHint={_(msg`Opens composer`)}
|
||||||
style={[
|
style={[
|
||||||
{paddingTop: 8, paddingBottom: isTabletOrDesktop ? 8 : 11},
|
gtMobile ? a.py_xs : {paddingTop: 8, paddingBottom: 11},
|
||||||
a.px_sm,
|
gtMobile ? {paddingLeft: 6, paddingRight: 6} : a.px_sm,
|
||||||
a.border_t,
|
a.border_t,
|
||||||
t.atoms.border_contrast_low,
|
t.atoms.border_contrast_low,
|
||||||
t.atoms.bg,
|
t.atoms.bg,
|
||||||
]}
|
]}
|
||||||
onPress={onPress}>
|
onPress={onPress}
|
||||||
|
onHoverIn={onHoverIn}
|
||||||
|
onHoverOut={onHoverOut}>
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
a.flex_row,
|
a.flex_row,
|
||||||
@@ -56,10 +63,11 @@ export function PostThreadComposePrompt({
|
|||||||
a.p_sm,
|
a.p_sm,
|
||||||
a.gap_sm,
|
a.gap_sm,
|
||||||
a.rounded_full,
|
a.rounded_full,
|
||||||
t.atoms.bg_contrast_25,
|
(!gtMobile || hovered) && t.atoms.bg_contrast_25,
|
||||||
|
a.transition_color,
|
||||||
]}>
|
]}>
|
||||||
<UserAvatar
|
<UserAvatar
|
||||||
size={22}
|
size={gtMobile ? 24 : 22}
|
||||||
avatar={profile?.avatar}
|
avatar={profile?.avatar}
|
||||||
type={profile?.associated?.labeler ? 'labeler' : 'user'}
|
type={profile?.associated?.labeler ? 'labeler' : 'user'}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user