-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {Box, Flex, Loader, Overlay} from '@gravity-ui/uikit'; | ||
import React from 'react'; | ||
|
||
type OverlayComponentProps = { | ||
visible?: boolean; | ||
background?: 'base' | 'float'; | ||
}; | ||
|
||
export const OverlayComponent = ({visible, background}: OverlayComponentProps) => { | ||
const anchorRef = React.useRef(null); | ||
|
||
return ( | ||
<Box position="relative"> | ||
<Flex | ||
ref={anchorRef} | ||
style={{ | ||
border: '2px dashed', | ||
}} | ||
width={100} | ||
height={100} | ||
color="var(--g-color-text-secondary)" | ||
alignItems="center" | ||
justifyContent="center" | ||
> | ||
Some text | ||
</Flex> | ||
<Overlay visible={visible} background={background}> | ||
<Loader /> | ||
</Overlay> | ||
</Box> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import dynamic from 'next/dynamic'; | ||
|
||
import {Repos} from '../../../../types/common'; | ||
import {getGithubUrl, getReadmeUrl, mappingOptions} from '../../utils'; | ||
|
||
const getterOptions = {repoName: Repos.Uikit, componentName: 'Overlay'}; | ||
|
||
export const overlayConfig = { | ||
id: 'overlay', | ||
title: 'Overlay', | ||
githubUrl: getGithubUrl(getterOptions), | ||
content: { | ||
readmeUrl: getReadmeUrl(getterOptions), | ||
}, | ||
sandbox: { | ||
component: dynamic(() => import('./OverlayComponent').then((mod) => mod.OverlayComponent)), | ||
props: { | ||
visible: { | ||
type: 'switch', | ||
defaultValue: true, | ||
}, | ||
background: { | ||
type: 'radioButton', | ||
values: mappingOptions(['base', 'float']), | ||
defaultValue: 'base', | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters