mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
chore: adjust secondayButton onClick
This commit is contained in:
+24
-6
@@ -180,6 +180,7 @@ const TransferToLayingConfirmationModalTable = ({
|
||||
expanded={true}
|
||||
getSubRows={(row) => row.subRows}
|
||||
className={{
|
||||
headerRowClassName: 'border-b border-base-content/10',
|
||||
bodyRowClassName: 'border-none',
|
||||
bodySubRowClassName: () => 'border-none',
|
||||
bodySubRowColumnClassName: () => 'first:p-0',
|
||||
@@ -199,6 +200,7 @@ const TransferToLayingConfirmationModal = ({
|
||||
noteLabel,
|
||||
placeholder = 'Alasan Transfer',
|
||||
primaryButton,
|
||||
secondaryButton,
|
||||
...props
|
||||
}: TransferToLayingConfirmationModalProps) => {
|
||||
const randomId = useId();
|
||||
@@ -224,19 +226,35 @@ const TransferToLayingConfirmationModal = ({
|
||||
text: primaryButton?.text ?? 'Oke',
|
||||
color: primaryButton?.color ?? 'primary',
|
||||
className: 'rounded-lg',
|
||||
onClick: () => {
|
||||
onClick: (e) => {
|
||||
if (withNote) {
|
||||
primaryButton?.onClick?.(notes);
|
||||
} else if (primaryButton && primaryButton?.onClick) {
|
||||
primaryButton?.onClick?.('');
|
||||
} else {
|
||||
closeModalHandler();
|
||||
}
|
||||
|
||||
setNotes('');
|
||||
},
|
||||
}}
|
||||
secondaryButton={{
|
||||
text: 'Cancel',
|
||||
color: 'none',
|
||||
onClick: closeModalHandler,
|
||||
}}
|
||||
secondaryButton={
|
||||
secondaryButton
|
||||
? {
|
||||
text: secondaryButton?.text ?? 'Cancel',
|
||||
color: secondaryButton?.color ?? 'none',
|
||||
onClick: (e) => {
|
||||
if (secondaryButton && secondaryButton?.onClick) {
|
||||
secondaryButton.onClick?.(e);
|
||||
} else {
|
||||
closeModalHandler();
|
||||
}
|
||||
|
||||
setNotes('');
|
||||
},
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
className={{
|
||||
modalBox: 'max-h-full',
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user