pref: pin save button to the bottom of the page in theme preview (#6449)

#### What type of PR is this?

/kind improvement
/area ui
/milestone 2.19.x

#### What this PR does / why we need it:

将主题预览中的保存功能固定在底部,方便当主题设置项过多时进行保存。

为了不影响保存功能,因此此 PR 移除了本来在左下角悬浮的选择主题按钮。选择主题可以直接在右上角进行点击。

#### Which issue(s) this PR fixes:

Fixes #6448 

#### Does this PR introduce a user-facing change?
```release-note
在主题预览界面中将保存按钮固定在底部
```
pull/6453/head
Takagi 2024-08-08 16:24:37 +08:00 committed by GitHub
parent 94f28cc76e
commit 332f4f8728
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 18 additions and 35 deletions

View File

@ -9,7 +9,6 @@ import type {
} from "@halo-dev/api-client"; } from "@halo-dev/api-client";
import { consoleApiClient } from "@halo-dev/api-client"; import { consoleApiClient } from "@halo-dev/api-client";
import { import {
IconArrowLeft,
IconComputer, IconComputer,
IconLink, IconLink,
IconPalette, IconPalette,
@ -29,6 +28,7 @@ import { storeToRefs } from "pinia";
import { computed, markRaw, onMounted, ref, toRaw } from "vue"; import { computed, markRaw, onMounted, ref, toRaw } from "vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import ThemePreviewListItem from "./ThemePreviewListItem.vue"; import ThemePreviewListItem from "./ThemePreviewListItem.vue";
import StickyBlock from "@/components/sticky-block/StickyBlock.vue";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@ -333,8 +333,11 @@ const iframeClasses = computed(() => {
/> />
</FormKit> </FormKit>
</div> </div>
<div v-permission="['system:themes:manage']" class="pt-5"> <StickyBlock
<div class="flex justify-start"> v-permission="['system:themes:manage']"
class="-mx-4 -mb-4 -mr-3 rounded-b-base rounded-t-lg bg-white p-4 pt-5"
position="bottom"
>
<VButton <VButton
:loading="saving" :loading="saving"
type="secondary" type="secondary"
@ -346,8 +349,7 @@ const iframeClasses = computed(() => {
> >
{{ $t("core.common.buttons.save") }} {{ $t("core.common.buttons.save") }}
</VButton> </VButton>
</div> </StickyBlock>
</div>
</div> </div>
</div> </div>
</transition> </transition>
@ -383,25 +385,6 @@ const iframeClasses = computed(() => {
</li> </li>
</ul> </ul>
</transition> </transition>
<transition
enter-active-class="transform transition ease-in-out duration-300"
enter-from-class="translate-y-full"
enter-to-class="translate-y-0"
leave-active-class="transform transition ease-in-out duration-300"
leave-from-class="translate-y-0"
leave-to-class="translate-y-full"
>
<div v-if="settingsVisible" class="fixed bottom-2 left-2">
<VButton
size="md"
circle
type="primary"
@click="handleOpenThemes"
>
<IconArrowLeft />
</VButton>
</div>
</transition>
</OverlayScrollbarsComponent> </OverlayScrollbarsComponent>
</transition> </transition>
<div <div