/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
shared/fs/filepreview/normal-preview.tsx
38 строк
1021 B
chrisnojima
refactor(styles): theme via hooks, no android remount (#29515)
08 авг 2026, 02:24
Не верифицирован
08 авг 2026, 02:24
a41d38e
Код
Авторство
О чём код?
import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import * as Kbfs from '../common' import Footer from '../footer/footer' import View from './view' type NormalPreviewProps = { path: T.FS.Path onUrlError: (err: string) => void } const NormalPreview = (props: NormalPreviewProps) => { const styles = useStyles() return ( <Kb.Box2 direction="vertical" fullWidth={true} flex={1}> <Kbfs.Errs /> <Kb.Box2 direction="vertical" centerChildren={true} flex={1} fullWidth={true} style={styles.container}> <View path={props.path} onUrlError={props.onUrlError} /> </Kb.Box2> <Footer path={props.path} /> </Kb.Box2> ) } export default NormalPreview const useStyles = Kb.Styles.createStyleHook( theme => ({ container: Kb.Styles.platformStyles({ common: { flexShrink: 1, }, isElectron: {backgroundColor: theme.blueLighter3}, isMobile: {backgroundColor: theme.black}, }), }) as const )