-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ui/checkboxgrid-optimization
- Loading branch information
Showing
20 changed files
with
683 additions
and
49 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
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
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
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
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
37 changes: 37 additions & 0 deletions
37
platform/firecamp-ui/src/components/grid/ContainerLayout.tsx
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,37 @@ | ||
import { FC } from 'react'; | ||
import { Container, ContainerProps, createStyles } from '@mantine/core'; | ||
|
||
const useStyles = createStyles(() => ({ | ||
root: { | ||
padding: '0px', | ||
}, | ||
})); | ||
export interface IContainerLayout extends ContainerProps { | ||
/** | ||
* to use the container wrapped in flex layout | ||
*/ | ||
flex?: boolean; | ||
/** | ||
* When the child content overflows, this will add the necessary scrollbar and prevent the row from getting larger | ||
*/ | ||
overflow?: boolean; | ||
} | ||
const ContainerLayout: FC<IContainerLayout> = ({ | ||
flex = false, | ||
overflow = false, | ||
children = <></>, | ||
className = '', | ||
...props | ||
}) => { | ||
const { classes, cx } = useStyles(); | ||
return ( | ||
<Container | ||
className={cx('invisible-scrollbar', { 'flex-1': flex }, {'overflow-auto': overflow}, classes.root, className)} | ||
fluid | ||
{...props} | ||
> | ||
{children} | ||
</Container> | ||
); | ||
}; | ||
export default ContainerLayout; |
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 { FC } from 'react'; | ||
import cx from 'classnames'; | ||
import { Flex, FlexProps } from '@mantine/core'; | ||
|
||
export interface IFlexLayout extends FlexProps { | ||
/** | ||
* to use the flex layout filling all available space | ||
*/ | ||
flex?: boolean; | ||
/** | ||
* When the child content overflows, this will add the necessary scrollbar and prevent the row from getting larger | ||
*/ | ||
overflow?: boolean; | ||
} | ||
const FlexLayout: FC<IFlexLayout> = ({ | ||
flex = false, | ||
overflow = false, | ||
children = <></>, | ||
className = '', | ||
...props | ||
}) => { | ||
return ( | ||
<Flex | ||
direction={'row'} | ||
className={cx({ 'flex-1': flex }, {'overflow-auto': overflow}, className)} | ||
{...props} | ||
> | ||
{children} | ||
</Flex> | ||
); | ||
}; | ||
export default FlexLayout; |
Oops, something went wrong.