Files
twenty/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveAndCancelButtons.tsx
Pacifique LINJANJA 9917fb0f9e Fix/disable cancel button on save (#6204)
# This PR

- Fix #5675 
- Fix #6118 

Similarly to #5673 I have improved the field creation time by
re-fetching data on page redirection to the object page

<img width="1511" alt="Screenshot 2024-07-10 at 16 06 37"
src="https://github.com/twentyhq/twenty/assets/61581306/8ef8f4cb-4334-4f4c-b5d9-fea11fd5d99a">

@FellipeMTX @Bonapara

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-07-11 07:56:07 +02:00

32 lines
730 B
TypeScript

import styled from '@emotion/styled';
import { CancelButton } from './CancelButton';
import { SaveButton } from './SaveButton';
const StyledContainer = styled.div`
align-items: center;
display: flex;
gap: ${({ theme }) => theme.spacing(1)};
`;
type SaveAndCancelButtonsProps = {
onSave?: () => void;
onCancel?: () => void;
isSaveDisabled?: boolean;
isCancelDisabled?: boolean;
};
export const SaveAndCancelButtons = ({
onSave,
onCancel,
isSaveDisabled,
isCancelDisabled,
}: SaveAndCancelButtonsProps) => {
return (
<StyledContainer>
<CancelButton onCancel={onCancel} disabled={isCancelDisabled} />
<SaveButton onSave={onSave} disabled={isSaveDisabled} />
</StyledContainer>
);
};