Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Takendown state + in-app takedown appeals #7566

Merged
merged 8 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"icons:optimize": "svgo -f ./assets/icons"
},
"dependencies": {
"@atproto/api": "^0.13.30",
"@atproto/api": "^0.13.31",
"@bitdrift/react-native": "^0.6.2",
"@braintree/sanitize-url": "^6.0.2",
"@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet",
Expand Down
20 changes: 13 additions & 7 deletions src/components/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ export function useLink({
onPress: outerOnPress,
onLongPress: outerOnLongPress,
shareOnLongPress,
overridePresentation,
}: BaseLinkProps & {
displayText: string
overridePresentation?: boolean
}) {
const navigation = useNavigationDeduped()
const {href} = useLinkProps<AllNavigatorParams>({
Expand Down Expand Up @@ -116,7 +118,7 @@ export function useLink({
})
} else {
if (isExternal) {
openLink(href)
openLink(href, overridePresentation)
} else {
const shouldOpenInNewTab = shouldClickOpenNewTab(e)

Expand Down Expand Up @@ -158,6 +160,7 @@ export function useLink({
closeModal,
action,
navigation,
overridePresentation,
],
)

Expand Down Expand Up @@ -254,12 +257,13 @@ export function Link({
export type InlineLinkProps = React.PropsWithChildren<
BaseLinkProps &
TextStyleProp &
Pick<TextProps, 'selectable' | 'numberOfLines'>
> &
Pick<ButtonProps, 'label' | 'accessibilityHint'> & {
disableUnderline?: boolean
title?: TextProps['title']
}
Pick<TextProps, 'selectable' | 'numberOfLines'> &
Pick<ButtonProps, 'label' | 'accessibilityHint'> & {
disableUnderline?: boolean
title?: TextProps['title']
overridePresentation?: boolean
}
>

export function InlineLinkText({
children,
Expand All @@ -274,6 +278,7 @@ export function InlineLinkText({
label,
shareOnLongPress,
disableUnderline,
overridePresentation,
...rest
}: InlineLinkProps) {
const t = useTheme()
Expand All @@ -286,6 +291,7 @@ export function InlineLinkText({
onPress: outerOnPress,
onLongPress: outerOnLongPress,
shareOnLongPress,
overridePresentation,
})
const {
state: hovered,
Expand Down
3 changes: 1 addition & 2 deletions src/components/dms/ReportDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,10 @@ function SubmitStep({
multiline
defaultValue={details}
onChangeText={setDetails}
label="Text field"
label={_(msg`Text field`)}
style={{paddingRight: 60}}
numberOfLines={5}
/>

<View
style={[
a.absolute,
Expand Down
2 changes: 2 additions & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export const MAX_DM_GRAPHEME_LENGTH = 1000
// but increasing limit per user feedback
export const MAX_ALT_TEXT = 2000

export const MAX_REPORT_REASON_GRAPHEME_LENGTH = 2000

export function IS_TEST_USER(handle?: string) {
return handle && handle?.endsWith('.test')
}
Expand Down
7 changes: 6 additions & 1 deletion src/lib/statsig/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export type LogEvents = {
withPassword: boolean
}
'account:loggedOut': {
logContext: 'SwitchAccount' | 'Settings' | 'SignupQueued' | 'Deactivated'
logContext:
| 'SwitchAccount'
| 'Settings'
| 'SignupQueued'
| 'Deactivated'
| 'Takendown'
scope: 'current' | 'every'
}
'notifications:openApp': {}
Expand Down
45 changes: 21 additions & 24 deletions src/screens/SignupQueued.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ export function SignupQueued() {
</Button>
)

const logoutBtn = (
<Button
variant="ghost"
size="large"
color="primary"
label={_(msg`Log out`)}
onPress={() => logoutCurrentAccount('SignupQueued')}>
<ButtonText>
<Trans>Log out</Trans>
</ButtonText>
</Button>
)

const webLayout = isWeb && gtMobile

return (
<Modal
visible
Expand All @@ -108,7 +123,7 @@ export function SignupQueued() {
<Logo width={120} />
</View>

<Text style={[a.text_4xl, a.font_bold, a.pb_sm]}>
<Text style={[a.text_4xl, a.font_heavy, a.pb_sm]}>
<Trans>You're in line</Trans>
</Text>
<P style={[t.atoms.text_contrast_medium]}>
Expand Down Expand Up @@ -153,7 +168,7 @@ export function SignupQueued() {
</P>
</View>

{isWeb && gtMobile && (
{webLayout && (
<View
style={[
a.w_full,
Expand All @@ -162,43 +177,25 @@ export function SignupQueued() {
a.pt_5xl,
{paddingBottom: 200},
]}>
<Button
variant="ghost"
size="large"
label={_(msg`Log out`)}
onPress={() => logoutCurrentAccount('SignupQueued')}>
<ButtonText style={[{color: t.palette.primary_500}]}>
<Trans>Log out</Trans>
</ButtonText>
</Button>
{logoutBtn}
{checkBtn}
</View>
)}
</View>
</View>
</ScrollView>

{(!isWeb || !gtMobile) && (
{!webLayout && (
<View
style={[
a.align_center,
t.atoms.bg,
gtMobile ? a.px_5xl : a.px_xl,
{
paddingBottom: Math.max(insets.bottom, a.pb_5xl.paddingBottom),
},
{paddingBottom: Math.max(insets.bottom, a.pb_5xl.paddingBottom)},
]}>
<View style={[a.w_full, a.gap_sm, {maxWidth: COL_WIDTH}]}>
{checkBtn}
<Button
variant="ghost"
size="large"
label={_(msg`Log out`)}
onPress={() => logoutCurrentAccount('SignupQueued')}>
<ButtonText style={[{color: t.palette.primary_500}]}>
<Trans>Log out</Trans>
</ButtonText>
</Button>
{logoutBtn}
</View>
</View>
)}
Expand Down
Loading
Loading