/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
shared/deeplinks/error.tsx
45 строк
1 KB
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' type KeybaseLinkErrorBodyProps = { message: string isError: boolean } export const KeybaseLinkErrorBody = (props: KeybaseLinkErrorBodyProps) => { const styles = useStyles() const bannerColor = props.isError ? 'red' : 'green' return ( <Kb.Box2 direction="vertical" fullWidth={true} style={styles.container}> <Kb.Banner color={bannerColor}> <Kb.BannerParagraph bannerColor={bannerColor} content={props.message} selectable={true} /> </Kb.Banner> </Kb.Box2> ) } const LinkError = (props: {error?: string}) => ( <KeybaseLinkErrorBody isError={true} message={props.error ?? 'Invalid page! (sorry)'} /> ) const useStyles = Kb.Styles.createStyleHook(theme => ({ container: Kb.Styles.platformStyles({ common: { backgroundColor: theme.white, }, isElectron: { height: 560, width: 400, }, isMobile: { flexGrow: 1, flexShrink: 1, maxHeight: '100%', width: '100%', }, }), })) import type {StaticScreenProps} from '@react-navigation/core' type OwnProps = StaticScreenProps<{error?: string}> const Screen = (p: OwnProps) => <LinkError {...p.route.params} /> export default Screen