/
Muip
/
ProBody
Обзор
Документация
Войти
/
Muip
/
ProBody
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
components/Space.tsx
30 строк
644 B
chmerev
new
14 авг 2024, 12:02
14 авг 2024, 12:02
595f266
Код
Авторство
О чём код?
import React from 'react'; import { ViewProps, View } from 'react-native'; import AppStyle from '../constants/AppStyle'; type ASeparatorProps = ViewProps & { size?: 'small' | 'medium' | 'large' } const ASeparator: React.FC<ASeparatorProps> = (props) => { let height = AppStyle.margin; switch (props.size) { case 'small': height = AppStyle.margin; break; case 'medium': height = AppStyle.margin * 2; break; case 'large': height = AppStyle.margin * 4; break; default: height = AppStyle.margin * 2; break; } return <View {...props} style={[{ height: height }, props.style]} /> } export default ASeparator;