/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
shared/chat/punycode-link-warning.tsx
34 строки
934 B
chrisnojima
refactor(styles): theme via hooks, no android remount (#29515)
08 авг 2026, 02:24
Не верифицирован
08 авг 2026, 02:24
a41d38e
Код
Авторство
О чём код?
import * as Kb from '@/common-adapters' import {useSafeNavigation} from '@/util/safe-navigation' import {openURL} from '@/util/misc' type PunycodeLinkWarningProps = { display: string punycode: string url: string } const PunycodeLinkWarning = (props: PunycodeLinkWarningProps) => { const theme = Kb.Styles.useTheme() const {url, display, punycode} = props const nav = useSafeNavigation() const onCancel = () => nav.safeNavigateUp() const onConfirm = () => { void openURL(url) nav.safeNavigateUp() } const description = `The link you clicked on appears to be ${display}, but actually points to ${punycode}.` return ( <Kb.ConfirmModal icon="iconfont-open-browser" iconColor={theme.red} prompt={'Open URL?'} description={description} onCancel={onCancel} onConfirm={onConfirm} confirmText="Yes, open in browser" /> ) } export default PunycodeLinkWarning