/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
shared/common-adapters/loading-state-view.tsx
48 строк
1 KB
chrisnojima
refactor(styles): theme via hooks, no android remount (#29515)
08 авг 2026, 02:24
Не верифицирован
08 авг 2026, 02:24
a41d38e
Код
Авторство
О чём код?
import * as Styles from '@/styles' import Text from './text' import {Box2} from './box' import ProgressBar from './progress-bar' import ProgressIndicator from './progress-indicator' const Kb = { Box2, ProgressBar, ProgressIndicator, Text, } type Props = { loading: boolean progress?: number white?: boolean } const LoadingStateView = (props: Props) => { const styles = useStyles() const theme = Styles.useTheme() return props.loading ? ( <Kb.Box2 direction="vertical" fullHeight={true} fullWidth={true} centerChildren={true} gap="small" style={styles.loadingContainer} > <Kb.Box2 direction="horizontal" gap="tiny"> <Kb.ProgressIndicator white={props.white} /> <Kb.Text type="BodySmall" style={props.white && {color: theme.white_40OrWhite_40}}> Loading ... </Kb.Text> </Kb.Box2> {props.progress !== undefined && <Kb.ProgressBar ratio={props.progress} />} </Kb.Box2> ) : null } export default LoadingStateView const useStyles = Styles.createStyleHook(() => ({ loadingContainer: { position: 'absolute', }, }))