Skip to content

Commit

Permalink
delete 3 unused button combine
Browse files Browse the repository at this point in the history
  • Loading branch information
alicefate committed Apr 24, 2023
1 parent f707134 commit 067171c
Showing 1 changed file with 1 addition and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import React from 'react';
import { atoms } from '@devlaunchers/components/src/components';

const DialogBoxButton = ({ handleConfirmButton, handleCancelButton, buttonDetail }) => {
// when two buttons are same type, first onClick is Confirm, second is Cancel
// when only one button, onClick is Cancel.
if (buttonDetail[0] == 'alternative primary') {
return (
<>
Expand Down Expand Up @@ -42,44 +40,6 @@ const DialogBoxButton = ({ handleConfirmButton, handleCancelButton, buttonDetail
</atoms.Button>
</>
)
} else if (buttonDetail[0] == 'primary primary') {
return (
<>
<atoms.Button
buttonSize='standard'
buttonType='primary'
onClick={handleConfirmButton}
>
{buttonDetail[1]}
</atoms.Button>
<atoms.Button
buttonSize='standard'
buttonType='primary'
onClick={handleCancelButton}
>
{buttonDetail[2]}
</atoms.Button>
</>
)
} else if (buttonDetail[0] == 'alternative alternative') {
return (
<>
<atoms.Button
buttonSize='standard'
buttonType='alternative'
onClick={handleConfirmButton}
>
{buttonDetail[1]}
</atoms.Button>
<atoms.Button
buttonSize='standard'
buttonType='alternative'
onClick={handleCancelButton}
>
{buttonDetail[2]}
</atoms.Button>
</>
)
} else if (buttonDetail[0] == 'primary') {
return (
<>
Expand All @@ -92,19 +52,7 @@ const DialogBoxButton = ({ handleConfirmButton, handleCancelButton, buttonDetail
</atoms.Button>
</>
)
} else if (buttonDetail[0] == 'alternative') {
return (
<>
<atoms.Button
buttonSize='standard'
buttonType='alternative'
onClick={handleCancelButton}
>
{buttonDetail[1]}
</atoms.Button>
</>
)
}
}
}

export default DialogBoxButton;

0 comments on commit 067171c

Please sign in to comment.