Dev helpers, string cleanup
parent
c8b133863d
commit
6e78ce53d7
|
@ -430,7 +430,6 @@ export function TenMillionInner({userNumber}: {userNumber: number}) {
|
|||
style={[
|
||||
a.text_sm,
|
||||
a.font_semibold,
|
||||
,
|
||||
a.leading_tight,
|
||||
lightTheme.atoms.text_contrast_low,
|
||||
]}>
|
||||
|
@ -533,13 +532,13 @@ export function TenMillionInner({userNumber}: {userNumber: number}) {
|
|||
fontWeight: '900',
|
||||
},
|
||||
]}>
|
||||
Thanks for being an early part of Bluesky.
|
||||
<Trans>You're part of the next wave of the internet.</Trans>
|
||||
</Text>
|
||||
|
||||
<Text style={[a.leading_snug, a.text_lg, a.pb_xl]}>
|
||||
<Trans>
|
||||
We're rebuilding the social internet together. Congratulations,
|
||||
we're glad you're here.
|
||||
Thanks for being part of our first 10 million users. We're glad
|
||||
you're here.
|
||||
</Trans>{' '}
|
||||
</Text>
|
||||
|
||||
|
@ -554,7 +553,7 @@ export function TenMillionInner({userNumber}: {userNumber: number}) {
|
|||
a.pt_xl,
|
||||
]}>
|
||||
<Text style={[a.text_md, a.italic, t.atoms.text_contrast_medium]}>
|
||||
Brag a little!
|
||||
<Trans>Brag a little!</Trans>
|
||||
</Text>
|
||||
|
||||
<Button
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
import React from 'react'
|
||||
|
||||
import {Nux, useNuxs, useUpsertNuxMutation} from '#/state/queries/nuxs'
|
||||
import {
|
||||
Nux,
|
||||
useNuxs,
|
||||
useRemoveNuxsMutation,
|
||||
useUpsertNuxMutation,
|
||||
} from '#/state/queries/nuxs'
|
||||
import {useSession} from '#/state/session'
|
||||
import {isSnoozed, snooze} from '#/components/dialogs/nuxs/snoozing'
|
||||
import {isSnoozed, snooze, unsnooze} from '#/components/dialogs/nuxs/snoozing'
|
||||
import {TenMillion} from '#/components/dialogs/nuxs/TenMillion'
|
||||
import {IS_DEV} from '#/env'
|
||||
|
||||
type Context = {
|
||||
activeNux: Nux | undefined
|
||||
|
@ -33,6 +39,7 @@ function Inner() {
|
|||
})
|
||||
const [activeNux, setActiveNux] = React.useState<Nux | undefined>()
|
||||
const {mutate: upsertNux} = useUpsertNuxMutation()
|
||||
const {mutate: removeNuxs} = useRemoveNuxsMutation()
|
||||
|
||||
const snoozeNuxDialog = React.useCallback(() => {
|
||||
snooze()
|
||||
|
@ -51,6 +58,15 @@ function Inner() {
|
|||
})
|
||||
}, [activeNux, setActiveNux, upsertNux, nuxs])
|
||||
|
||||
if (IS_DEV && typeof window !== 'undefined') {
|
||||
// @ts-ignore
|
||||
window.clearNuxDialog = (id: Nux) => {
|
||||
if (!IS_DEV || !id) return
|
||||
removeNuxs([id])
|
||||
unsnooze()
|
||||
}
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
if (snoozed) return
|
||||
if (!nuxs) return
|
||||
|
|
|
@ -5,6 +5,10 @@ export function snooze() {
|
|||
device.set(['lastNuxDialog'], new Date().toISOString())
|
||||
}
|
||||
|
||||
export function unsnooze() {
|
||||
device.set(['lastNuxDialog'], undefined)
|
||||
}
|
||||
|
||||
export function isSnoozed() {
|
||||
const lastNuxDialog = device.get(['lastNuxDialog'])
|
||||
if (!lastNuxDialog) return false
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
* Device data that's specific to the device and does not vary based account
|
||||
*/
|
||||
export type Device = {
|
||||
lastNuxDialog: string
|
||||
lastNuxDialog: string | undefined
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue