diff --git a/packages/vkui/src/components/Scaffold/README.md b/packages/vkui/src/components/Scaffold/README.md new file mode 100644 index 00000000000..380c95cfac8 --- /dev/null +++ b/packages/vkui/src/components/Scaffold/README.md @@ -0,0 +1,53 @@ +```jsx { "props": { "layout": false, "adaptivity": true } } +const AdaptiveSpacingRenderer = () => { + const { sizeX } = useAdaptivityConditionalRender(); + + return ( + + {sizeX.compact && } + {sizeX.regular && } + + ); +}; + + + Scaffold Screen + + } + bottomBar={ + + + + + + + + + } +> + + + content + content + content + content + content + content + content + content + content + content + content + content + content + content + content + content + content + content + content + +; +``` diff --git a/packages/vkui/src/components/Scaffold/Scaffold.module.css b/packages/vkui/src/components/Scaffold/Scaffold.module.css new file mode 100644 index 00000000000..16990373852 --- /dev/null +++ b/packages/vkui/src/components/Scaffold/Scaffold.module.css @@ -0,0 +1,12 @@ +.Scaffold__host { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + overflow: hidden; +} + +.Scaffold__content { + flex-grow: 1; + overflow: auto; +} diff --git a/packages/vkui/src/components/Scaffold/Scaffold.tsx b/packages/vkui/src/components/Scaffold/Scaffold.tsx new file mode 100644 index 00000000000..a9bdc2bb54b --- /dev/null +++ b/packages/vkui/src/components/Scaffold/Scaffold.tsx @@ -0,0 +1,36 @@ +import React from 'react'; +import { hasReactNode } from '@vkontakte/vkjs'; +import { HasChildren, HasComponent } from '../../types'; +import { RootComponent } from '../RootComponent/RootComponent'; +import styles from './Scaffold.module.css'; + +function Wrapper({ Component = 'div', ...props }: T) { + return hasReactNode(props.children) ? : null; +} + +function TopBar(props: HasChildren) { + return ; +} + +function Content(props: HasChildren) { + return
; +} + +function BottomBar(props: HasChildren) { + return ; +} + +export interface ScaffoldProps extends HasChildren { + topBar?: React.ReactNode; + bottomBar?: React.ReactNode; +} + +export const Scaffold = ({ topBar, children, bottomBar, ...restProps }: ScaffoldProps) => { + return ( + + {topBar} + {children} + {bottomBar} + + ); +}; diff --git a/styleguide/config.js b/styleguide/config.js index aec0631ede9..97d99177493 100644 --- a/styleguide/config.js +++ b/styleguide/config.js @@ -166,6 +166,7 @@ const baseConfig = { `../${VKUI_PACKAGE.PATHS.COMPONENTS_DIR}/FixedLayout/FixedLayout.tsx`, `../${VKUI_PACKAGE.PATHS.COMPONENTS_DIR}/HorizontalScroll/HorizontalScroll.tsx`, `../${VKUI_PACKAGE.PATHS.COMPONENTS_DIR}/AspectRatio/AspectRatio.tsx`, + `../${VKUI_PACKAGE.PATHS.COMPONENTS_DIR}/Scaffold/Scaffold.tsx`, ], }, {