Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

disable enabling adult content on iOS (#4651)

authored by

Samuel Newman and committed by
GitHub
8621ecd3 b23f1126

+25 -1
+25 -1
src/screens/Moderation/index.tsx
··· 1 1 import React from 'react' 2 - import {View} from 'react-native' 2 + import {Linking, View} from 'react-native' 3 3 import {useSafeAreaFrame} from 'react-native-safe-area-context' 4 4 import {ComAtprotoLabelDefs} from '@atproto/api' 5 5 import {LABELS} from '@atproto/api' ··· 10 10 import {getLabelingServiceTitle} from '#/lib/moderation' 11 11 import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types' 12 12 import {logger} from '#/logger' 13 + import {isIOS} from '#/platform/detection' 13 14 import { 14 15 useMyLabelersQuery, 15 16 usePreferencesQuery, ··· 202 203 [setAdultContentPref], 203 204 ) 204 205 206 + const disabledOnIOS = isIOS && !adultContentEnabled 207 + 205 208 return ( 206 209 <ScrollView 207 210 contentContainerStyle={[ ··· 324 327 a.flex_row, 325 328 a.align_center, 326 329 a.justify_between, 330 + disabledOnIOS && {opacity: 0.5}, 327 331 ]}> 328 332 <Text style={[a.font_semibold, t.atoms.text_contrast_high]}> 329 333 <Trans>Enable adult content</Trans> 330 334 </Text> 331 335 <Toggle.Item 332 336 label={_(msg`Toggle to enable or disable adult content`)} 337 + disabled={disabledOnIOS} 333 338 name="adultContent" 334 339 value={adultContentEnabled} 335 340 onChange={onToggleAdultContentEnabled}> ··· 345 350 </View> 346 351 </Toggle.Item> 347 352 </View> 353 + {disabledOnIOS && ( 354 + <View style={[a.pb_lg, a.px_lg]}> 355 + <Text> 356 + <Trans> 357 + Adult content can only be enabled via the Web at{' '} 358 + <InlineLinkText 359 + to="" 360 + onPress={evt => { 361 + evt.preventDefault() 362 + Linking.openURL('https://bsky.app/') 363 + return false 364 + }}> 365 + bsky.app 366 + </InlineLinkText> 367 + . 368 + </Trans> 369 + </Text> 370 + </View> 371 + )} 348 372 <Divider /> 349 373 </> 350 374 )}