Skip to content

Commit

Permalink
refactor: put modal config to app.config
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Aug 11, 2024
1 parent 74b9541 commit bae34f2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
7 changes: 7 additions & 0 deletions apps/client/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@ export default defineAppConfig({
ui: {
primary: "purple",
gray: "cool",
modal: {
container: "items-center",
overlay: {
background: "bg-black/75 dark:bg-black/75",
},
background: "dark:bg-gray-800",
},
},
});
10 changes: 1 addition & 9 deletions apps/client/components/common/Dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,7 @@ async function onConfirm() {
</script>

<template>
<UModal
:ui="{
container: 'items-center',
overlay: {
background: 'bg-black/75 dark:bg-black/75',
},
background: 'dark:bg-gray-800',
}"
>
<UModal>
<div class="flex h-52 flex-col justify-between p-6 text-gray-900 dark:text-white">
<h2 class="mb-8 text-2xl font-bold">{{ title }}</h2>
<p class="mb-8 max-w-sm text-base text-gray-700 dark:text-gray-300">
Expand Down
7 changes: 0 additions & 7 deletions apps/client/components/main/GamePauseModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
<UModal
v-model="showGamePauseModal"
@close="handleClose"
:ui="{
container: 'items-center',
overlay: {
background: 'bg-black/75 dark:bg-black/75',
},
background: 'dark:bg-gray-800',
}"
>
<div class="flex h-52 flex-col justify-between p-6 text-gray-900 dark:text-white">
<h2 class="mb-8 text-2xl font-bold">游戏暂停</h2>
Expand Down

0 comments on commit bae34f2

Please sign in to comment.