Rm BottomSheetLink

This commit is contained in:
Eric Bailey
2024-10-03 11:47:45 -05:00
parent 7620b51cf0
commit 584c29649f
2 changed files with 3 additions and 42 deletions
-39
View File
@@ -241,45 +241,6 @@ export function Link({
)
}
export function BottomSheetLink({
children,
to,
action = 'push',
onPress: outerOnPress,
download,
...rest
}: LinkProps) {
const {href, isExternal, onPress} = useLink({
to,
displayText: typeof children === 'string' ? children : '',
action,
onPress: outerOnPress,
})
return (
<Button
{...rest}
style={[a.justify_start, flatten(rest.style)]}
role="link"
accessibilityRole="link"
href={href}
onPress={download ? undefined : onPress}
{...web({
hrefAttrs: {
target: download ? undefined : isExternal ? 'blank' : undefined,
rel: isExternal ? 'noopener noreferrer' : undefined,
download,
},
dataSet: {
// no underline, only `InlineLink` has underlines
noUnderline: '1',
},
})}>
{children}
</Button>
)
}
export type InlineLinkProps = React.PropsWithChildren<
BaseLinkProps & TextStyleProp & Pick<TextProps, 'selectable'>
> &
@@ -5,7 +5,7 @@ import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {ReportOption, useReportOptions} from '#/lib/moderation/useReportOptions'
import {BottomSheetLink} from '#/components/Link'
import {Link} from '#/components/Link'
import {DMCA_LINK} from '#/components/ReportDialog/const'
export {useDialogControl as useReportDialogControl} from '#/components/Dialog'
@@ -129,7 +129,7 @@ export function SelectReportOptionView({
]}>
<Trans>Need to report a copyright violation?</Trans>
</Text>
<BottomSheetLink
<Link
to={DMCA_LINK}
label={_(msg`View details for reporting a copyright violation`)}
size="small"
@@ -139,7 +139,7 @@ export function SelectReportOptionView({
<Trans>View details</Trans>
</ButtonText>
<ButtonIcon position="right" icon={SquareArrowTopRight} />
</BottomSheetLink>
</Link>
</View>
)}
</View>