-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: markdown is rendered correctly on dataset field overview page (…
1 parent
8866d3c
commit a56e633
Showing
11 changed files
with
107 additions
and
130 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
31 changes: 11 additions & 20 deletions
31
odd-platform-ui/src/components/shared/elements/InfoItem/InfoItem.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 |
---|---|---|
@@ -1,32 +1,23 @@ | ||
import React, { type FC, type ReactElement } from 'react'; | ||
import type { SxProps } from '@mui/system'; | ||
import { Grid, type GridSize } from '@mui/material'; | ||
import { Box } from '@mui/material'; | ||
|
||
interface InfoItemProps { | ||
label: ReactElement; | ||
labelWidth?: GridSize; | ||
info: ReactElement; | ||
sx?: SxProps; | ||
} | ||
|
||
const InfoItem: FC<InfoItemProps> = ({ labelWidth, label, sx, info }) => { | ||
const getXS = () => { | ||
if (labelWidth === 12) return 12; | ||
if (typeof labelWidth === 'number') return (12 - labelWidth) as GridSize; | ||
return 'auto'; | ||
}; | ||
const InfoItem: FC<InfoItemProps> = ({ label, sx, info }) => ( | ||
<Box display='flex' flexWrap='wrap' sx={sx} flexShrink={1}> | ||
<Box display='flex' flexGrow={0.03} alignItems='center'> | ||
{label} | ||
</Box> | ||
|
||
return ( | ||
<Grid container sx={sx}> | ||
<Grid item xs={labelWidth ?? 'auto'} display='flex' alignItems='center'> | ||
{label} | ||
</Grid> | ||
|
||
<Grid item xs={getXS()} display='flex' alignItems='center'> | ||
{info} | ||
</Grid> | ||
</Grid> | ||
); | ||
}; | ||
<Box display='flex' alignItems='center' flexWrap='wrap' width='100%'> | ||
{info} | ||
</Box> | ||
</Box> | ||
); | ||
|
||
export default InfoItem; |
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