deer social fork for personal usage. but you might see a use idk. github mirror
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

hide starter pack stuff

ayla 2f11c097 63410268

+97 -11
+5 -1
src/screens/Search/Explore.tsx
··· 15 15 import {logger} from '#/logger' 16 16 import {type MetricEvents} from '#/logger/metrics' 17 17 import {isNative} from '#/platform/detection' 18 + import {useHideStarterPackStuff} from '#/state/preferences/hide-starter-pack-stuff' 18 19 import {useLanguagePrefs} from '#/state/preferences/languages' 19 20 import {useModerationOpts} from '#/state/preferences/moderation-opts' 20 21 import {RQKEY_ROOT_PAGINATED as useActorSearchPaginatedQueryKeyRoot} from '#/state/queries/actor-search' ··· 217 218 const {data: preferences, error: preferencesError} = usePreferencesQuery() 218 219 const moderationOpts = useModerationOpts() 219 220 const [selectedInterest, setSelectedInterest] = useState<string | null>(null) 221 + 222 + const hideStarterPackStuff = useHideStarterPackStuff() 220 223 221 224 /* 222 225 * Begin special language handling ··· 692 695 i.push(trendingTopicsModule) 693 696 i.push(...suggestedFeedsModule) 694 697 i.push(...suggestedFollowsModule) 695 - i.push(...suggestedStarterPacksModule) 698 + !hideStarterPackStuff && i.push(...suggestedStarterPacksModule) 696 699 i.push(...feedPreviewsModule) 697 700 } else { 698 701 i.push(...suggestedFollowsModule) ··· 708 711 feedPreviewsModule, 709 712 interestsNuxModule, 710 713 useFullExperience, 714 + hideStarterPackStuff, 711 715 ]) 712 716 713 717 const renderItem = useCallback(
+19
src/screens/Settings/DeerSettings.tsx
··· 71 71 useSetHideSimilarAccountsRecomm, 72 72 } from '#/state/preferences/hide-similar-accounts-recommendations' 73 73 import { 74 + useHideStarterPackStuff, 75 + useSetHideStarterPackStuff, 76 + } from '#/state/preferences/hide-starter-pack-stuff' 77 + import { 74 78 useLoadAsPngs, 75 79 useSetLoadAsPngs, 76 80 } from '#/state/preferences/load-small-pngs' ··· 282 286 283 287 const hideSimilarAccountsRecomm = useHideSimilarAccountsRecomm() 284 288 const setHideSimilarAccountsRecomm = useSetHideSimilarAccountsRecomm() 289 + 290 + const hideStarterPackStuff = useHideStarterPackStuff() 291 + const setHideStarterPackStuff = useSetHideStarterPackStuff() 285 292 286 293 const constellationInstance = useConstellationInstance() 287 294 const setConstellationInstanceControl = Dialog.useDialogControl() ··· 572 579 style={[a.w_full]}> 573 580 <Toggle.LabelText style={[a.flex_1]}> 574 581 <Trans>Hide similar accounts recommendations</Trans> 582 + </Toggle.LabelText> 583 + <Toggle.Platform /> 584 + </Toggle.Item> 585 + 586 + <Toggle.Item 587 + name="hide_starter_pack_stuff" 588 + label={_(msg`Hide starter pack stuff`)} 589 + value={hideStarterPackStuff} 590 + onChange={value => setHideStarterPackStuff(value)} 591 + style={[a.w_full]}> 592 + <Toggle.LabelText style={[a.flex_1]}> 593 + <Trans>Hide things that encourage starter pack usage</Trans> 575 594 </Toggle.LabelText> 576 595 <Toggle.Platform /> 577 596 </Toggle.Item>
+2
src/state/persisted/schema.ts
··· 141 141 disableSavesMetrics: z.boolean().optional(), 142 142 disableReplyMetrics: z.boolean().optional(), 143 143 hideSimilarAccountsRecomm: z.boolean().optional(), 144 + hideStarterPackStuff: z.boolean().optional(), 144 145 deerVerification: z 145 146 .object({ 146 147 enabled: z.boolean(), ··· 220 221 disableSavesMetrics: false, 221 222 disableReplyMetrics: false, 222 223 hideSimilarAccountsRecomm: false, 224 + hideStarterPackStuff: true, 223 225 deerVerification: { 224 226 enabled: false, 225 227 // https://deer-social-ayla.pages.dev/profile/did:plc:p2cp5gopk7mgjegy6wadk3ep/post/3lndyqyyr4k2k
+52
src/state/preferences/hide-starter-pack-stuff.tsx
··· 1 + import React from 'react' 2 + 3 + import * as persisted from '#/state/persisted' 4 + 5 + type StateContext = persisted.Schema['hideStarterPackStuff'] 6 + type SetContext = (v: persisted.Schema['hideStarterPackStuff']) => void 7 + 8 + const stateContext = React.createContext<StateContext>( 9 + persisted.defaults.hideStarterPackStuff, 10 + ) 11 + const setContext = React.createContext<SetContext>( 12 + (_: persisted.Schema['hideStarterPackStuff']) => {}, 13 + ) 14 + 15 + export function Provider({children}: React.PropsWithChildren<{}>) { 16 + const [state, setState] = React.useState( 17 + persisted.get('hideStarterPackStuff'), 18 + ) 19 + 20 + const setStateWrapped = React.useCallback( 21 + (hideStarterPackStuff: persisted.Schema['hideStarterPackStuff']) => { 22 + setState(hideStarterPackStuff) 23 + persisted.write('hideStarterPackStuff', hideStarterPackStuff) 24 + }, 25 + [setState], 26 + ) 27 + 28 + React.useEffect(() => { 29 + return persisted.onUpdate( 30 + 'hideStarterPackStuff', 31 + nexthideStarterPackStuff => { 32 + setState(nexthideStarterPackStuff) 33 + }, 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 useHideStarterPackStuff() { 47 + return React.useContext(stateContext) 48 + } 49 + 50 + export function useSetHideStarterPackStuff() { 51 + return React.useContext(setContext) 52 + }
+14 -9
src/view/com/profile/ProfileMenu.tsx
··· 20 20 useDeerVerificationTrusted, 21 21 useSetDeerVerificationTrust, 22 22 } from '#/state/preferences/deer-verification' 23 + import {useHideStarterPackStuff} from '#/state/preferences/hide-starter-pack-stuff' 23 24 import { 24 25 RQKEY as profileQueryKey, 25 26 useProfileBlockMutationQueue, ··· 96 97 profile, 97 98 'ProfileMenu', 98 99 ) 100 + 101 + const hideStarterPackStuff = useHideStarterPackStuff() 99 102 100 103 const blockPromptControl = Prompt.usePromptControl() 101 104 const loggedOutWarningPromptControl = Prompt.usePromptControl() ··· 342 345 )} 343 346 </> 344 347 )} 345 - <Menu.Item 346 - testID="profileHeaderDropdownStarterPackAddRemoveBtn" 347 - label={_(msg`Add to starter packs`)} 348 - onPress={addToStarterPacksDialogControl.open}> 349 - <Menu.ItemText> 350 - <Trans>Add to starter packs</Trans> 351 - </Menu.ItemText> 352 - <Menu.ItemIcon icon={StarterPack} /> 353 - </Menu.Item> 348 + {!hideStarterPackStuff && ( 349 + <Menu.Item 350 + testID="profileHeaderDropdownStarterPackAddRemoveBtn" 351 + label={_(msg`Add to starter packs`)} 352 + onPress={addToStarterPacksDialogControl.open}> 353 + <Menu.ItemText> 354 + <Trans>Add to starter packs</Trans> 355 + </Menu.ItemText> 356 + <Menu.ItemIcon icon={StarterPack} /> 357 + </Menu.Item> 358 + )} 354 359 <Menu.Item 355 360 testID="profileHeaderDropdownListAddRemoveBtn" 356 361 label={_(msg`Add to lists`)}
+5 -1
src/view/screens/Profile.tsx
··· 25 25 import {colors, s} from '#/lib/styles' 26 26 import {useProfileShadow} from '#/state/cache/profile-shadow' 27 27 import {listenSoftReset} from '#/state/events' 28 + import {useHideStarterPackStuff} from '#/state/preferences/hide-starter-pack-stuff' 28 29 import {useModerationOpts} from '#/state/preferences/moderation-opts' 29 30 import {useLabelerInfoQuery} from '#/state/queries/labeler' 30 31 import {resetProfilePostsQueries} from '#/state/queries/post-feed' ··· 180 181 const [currentPage, setCurrentPage] = React.useState(0) 181 182 const {_} = useLingui() 182 183 184 + const hideStarterPackStuff = useHideStarterPackStuff() 185 + 183 186 const [scrollViewTag, setScrollViewTag] = React.useState<number | null>(null) 184 187 185 188 const postsSectionRef = React.useRef<SectionRef>(null) ··· 214 217 const feedGenCount = profile.associated?.feedgens || 0 215 218 const showFeedsTab = isMe || feedGenCount > 0 216 219 const starterPackCount = profile.associated?.starterPacks || 0 217 - const showStarterPacksTab = isMe || starterPackCount > 0 220 + const showStarterPacksTab = 221 + (!hideStarterPackStuff && isMe) || starterPackCount > 0 218 222 // subtract starterpack count from list count, since starterpacks are a type of list 219 223 const listCount = (profile.associated?.lists || 0) - starterPackCount 220 224 const showListsTab = true && (isMe || listCount > 0)