Skip to content

Commit

Permalink
refactor: Update conditional reference for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
dmkirshon committed Jan 24, 2024
1 parent 6fc5c0f commit 2b7c4ec
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions apps/studio/src/pages/home/library/MintSong.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ const MintSong = () => {
? dirty
: values.isMinting;

// if minting has been toggled but mint hasn't been initiated
const isMintingFormVisible = !isMintingInitiated && values.isMinting;

const isStepOneButtonDisabled =
isMintingFormVisible && (!isVerified || !wallet);

const handleChangeOwners = (values: ReadonlyArray<Owner>) => {
setFieldValue("owners", values);
};
Expand Down Expand Up @@ -347,7 +353,7 @@ const MintSong = () => {
</Box>
) }

{ !isMintingInitiated && values.isMinting && !isVerified && (
{ isMintingFormVisible && !isVerified && (
<Alert
action={
<Button
Expand Down Expand Up @@ -376,7 +382,7 @@ const MintSong = () => {
</Alert>
) }

{ !isMintingInitiated && values.isMinting && !wallet && (
{ isMintingFormVisible && !wallet && (
<Alert
action={
<Button
Expand Down Expand Up @@ -424,9 +430,7 @@ const MintSong = () => {

{ isStepOneButtonVisible && (
<Button
disabled={
!isMintingInitiated && (!isVerified || !wallet)
}
disabled={ isStepOneButtonDisabled }
isLoading={ isLoading }
width={
windowWidth &&
Expand Down

0 comments on commit 2b7c4ec

Please sign in to comment.