Skip to content

Commit

Permalink
Updates the cancel button
Browse files Browse the repository at this point in the history
Signed-off-by: BOUTIER Charly <charly.boutier@rte-france.com>
  • Loading branch information
BOUTIER Charly committed Jan 19, 2024
1 parent 6bf09cf commit 19db011
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 48 deletions.
16 changes: 0 additions & 16 deletions src/components/app-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,6 @@ let lightTheme = createTheme({
},
});

lightTheme = createTheme(lightTheme, {
palette: {
customButton: {
main: lightTheme.palette.text.primary,
},
},
});

let darkTheme = createTheme({
palette: {
mode: 'dark',
Expand Down Expand Up @@ -132,14 +124,6 @@ let darkTheme = createTheme({
},
});

darkTheme = createTheme(darkTheme, {
palette: {
customButton: {
main: darkTheme.palette.text.primary,
},
},
});

const getMuiTheme = (theme) => {
if (theme === LIGHT_THEME) {
return lightTheme;
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/access-rights-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const AccessRightsDialog = ({
)}
</DialogContent>
<DialogActions>
<CancelButton color={'customButton'} onClick={handleClose} />
<CancelButton onClick={handleClose} />
<Button onClick={handleClick} variant="outlined">
<FormattedMessage id="edit" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ const CustomMuiDialog: FunctionComponent<ICustomMuiDialog> = ({
</DialogTitle>
<DialogContent>{children}</DialogContent>
<DialogActions>
<CancelButton
color={'customButton'}
onClick={handleCancel}
/>
<CancelButton onClick={handleCancel} />
<SubmitButton
variant="outlined"
disabled={disabledSave}
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/create-directory-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const CreateDirectoryDialog = ({
{error !== '' && <Alert severity="error">{error}</Alert>}
</DialogContent>
<DialogActions>
<CancelButton color={'customButton'} onClick={handleClose} />
<CancelButton onClick={handleClose} />
<Button
disabled={!canCreate()}
onClick={handleClick}
Expand Down
5 changes: 1 addition & 4 deletions src/components/dialogs/csv-import-filter-creation-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,7 @@ const CsvImportFilterCreationDialog = ({
</DialogContentText>
</DialogContent>
<DialogActions>
<CancelButton
color={'customButton'}
onClick={handleCancelDialog}
/>
<CancelButton onClick={handleCancelDialog} />
<Button
onClick={() => handleReplacePopupConfirmation()}
>
Expand Down
8 changes: 2 additions & 6 deletions src/components/dialogs/delete-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,11 @@ const DeleteDialog = ({
{error !== '' && <Alert severity="error">{error}</Alert>}
</DialogContent>
<DialogActions>
<CancelButton
onClick={handleClose}
variant="outlined"
disabled={loadingState}
/>
<CancelButton onClick={handleClose} disabled={loadingState} />
<Button
onClick={handleClick}
variant="outlined"
disabled={loadingState}
color={'customButton'}
>
{(loadingState && <CircularProgress size={24} />) || (
<FormattedMessage id="delete" />
Expand Down
1 change: 0 additions & 1 deletion src/components/dialogs/directory-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ const DirectorySelector = (props) => {
data={data}
onlyLeaves={false}
sortMethod={sortAlphabetically}
cancelButtonProps={{ color: 'customButton' }}
{...props}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/rename-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const RenameDialog = ({
{error && <Alert severity="error">{error}</Alert>}
</DialogContent>
<DialogActions>
<CancelButton color={'customButton'} onClick={handleClose} />
<CancelButton onClick={handleClose} />
<Button
onClick={handleClick}
disabled={!canRename()}
Expand Down
4 changes: 2 additions & 2 deletions src/components/dialogs/replace-with-script-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const ReplaceWithScriptDialog = ({ id, open, onClose, onClick, title }) => {
</DialogContentText>
</DialogContent>
<DialogActions>
<CancelButton onClick={handleClose} variant="outlined" />
<Button onClick={handleClick} color={'customButton'}>
<CancelButton onClick={handleClose} />
<Button onClick={handleClick} variant="outlined">
<FormattedMessage id="validate" />
</Button>
</DialogActions>
Expand Down
5 changes: 1 addition & 4 deletions src/components/utils/popup-confirmation-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ const PopupConfirmationDialog = ({
</DialogContentText>
</DialogContent>
<DialogActions>
<CancelButton
color={'customButton'}
onClick={() => setOpenConfirmationPopup(false)}
/>
<CancelButton onClick={() => setOpenConfirmationPopup(false)} />
<Button onClick={handlePopupConfirmation} variant="outlined">
<FormattedMessage id="validate" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ const CsvUploader = ({
</DialogContentText>
</DialogContent>
<DialogActions>
<CancelButton
color={'customButton'}
onClick={handleCancelDialog}
/>
<CancelButton onClick={handleCancelDialog} />
<Button onClick={() => handleReplacePopupConfirmation()}>
<FormattedMessage id="replace" />
</Button>
Expand Down Expand Up @@ -235,10 +232,7 @@ const CsvUploader = ({
</div>
</DialogContent>
<DialogActions>
<CancelButton
color={'customButton'}
onClick={handleClose}
/>
<CancelButton onClick={handleClose} />
<Button
variant="outlined"
onClick={() => handleOpenCSVConfirmationDataDialog()}
Expand Down

0 comments on commit 19db011

Please sign in to comment.