mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 10:01:00 +01:00
feat: add About button component and integrate into MainAppBar and SettingsDrawer
This commit is contained in:
61
frontend/src/components/common/Navigation/AboutBtn.vue
Normal file
61
frontend/src/components/common/Navigation/AboutBtn.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<script setup lang="ts">
|
||||
import type { Events } from "@/types/emitter";
|
||||
import type { Emitter } from "mitt";
|
||||
import { inject } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
// Props
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
block?: boolean;
|
||||
height?: string;
|
||||
rounded?: boolean;
|
||||
withTag?: boolean;
|
||||
}>(),
|
||||
{
|
||||
block: false,
|
||||
height: "",
|
||||
rounded: false,
|
||||
withTag: false,
|
||||
},
|
||||
);
|
||||
const { t } = useI18n();
|
||||
const emitter = inject<Emitter<Events>>("emitter");
|
||||
</script>
|
||||
<template>
|
||||
<v-btn
|
||||
icon
|
||||
:block="block"
|
||||
variant="flat"
|
||||
color="background"
|
||||
:height="height"
|
||||
:class="{ rounded: rounded }"
|
||||
class="bg-background custom-btn"
|
||||
@click="emitter?.emit('showAboutDialog')"
|
||||
>
|
||||
<div class="icon-container">
|
||||
<v-icon>mdi-help-circle-outline</v-icon>
|
||||
<v-expand-transition>
|
||||
<span v-if="withTag" class="text-caption">{{ t("common.about") }}</span>
|
||||
</v-expand-transition>
|
||||
</div>
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.custom-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.icon-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon-container span {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -5,6 +5,7 @@ import CollectionsBtn from "@/components/common/Navigation/CollectionsBtn.vue";
|
||||
import ScanBtn from "@/components/common/Navigation/ScanBtn.vue";
|
||||
import SearchBtn from "@/components/common/Navigation/SearchBtn.vue";
|
||||
import UploadBtn from "@/components/common/Navigation/UploadBtn.vue";
|
||||
import AboutBtn from "@/components/common/Navigation/AboutBtn.vue";
|
||||
import UserBtn from "@/components/common/Navigation/UserBtn.vue";
|
||||
import PlatformsDrawer from "@/components/common/Navigation/PlatformsDrawer.vue";
|
||||
import CollectionsDrawer from "@/components/common/Navigation/CollectionsDrawer.vue";
|
||||
@@ -46,7 +47,8 @@ function collapse() {
|
||||
</template>
|
||||
|
||||
<template #append>
|
||||
<upload-btn class="mr-2" />
|
||||
<upload-btn class="mr-1" />
|
||||
<about-btn class="mr-4" />
|
||||
<user-btn class="mr-1" />
|
||||
</template>
|
||||
</v-app-bar>
|
||||
@@ -135,6 +137,13 @@ function collapse() {
|
||||
/>
|
||||
|
||||
<template #append>
|
||||
<about-btn
|
||||
:withTag="!mainBarCollapsed"
|
||||
rounded
|
||||
class="mb-6"
|
||||
block
|
||||
tabindex="7"
|
||||
/>
|
||||
<v-row no-gutters class="my-2 justify-center">
|
||||
<user-btn tabindex="8" aria-label="Settings menu" />
|
||||
</v-row>
|
||||
|
||||
@@ -156,17 +156,6 @@ function onClose() {
|
||||
role="listitem"
|
||||
>{{ t("common.server-stats") }}
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="auth.user?.role === 'admin'"
|
||||
:tabindex="tabIndex"
|
||||
class="mt-1"
|
||||
rounded
|
||||
@click="emitter?.emit('showAboutDialog')"
|
||||
append-icon="mdi-help-circle-outline"
|
||||
aria-label="About"
|
||||
role="listitem"
|
||||
>{{ t("common.about") }}
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
<template v-if="scopes.includes('me.write')" #append>
|
||||
<v-btn
|
||||
|
||||
Reference in New Issue
Block a user