-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(0.9.18) Internal EDAN Publishing + UX Improvements for Upload/Ingest (…
…#596) DPO3DPKRT-754/notification during upload (#590) DPO3DPKRT-813/UX fixes upload and ingestion (#591) DPO3DPKRT-772/internal publishing to EDAN (#592)
- Loading branch information
1 parent
aa7535c
commit f93a861
Showing
50 changed files
with
1,188 additions
and
457 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import React from 'react'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import { Typography, TypographyProps, Tooltip, PropTypes } from '@material-ui/core'; | ||
import { HelpOutline } from '@material-ui/icons'; | ||
|
||
const useStyles = makeStyles(({ spacing }) => ({ | ||
container: { | ||
display: 'flex', | ||
padding: ({ padding }: LabelTooltipTextProps ) => padding ? padding : '0px 10px', | ||
//borderRadius: 5, | ||
//border: `1px dashed #0086ff`, | ||
width: ({ width }: LabelTooltipTextProps ) => width || '100%', | ||
marginTop: ({ marginTop }: LabelTooltipTextProps ) => spacing(marginTop || 0), | ||
//backgroundColor: ({ required, error }: LabelTooltipTextProps ) => (error ? fade(palette.error.light, 0.3) : required ? palette.primary.light : palette.secondary.light) | ||
}, | ||
label: { | ||
color: 'auto' | ||
}, | ||
loading: { | ||
position: 'absolute', | ||
top: 16, | ||
right: 10 | ||
} | ||
})); | ||
|
||
interface LabelTooltipTextProps { | ||
error?: boolean; | ||
label?: string; | ||
labelProps?: TypographyProps; | ||
labelTooltipTxt: string; | ||
marginTop?: number; | ||
padding?: string; | ||
renderLabel?: boolean; | ||
width?: string; | ||
align?: PropTypes.Alignment; | ||
} | ||
|
||
function LabelTooltipText(props: LabelTooltipTextProps): React.ReactElement { | ||
const { label, labelTooltipTxt, labelProps, renderLabel, align = 'left', } = props; | ||
const classes = useStyles(props); | ||
|
||
let content: React.ReactNode = ( | ||
<> | ||
<Typography align={align} className={classes.label} variant='caption'> | ||
{label} | ||
</Typography> | ||
</> | ||
); | ||
|
||
if (labelTooltipTxt) { | ||
const tooltipContent = ( | ||
<> | ||
<Typography align={align} className={classes.label} variant='caption' {...labelProps}> | ||
{label} | ||
<Tooltip title={labelTooltipTxt}> | ||
<HelpOutline fontSize='small' style={{ alignSelf: 'center', cursor: 'pointer', verticalAlign: 'middle', padding: '20px 5px' }} /> | ||
</Tooltip> | ||
</Typography> | ||
</> | ||
); | ||
content = tooltipContent; | ||
} | ||
|
||
if (renderLabel === false) { | ||
content = null; | ||
} | ||
|
||
return <div> {content} </div>; | ||
} | ||
|
||
export default LabelTooltipText; |
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
Oops, something went wrong.