From b69fd23456485d22c24b51da833d2707c718d61e Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 16 Sep 2024 16:52:28 -0500 Subject: Milly tweaks (#5365) Co-authored-by: Hailey --- src/components/dialogs/nuxs/TenMillion/Trigger.tsx | 129 +++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 src/components/dialogs/nuxs/TenMillion/Trigger.tsx (limited to 'src/components/dialogs/nuxs/TenMillion/Trigger.tsx') diff --git a/src/components/dialogs/nuxs/TenMillion/Trigger.tsx b/src/components/dialogs/nuxs/TenMillion/Trigger.tsx new file mode 100644 index 000000000..9616b3b1d --- /dev/null +++ b/src/components/dialogs/nuxs/TenMillion/Trigger.tsx @@ -0,0 +1,129 @@ +import React from 'react' +import {View} from 'react-native' +import Svg, {Circle, Path} from 'react-native-svg' +import {msg, Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' + +import {Nux, useUpsertNuxMutation} from '#/state/queries/nuxs' +import {atoms as a, ViewStyleProp} from '#/alf' +import {Button, ButtonProps} from '#/components/Button' +import * as Dialog from '#/components/Dialog' +import {InlineLinkText} from '#/components/Link' +import * as Prompt from '#/components/Prompt' +import {TenMillion} from './' + +export function Trigger({children}: {children: ButtonProps['children']}) { + const {_} = useLingui() + const {mutate: upsertNux} = useUpsertNuxMutation() + const [show, setShow] = React.useState(false) + const [fallback, setFallback] = React.useState(false) + const control = Prompt.usePromptControl() + + const handleOnPress = () => { + if (!fallback) { + setShow(true) + upsertNux({ + id: Nux.TenMillionDialog, + completed: true, + data: undefined, + }) + } else { + control.open() + } + } + + const onHandleFallback = () => { + setFallback(true) + control.open() + } + + return ( + <> + + + {show && !fallback && ( + setShow(false)} + onFallback={onHandleFallback} + /> + )} + + + + + Bluesky is celebrating 10 million users! + + + + + Together, we're rebuilding the social internet. We're glad you're + here. + + + + + To learn more,{' '} + { + control.close() + }} + style={[a.text_md, a.leading_snug]}> + check out our post. + + + + + + + ) +} + +export function Icon({width, style}: {width: number} & ViewStyleProp) { + return ( + + + + + + + + + + + + + + + + + + ) +} -- cgit 1.4.1