/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
shared/fs/common/path-info.tsx
58 строк
2 KB
chrisnojima
refactor(styles): theme via hooks, no android remount (#29515)
08 авг 2026, 02:24
Не верифицирован
08 авг 2026, 02:24
a41d38e
Код
Авторство
О чём код?
import * as T from '@/constants/types' import {useFsPathInfo} from './hooks' import * as Kb from '@/common-adapters' import * as FS from '@/constants/fs' import {useSystemFileManagerIntegration} from './sfmi' type PathInfoProps = { containerStyle?: Kb.Styles.StylesCrossPlatform knownPathInfo?: T.FS.PathInfo path: T.FS.Path } const useMountPointPath = (platformAfterMountPath: string) => { const sfmi = useSystemFileManagerIntegration() const mount = sfmi.driverStatus.type === T.FS.DriverStatusType.Enabled ? sfmi.preferredMountDirs[0] || sfmi.directMountDir : '' return mount && platformAfterMountPath && `${mount}${platformAfterMountPath}` } const PathInfo = (props: PathInfoProps) => { const styles = useStyles() const pathInfo = useFsPathInfo(props.path, props.knownPathInfo || FS.emptyPathInfo) const mountPointPath = useMountPointPath(pathInfo.platformAfterMountPath) return ( <Kb.Box2 direction="vertical" style={props.containerStyle} fullWidth={true}> {pathInfo.deeplinkPath ? ( <> <Kb.Text type="BodySmallSemibold">Universal path:</Kb.Text> <Kb.CopyText containerStyle={styles.copyPath} multiline={1} text={pathInfo.deeplinkPath} /> </> ) : null} {mountPointPath ? ( <> <Kb.Text type="BodySmallSemibold" style={styles.localPath}> Local path: </Kb.Text> <Kb.CopyText containerStyle={styles.copyPath} multiline={1} text={mountPointPath} /> </> ) : null} </Kb.Box2> ) } export default PathInfo const useStyles = Kb.Styles.createStyleHook( () => ({ copyPath: { marginTop: Kb.Styles.globalMargins.tiny, }, localPath: { marginTop: Kb.Styles.globalMargins.small, }, }) as const )