/
githubmirror
/
jest
Обзор
Документация
Войти
/
githubmirror
/
jest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
website/src/components/v1/Container.js
39 строк
1 KB
Simen Bekkhus
chore: update react-native example (#16318)
10 авг 2026, 21:43
Не верифицирован
10 авг 2026, 21:43
cfc27d4
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import React from 'react'; import clsx from 'clsx'; export default function Container({ background = null, padding = [], wrapper = true, ...props }) { const containerClasses = clsx('containerV1', props.className, { darkBackground: background === 'dark', highlightBackground: background === 'highlight', lightBackground: background === 'light', paddingAll: padding.includes('all'), paddingBottom: padding.includes('bottom'), paddingLeft: padding.includes('left'), paddingRight: padding.includes('right'), paddingTop: padding.includes('top'), }); let wrappedChildren; if (wrapper) { wrappedChildren = <div className="wrapperV1">{props.children}</div>; } else { wrappedChildren = props.children; } return ( <div className={containerClasses} id={props.id}> {wrappedChildren} </div> ); }