Skip to content

Commit

Permalink
Remove resend button (#2658)
Browse files Browse the repository at this point in the history
  • Loading branch information
ipasic-softserve authored Nov 20, 2024
1 parent ae0f179 commit 8194cde
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,34 +146,30 @@ const AcceptCooperationModal: FC<AcceptCooperationModalProps> = ({

const onCooperationAccept = () => void handleAcceptCooperation()

const acceptButtonText = isDirty
? 'cooperationsPage.acceptModal.resend'
: 'cooperationsPage.acceptModal.accept'
const acceptButtonType = isDirty
? ButtonTypeEnum.Submit
: ButtonTypeEnum.Button

const buttons =
loading || updateLoading ? (
<Loader size={50} />
) : (
<>
<Box sx={styles.buttonRow}>
{needAction && (
<AppButton
disabled={!isDirty}
type={ButtonTypeEnum.Submit}
variant={ButtonVariantEnum.ContainedLight}
>
{t('cooperationsPage.acceptModal.resend')}
<AppButton onClick={onCooperationAccept} type={acceptButtonType}>
{t(acceptButtonText)}
</AppButton>
)}
<Box sx={styles.buttonRow}>
{needAction && (
<AppButton onClick={onCooperationAccept}>
{t('cooperationsPage.acceptModal.accept')}
</AppButton>
)}
<AppButton
onClick={() => void handleDeclineCooperation()}
variant={ButtonVariantEnum.Tonal}
>
{t('cooperationsPage.acceptModal.decline')}
</AppButton>
</Box>
</>
<AppButton
onClick={() => void handleDeclineCooperation()}
variant={ButtonVariantEnum.Tonal}
>
{t('cooperationsPage.acceptModal.decline')}
</AppButton>
</Box>
)

return (
Expand Down
3 changes: 2 additions & 1 deletion src/types/common/enums/common.enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export enum ButtonVariantEnum {
}

export enum ButtonTypeEnum {
Submit = 'submit'
Submit = 'submit',
Button = 'button'
}

export enum VisibilityEnum {
Expand Down

0 comments on commit 8194cde

Please sign in to comment.