Skip to content

Commit

Permalink
Change: Button placement
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremiah Uy <[email protected]>
  • Loading branch information
andregroseth and JeremiahUy committed May 7, 2024
1 parent d33a719 commit 5495db5
Showing 1 changed file with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,33 @@ export const EtterlevelseEditFields = ({

<div className="w-full justify-end">
<div className="flex w-full pb-3 justify-end">
<Button
className="mr-6"
disabled={krav.status === EKravStatus.UTGAATT ? false : disableEdit}
type="button"
variant="secondary"
onClick={() => {
if (!dirty) {
ampli.logEvent('knapp klikket', {
tekst: 'Avbryt uten endring i etterlevelse',
pagePath: location.pathname,
...userRoleEventProp,
})
close()
} else {
setIsAvbryModalOpen(true)
}

// original logic for buttons, uncommet and use code above to test new logic.
// close()
}}
>
{krav.status === EKravStatus.UTGAATT ? 'Lukk' : 'Avbryt'}
</Button>

{kravFilter === EKravFilterType.UTGAATE_KRAV && (
<Button
className="mr-6"
type="button"
disabled={isSubmitting || disableEdit}
onClick={() => {
Expand Down Expand Up @@ -237,31 +262,6 @@ export const EtterlevelseEditFields = ({
)}
</div>

<div className="pb-6 flex justify-end w-full">
<Button
disabled={krav.status === EKravStatus.UTGAATT ? false : disableEdit}
type="button"
variant="tertiary"
onClick={() => {
if (!dirty) {
ampli.logEvent('knapp klikket', {
tekst: 'Avbryt uten endring i etterlevelse',
pagePath: location.pathname,
...userRoleEventProp,
})
close()
} else {
setIsAvbryModalOpen(true)
}

// original logic for buttons, uncommet and use code above to test new logic.
// close()
}}
>
{krav.status === EKravStatus.UTGAATT ? 'Lukk' : 'Avbryt'}
</Button>
</div>

{etterlevelse.changeStamp.lastModifiedDate &&
etterlevelse.changeStamp.lastModifiedBy && (
<div className="pb-6 flex justify-end w-full">
Expand Down

0 comments on commit 5495db5

Please sign in to comment.