/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
shared/common-adapters/loading.tsx
31 строка
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 {Box2} from './box' import ProgressIndicator from './progress-indicator' const Kb = { Box2, ProgressIndicator, } // full-size centered spinner, for screens that have nothing to show yet export const LoadingScreen = (props: {type?: 'Small' | 'Large' | 'Huge'}) => ( <Kb.Box2 direction="vertical" fullHeight={true} fullWidth={true} centerChildren={true} padding="small"> <Kb.ProgressIndicator type={props.type} /> </Kb.Box2> ) // spinner covering the parent (which needs relative positioning) while keeping content visible export const LoadingOverlay = (props: {show: boolean}) => { const styles = useStyles() return props.show ? ( // fullWidth/fullHeight required: without them desktop Box2 adds align-self:center, which // collapses this absolutely-positioned box to a content-height band instead of filling. <Kb.Box2 direction="vertical" fullHeight={true} fullWidth={true} centerChildren={true} style={styles.overlay}> <Kb.ProgressIndicator /> </Kb.Box2> ) : null } const useStyles = Styles.createStyleHook(() => ({ overlay: {...Styles.globalStyles.fillAbsolute}, }))