-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display account entitlements (#7414)
* wip * removed state from some dialogs --------- Co-authored-by: Carlos Cano <carlos@alkem.io>
- Loading branch information
Showing
16 changed files
with
294 additions
and
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Box, IconButton, Tooltip } from '@mui/material'; | ||
import RoundedIcon from '@/core/ui/icon/RoundedIcon'; | ||
import AddIcon from '@mui/icons-material/Add'; | ||
import { Caption } from '@/core/ui/typography'; | ||
|
||
const CreationButton = ({ | ||
disabledTooltip, | ||
disabled, | ||
onClick, | ||
}: { | ||
disabledTooltip: string; | ||
onClick: () => void; | ||
disabled?: boolean; | ||
}) => { | ||
const { t } = useTranslation(); | ||
|
||
const button = ( | ||
<IconButton | ||
aria-label={t('common.add')} | ||
aria-disabled={disabled} | ||
aria-haspopup="true" | ||
size="small" | ||
onClick={onClick} | ||
disabled={disabled} | ||
> | ||
<RoundedIcon component={AddIcon} size="medium" iconSize="small" disabled={disabled} aria-disabled={disabled} /> | ||
</IconButton> | ||
); | ||
|
||
return disabled && disabledTooltip ? ( | ||
<Tooltip arrow placement="top" title={<Caption>{disabledTooltip}</Caption>}> | ||
<Box>{button}</Box> | ||
</Tooltip> | ||
) : ( | ||
<>{button}</> | ||
); | ||
}; | ||
|
||
export default CreationButton; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Tooltip } from '@mui/material'; | ||
import { Caption, Text } from '@/core/ui/typography/components'; | ||
import React from 'react'; | ||
|
||
const TextWithTooltip = ({ text, tooltip }: { text: string; tooltip: string }) => { | ||
return ( | ||
<Tooltip arrow title={<Caption>{tooltip}</Caption>} placement="top"> | ||
<Text>{text}</Text> | ||
</Tooltip> | ||
); | ||
}; | ||
|
||
export default TextWithTooltip; |
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.