Skip to content

Commit

Permalink
pkp/pkp-lib#10444 Remove computed defination of default modalStyle in…
Browse files Browse the repository at this point in the history
… Dialog component
  • Loading branch information
blesildaramirez committed Nov 8, 2024
1 parent 9903843 commit 74baf4b
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/components/Modal/Dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,16 @@ const props = defineProps({
},
});
const computedStyle = computed(() => {
return ['primary', 'negative', 'success', 'basic'].includes(props.modalStyle)
? props.modalStyle
: 'primary';
});
const styles = computed(() => ({
'modal__panel modal__panel--dialog relative mx-3 w-10/12 max-w-3xl transform overflow-hidden rounded bg-secondary text-start shadow transition-all sm:my-8': true,
'border-none': computedStyle.value === 'basic',
'border-s-[14px] border-primary': computedStyle.value === 'primary',
'border-s-[14px] border-success': computedStyle.value === 'success',
'border-s-[14px] border-negative': computedStyle.value === 'negative',
'border-none': props.modalStyle === 'basic',
'border-s-[14px] border-primary': props.modalStyle === 'primary',
'border-s-[14px] border-success': props.modalStyle === 'success',
'border-s-[14px] border-negative': props.modalStyle === 'negative',
}));
const icon = computed(() => {
switch (computedStyle.value) {
switch (props.modalStyle) {
case 'negative':
return 'Cancel';
case 'success':
Expand All @@ -165,8 +159,8 @@ const icon = computed(() => {
const iconStyles = computed(() => ({
'flex h-12 w-12 items-center justify-center rounded-full': true,
'bg-success': computedStyle.value === 'success',
'bg-negative': computedStyle.value === 'negative',
'bg-success': props.modalStyle === 'success',
'bg-negative': props.modalStyle === 'negative',
}));
const noActions = computed(() => !props.actions?.length);
Expand Down

0 comments on commit 74baf4b

Please sign in to comment.