Bluesky app fork with some witchin' additions 💫

tweak to disable email verification reminder popup

this also changes the popup a bit for more of a witchsky style, please read the code comments i left in src/alf/tokens.ts and src/components/dialogs/EmailDialog/screens/VerificationReminder.tsx

this does not bypass any feature on bluesky that is locked behind a email verification if the pds is setup that way, this only gets rid of the reminder so if ur using a bluesky pds that doesnt have email verification but fully functions without a verified email, u dont need to get a pointless reminder every day

praying nothing goes wrong, still cant fork the repo

Tangled a3721ce5 020904c9

Changed files
+105 -12
src
alf
components
dialogs
EmailDialog
screens
Settings
state
+4 -1
src/Navigation.tsx
··· 43 import {bskyTitle} from '#/lib/strings/headings' 44 import {logger} from '#/logger' 45 import {isNative, isWeb} from '#/platform/detection' 46 import {useUnreadNotifications} from '#/state/queries/notifications/unread' 47 import {useSession} from '#/state/session' 48 import { ··· 867 const emailDialogControl = useEmailDialogControl() 868 const closeAllActiveElements = useCloseAllActiveElements() 869 870 /** 871 * Handle navigation to a conversation, or prepares for account switch. 872 * ··· 955 956 function onReady() { 957 prevLoggedRouteName.current = getCurrentRouteName() 958 - if (currentAccount && shouldRequestEmailConfirmation(currentAccount)) { 959 emailDialogControl.open({ 960 id: EmailDialogScreenID.VerificationReminder, 961 })
··· 43 import {bskyTitle} from '#/lib/strings/headings' 44 import {logger} from '#/logger' 45 import {isNative, isWeb} from '#/platform/detection' 46 + import {useDisableVerifyEmailReminder} from '#/state/preferences/disable-verify-email-reminder' 47 import {useUnreadNotifications} from '#/state/queries/notifications/unread' 48 import {useSession} from '#/state/session' 49 import { ··· 868 const emailDialogControl = useEmailDialogControl() 869 const closeAllActiveElements = useCloseAllActiveElements() 870 871 + const disableVerifyEmailReminder = useDisableVerifyEmailReminder() 872 + 873 /** 874 * Handle navigation to a conversation, or prepares for account switch. 875 * ··· 958 959 function onReady() { 960 prevLoggedRouteName.current = getCurrentRouteName() 961 + if (currentAccount && shouldRequestEmailConfirmation(currentAccount) && !disableVerifyEmailReminder) { 962 emailDialogControl.open({ 963 id: EmailDialogScreenID.VerificationReminder, 964 })
+2
src/alf/tokens.ts
··· 7 temp_purple_dark: tokens.labelerColor.purple_dark, 8 } as const 9 10 export const gradients = { 11 primary: { 12 values: [
··· 7 temp_purple_dark: tokens.labelerColor.purple_dark, 8 } as const 9 10 + // FIXME: some of these should probs be changed up for witchsky branding reasons, they should also work with all the other themes 11 + 12 export const gradients = { 13 primary: { 14 values: [
+7 -2
src/components/dialogs/EmailDialog/screens/VerificationReminder.tsx
··· 24 25 const dialogPadding = gtMobile ? a.p_2xl.padding : a.p_xl.padding 26 27 return ( 28 <View style={[a.gap_lg]}> 29 <View ··· 50 borderTopRightRadius: a.rounded_md.borderRadius, 51 }, 52 ]}> 53 - <GradientFill gradient={tokens.gradients.primary} /> 54 <ShieldIcon width={64} fill="white" style={[a.z_10]} /> 55 </View> 56 </View> ··· 64 <Text style={[a.text_sm, a.leading_snug, t.atoms.text_contrast_medium]}> 65 <Trans> 66 Your email has not yet been verified. Please verify your email in 67 - order to enjoy all the features of Bluesky. 68 </Trans> 69 </Text> 70 </View>
··· 24 25 const dialogPadding = gtMobile ? a.p_2xl.padding : a.p_xl.padding 26 27 + // FIXME: the usage of "tokens.gradients.summer" here is temporary, 28 + // its the closest thats built into bluesky that matches witchskys color scheme 29 + // someone, preferbly xan, should edit src/alf/tokens.ts to have proper witchsky colors 30 + // maybe even support all the other themes too? 31 + 32 return ( 33 <View style={[a.gap_lg]}> 34 <View ··· 55 borderTopRightRadius: a.rounded_md.borderRadius, 56 }, 57 ]}> 58 + <GradientFill gradient={tokens.gradients.summer} /> 59 <ShieldIcon width={64} fill="white" style={[a.z_10]} /> 60 </View> 61 </View> ··· 69 <Text style={[a.text_sm, a.leading_snug, t.atoms.text_contrast_medium]}> 70 <Trans> 71 Your email has not yet been verified. Please verify your email in 72 + order to enjoy all the features of Witchsky. 73 </Trans> 74 </Text> 75 </View>
+34 -8
src/screens/Settings/DeerSettings.tsx
··· 30 useSetDirectFetchRecords, 31 } from '#/state/preferences/direct-fetch-records' 32 import { 33 useDisableFollowersMetrics, 34 useSetDisableFollowersMetrics 35 } from '#/state/preferences/disable-followers-metrics' ··· 38 useSetDisableFollowingMetrics 39 } from '#/state/preferences/disable-following-metrics' 40 import { 41 - useDisableFollowedByMetrics, 42 - useSetDisableFollowedByMetrics 43 - } from '#/state/preferences/disable-followed-by-metrics' 44 - import { 45 useDisableLikesMetrics, 46 useSetDisableLikesMetrics, 47 } from '#/state/preferences/disable-likes-metrics' 48 import { 49 useDisableQuotesMetrics, 50 useSetDisableQuotesMetrics, 51 } from '#/state/preferences/disable-quotes-metrics' ··· 54 useSetDisableReplyMetrics, 55 } from '#/state/preferences/disable-reply-metrics' 56 import { 57 - useDisablePostsMetrics, 58 - useSetDisablePostsMetrics, 59 - } from '#/state/preferences/disable-posts-metrics' 60 - import { 61 useDisableRepostsMetrics, 62 useSetDisableRepostsMetrics, 63 } from '#/state/preferences/disable-reposts-metrics' ··· 65 useDisableSavesMetrics, 66 useSetDisableSavesMetrics, 67 } from '#/state/preferences/disable-saves-metrics' 68 import { 69 useDisableViaRepostNotification, 70 useSetDisableViaRepostNotification, ··· 319 const enableSquareButtons = useEnableSquareButtons() 320 const setEnableSquareButtons = useSetEnableSquareButtons() 321 322 const constellationInstance = useConstellationInstance() 323 const setConstellationInstanceControl = Dialog.useDialogControl() 324 ··· 617 </Toggle.LabelText> 618 <Toggle.Platform /> 619 </Toggle.Item> 620 </SettingsList.Group> 621 622 <SettingsList.Group contentContainerStyle={[a.gap_sm]}>
··· 30 useSetDirectFetchRecords, 31 } from '#/state/preferences/direct-fetch-records' 32 import { 33 + useDisableFollowedByMetrics, 34 + useSetDisableFollowedByMetrics 35 + } from '#/state/preferences/disable-followed-by-metrics' 36 + import { 37 useDisableFollowersMetrics, 38 useSetDisableFollowersMetrics 39 } from '#/state/preferences/disable-followers-metrics' ··· 42 useSetDisableFollowingMetrics 43 } from '#/state/preferences/disable-following-metrics' 44 import { 45 useDisableLikesMetrics, 46 useSetDisableLikesMetrics, 47 } from '#/state/preferences/disable-likes-metrics' 48 import { 49 + useDisablePostsMetrics, 50 + useSetDisablePostsMetrics, 51 + } from '#/state/preferences/disable-posts-metrics' 52 + import { 53 useDisableQuotesMetrics, 54 useSetDisableQuotesMetrics, 55 } from '#/state/preferences/disable-quotes-metrics' ··· 58 useSetDisableReplyMetrics, 59 } from '#/state/preferences/disable-reply-metrics' 60 import { 61 useDisableRepostsMetrics, 62 useSetDisableRepostsMetrics, 63 } from '#/state/preferences/disable-reposts-metrics' ··· 65 useDisableSavesMetrics, 66 useSetDisableSavesMetrics, 67 } from '#/state/preferences/disable-saves-metrics' 68 + import { 69 + useDisableVerifyEmailReminder, 70 + useSetDisableVerifyEmailReminder, 71 + } from '#/state/preferences/disable-verify-email-reminder' 72 import { 73 useDisableViaRepostNotification, 74 useSetDisableViaRepostNotification, ··· 323 const enableSquareButtons = useEnableSquareButtons() 324 const setEnableSquareButtons = useSetEnableSquareButtons() 325 326 + const disableVerifyEmailReminder = useDisableVerifyEmailReminder() 327 + const setDisableVerifyEmailReminder = useSetDisableVerifyEmailReminder() 328 + 329 const constellationInstance = useConstellationInstance() 330 const setConstellationInstanceControl = Dialog.useDialogControl() 331 ··· 624 </Toggle.LabelText> 625 <Toggle.Platform /> 626 </Toggle.Item> 627 + 628 + <Toggle.Item 629 + name="disable_verify_email_reminder" 630 + label={_(msg`Disable verify email reminder`)} 631 + value={disableVerifyEmailReminder} 632 + onChange={value => setDisableVerifyEmailReminder(value)} 633 + style={[a.w_full]}> 634 + <Toggle.LabelText style={[a.flex_1]}> 635 + <Trans>Disable verify email reminder</Trans> 636 + </Toggle.LabelText> 637 + <Toggle.Platform /> 638 + </Toggle.Item> 639 + <Admonition type="warning" style={[a.flex_1]}> 640 + <Trans> 641 + This only gets rid of the reminder on app launch, 642 + useful if your PDS does not have email verification setup.\nThis 643 + does NOT give access to features locked behind email verification. 644 + </Trans> 645 + </Admonition> 646 </SettingsList.Group> 647 648 <SettingsList.Group contentContainerStyle={[a.gap_sm]}>
+2
src/state/persisted/schema.ts
··· 158 hideSimilarAccountsRecomm: z.boolean().optional(), 159 enableSquareAvatars: z.boolean().optional(), 160 enableSquareButtons: z.boolean().optional(), 161 deerVerification: z 162 .object({ 163 enabled: z.boolean(), ··· 245 hideSimilarAccountsRecomm: true, 246 enableSquareAvatars: false, 247 enableSquareButtons: false, 248 deerVerification: { 249 enabled: false, 250 // https://witchsky.app/profile/did:plc:p2cp5gopk7mgjegy6wadk3ep/post/3lndyqyyr4k2k
··· 158 hideSimilarAccountsRecomm: z.boolean().optional(), 159 enableSquareAvatars: z.boolean().optional(), 160 enableSquareButtons: z.boolean().optional(), 161 + disableVerifyEmailReminder: z.boolean().optional(), 162 deerVerification: z 163 .object({ 164 enabled: z.boolean(), ··· 246 hideSimilarAccountsRecomm: true, 247 enableSquareAvatars: false, 248 enableSquareButtons: false, 249 + disableVerifyEmailReminder: false, 250 deerVerification: { 251 enabled: false, 252 // https://witchsky.app/profile/did:plc:p2cp5gopk7mgjegy6wadk3ep/post/3lndyqyyr4k2k
+52
src/state/preferences/disable-verify-email-reminder.tsx
···
··· 1 + import React from 'react' 2 + 3 + import * as persisted from '#/state/persisted' 4 + 5 + // Preference: disableVerifyEmailReminder – when true, disables the "verify email" reminder that you get on boot on mobile, useful if you are on a PDS without any email verification setup 6 + 7 + type StateContext = persisted.Schema['disableVerifyEmailReminder'] 8 + // Same setter signature used across other preference modules 9 + type SetContext = (v: persisted.Schema['disableVerifyEmailReminder']) => void 10 + 11 + const stateContext = React.createContext<StateContext>( 12 + persisted.defaults.disableVerifyEmailReminder, 13 + ) 14 + const setContext = React.createContext<SetContext>( 15 + (_: persisted.Schema['disableVerifyEmailReminder']) => {}, 16 + ) 17 + 18 + export function Provider({children}: React.PropsWithChildren<{}>) { 19 + const [state, setState] = React.useState( 20 + persisted.get('disableVerifyEmailReminder'), 21 + ) 22 + 23 + const setStateWrapped = React.useCallback( 24 + (value: persisted.Schema['disableVerifyEmailReminder']) => { 25 + setState(value) 26 + persisted.write('disableVerifyEmailReminder', value) 27 + }, 28 + [setState], 29 + ) 30 + 31 + React.useEffect(() => { 32 + return persisted.onUpdate('disableVerifyEmailReminder', next => { 33 + setState(next) 34 + }) 35 + }, [setStateWrapped]) 36 + 37 + return ( 38 + <stateContext.Provider value={state}> 39 + <setContext.Provider value={setStateWrapped}> 40 + {children} 41 + </setContext.Provider> 42 + </stateContext.Provider> 43 + ) 44 + } 45 + 46 + export function useDisableVerifyEmailReminder() { 47 + return React.useContext(stateContext) 48 + } 49 + 50 + export function useSetDisableVerifyEmailReminder() { 51 + return React.useContext(setContext) 52 + }
+4 -1
src/state/preferences/index.tsx
··· 16 import {Provider as DisableReplyMetricsProvider} from './disable-reply-metrics' 17 import {Provider as DisableRepostsMetricsProvider} from './disable-reposts-metrics' 18 import {Provider as DisableSavesMetricsProvider} from './disable-saves-metrics' 19 import {Provider as DisableViaRepostNotificationProvider} from './disable-via-repost-notification' 20 import {Provider as EnableSquareAvatarsProvider} from './enable-square-avatars' 21 import {Provider as EnableSquareButtonsProvider} from './enable-square-buttons' ··· 97 <HideSimilarAccountsRecommProvider> 98 <EnableSquareAvatarsProvider> 99 <EnableSquareButtonsProvider> 100 - {children} 101 </EnableSquareButtonsProvider> 102 </EnableSquareAvatarsProvider> 103 </HideSimilarAccountsRecommProvider>
··· 16 import {Provider as DisableReplyMetricsProvider} from './disable-reply-metrics' 17 import {Provider as DisableRepostsMetricsProvider} from './disable-reposts-metrics' 18 import {Provider as DisableSavesMetricsProvider} from './disable-saves-metrics' 19 + import {Provider as DisableVerifyEmailReminderProvider} from './disable-verify-email-reminder' 20 import {Provider as DisableViaRepostNotificationProvider} from './disable-via-repost-notification' 21 import {Provider as EnableSquareAvatarsProvider} from './enable-square-avatars' 22 import {Provider as EnableSquareButtonsProvider} from './enable-square-buttons' ··· 98 <HideSimilarAccountsRecommProvider> 99 <EnableSquareAvatarsProvider> 100 <EnableSquareButtonsProvider> 101 + <DisableVerifyEmailReminderProvider> 102 + {children} 103 + </DisableVerifyEmailReminderProvider> 104 </EnableSquareButtonsProvider> 105 </EnableSquareAvatarsProvider> 106 </HideSimilarAccountsRecommProvider>