Skip to content

Commit

Permalink
typos, rm layoutanimation, fix link
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzius committed Jan 23, 2025
1 parent d32b8aa commit 6a8ebe5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
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
23 changes: 9 additions & 14 deletions src/screens/Takendown.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useMemo, useState} from 'react'
import {LayoutAnimation, Modal, View} from 'react-native'
import {Modal, View} from 'react-native'
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
import {useSafeAreaInsets} from 'react-native-safe-area-context'
import {StatusBar} from 'expo-status-bar'
Expand Down Expand Up @@ -73,7 +73,7 @@ export function Takendown() {
isPending || reasonGraphemeLength > MAX_REPORT_REASON_GRAPHEME_LENGTH
}>
<ButtonText>
<Trans>Submit appeal</Trans>
<Trans>Submit Appeal</Trans>
</ButtonText>
{isPending && <ButtonIcon icon={Loader} />}
</Button>
Expand All @@ -85,7 +85,7 @@ export function Takendown() {
label={_(msg`Log out`)}
onPress={() => logoutCurrentAccount('Takendown')}>
<ButtonText>
<Trans>Log out</Trans>
<Trans>Log Out</Trans>
</ButtonText>
</Button>
)
Expand All @@ -97,10 +97,7 @@ export function Takendown() {
size="large"
color="secondary"
label={_(msg`Cancel`)}
onPress={() => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
setIsAppealling(false)
}}>
onPress={() => setIsAppealling(false)}>
<ButtonText>
<Trans>Cancel</Trans>
</ButtonText>
Expand All @@ -112,12 +109,9 @@ export function Takendown() {
size="large"
color="secondary"
label={_(msg`Appeal suspension`)}
onPress={() => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
setIsAppealling(true)
}}>
onPress={() => setIsAppealling(true)}>
<ButtonText>
<Trans>Appeal suspension</Trans>
<Trans>Appeal Suspension</Trans>
</ButtonText>
</Button>
)
Expand Down Expand Up @@ -159,7 +153,7 @@ export function Takendown() {
<P style={[t.atoms.text_contrast_medium, a.text_center]}>
<Trans>
Your appeal has been submitted. If your appeal succeeds,
you receive an email.
you will receive an email.
</Trans>
</P>
) : (
Expand Down Expand Up @@ -222,7 +216,8 @@ export function Takendown() {
<InlineLinkText
label={_(msg`Bluesky Social Terms of Service`)}
to="https://bsky.social/about/support/tos"
style={[a.text_md, a.leading_normal]}>
style={[a.text_md, a.leading_normal]}
overridePresentation>
Bluesky Social Terms of Service
</InlineLinkText>
. You have been sent an email outlining the specific violation
Expand Down

0 comments on commit 6a8ebe5

Please sign in to comment.