last second changes for auth and sidebar
This commit is contained in:
parent
16dfd1d4a1
commit
9351e6b361
@ -13,7 +13,7 @@ import {
|
|||||||
Card,
|
Card,
|
||||||
TextLogo,
|
TextLogo,
|
||||||
PlusIcon,
|
PlusIcon,
|
||||||
HamburgerIcon,
|
Avatar,
|
||||||
} from 'omorphia'
|
} from 'omorphia'
|
||||||
|
|
||||||
import { useLoading, useTheming } from '@/store/state'
|
import { useLoading, useTheming } from '@/store/state'
|
||||||
@ -28,7 +28,13 @@ import SplashScreen from '@/components/ui/SplashScreen.vue'
|
|||||||
import ModrinthLoadingIndicator from '@/components/modrinth-loading-indicator'
|
import ModrinthLoadingIndicator from '@/components/modrinth-loading-indicator'
|
||||||
import { handleError, useNotifications } from '@/store/notifications.js'
|
import { handleError, useNotifications } from '@/store/notifications.js'
|
||||||
import { offline_listener, command_listener, warning_listener } from '@/helpers/events.js'
|
import { offline_listener, command_listener, warning_listener } from '@/helpers/events.js'
|
||||||
import { MinimizeIcon, MaximizeIcon, ChatIcon } from '@/assets/icons'
|
import {
|
||||||
|
MinimizeIcon,
|
||||||
|
MaximizeIcon,
|
||||||
|
ChatIcon,
|
||||||
|
ArrowLeftFromLineIcon,
|
||||||
|
ArrowRightFromLineIcon,
|
||||||
|
} from '@/assets/icons'
|
||||||
import { isDev, getOS, isOffline, showLauncherLogsFolder } from '@/helpers/utils.js'
|
import { isDev, getOS, isOffline, showLauncherLogsFolder } from '@/helpers/utils.js'
|
||||||
import {
|
import {
|
||||||
mixpanel_track,
|
mixpanel_track,
|
||||||
@ -282,8 +288,14 @@ const toggleSidebar = () => {
|
|||||||
>
|
>
|
||||||
<div class="pages-list">
|
<div class="pages-list">
|
||||||
<div class="square-collapsed-space">
|
<div class="square-collapsed-space">
|
||||||
<Button transparent icon-only class="collapsed-button" @click="toggleSidebar">
|
<Button
|
||||||
<HamburgerIcon />
|
transparent
|
||||||
|
icon-only
|
||||||
|
class="collapsed-button non-collapse"
|
||||||
|
@click="toggleSidebar"
|
||||||
|
>
|
||||||
|
<ArrowRightFromLineIcon v-if="!sidebarOpen" />
|
||||||
|
<ArrowLeftFromLineIcon v-else />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -327,10 +339,10 @@ const toggleSidebar = () => {
|
|||||||
:to="`/instance/${encodeURIComponent(instance.path)}`"
|
:to="`/instance/${encodeURIComponent(instance.path)}`"
|
||||||
class="btn icon-only collapsed-button"
|
class="btn icon-only collapsed-button"
|
||||||
>
|
>
|
||||||
<img
|
<Avatar
|
||||||
class="collapsed-button__icon"
|
class="collapsed-button__icon"
|
||||||
:src="iconPathAsUrl(instance.metadata?.icon)"
|
:src="iconPathAsUrl(instance.metadata?.icon)"
|
||||||
:alt="instance.metadata.name"
|
size="xs"
|
||||||
/>
|
/>
|
||||||
<span class="collapsed-button__label">{{ instance.metadata.name }}</span>
|
<span class="collapsed-button__label">{{ instance.metadata.name }}</span>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
@ -358,7 +370,7 @@ const toggleSidebar = () => {
|
|||||||
@click="() => $refs.installationModal.show()"
|
@click="() => $refs.installationModal.show()"
|
||||||
>
|
>
|
||||||
<PlusIcon />
|
<PlusIcon />
|
||||||
<span class="collapsed-button__label">Create Profile</span>
|
<span class="collapsed-button__label">Create profile</span>
|
||||||
</Button>
|
</Button>
|
||||||
<AccountDropdown />
|
<AccountDropdown />
|
||||||
</div>
|
</div>
|
||||||
@ -688,37 +700,44 @@ const toggleSidebar = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.collapsed-button {
|
:deep {
|
||||||
justify-content: flex-start;
|
.non-collapse {
|
||||||
|
width: var(--sidebar-button-size) !important;
|
||||||
|
}
|
||||||
|
|
||||||
// width: var(--sidebar-icon-size);
|
.collapsed-button {
|
||||||
height: var(--sidebar-button-size);
|
justify-content: flex-start;
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
flex-shrink: 0;
|
// width: var(--sidebar-icon-size);
|
||||||
|
height: var(--sidebar-button-size);
|
||||||
padding: var(--sidebar-padding) !important;
|
width: 100%;
|
||||||
border-radius: 99999px;
|
|
||||||
box-shadow: none;
|
|
||||||
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
transition: all ease-in-out 0.1s;
|
|
||||||
|
|
||||||
.collapsed-button__icon,
|
|
||||||
svg {
|
|
||||||
width: var(--sidebar-icon-size);
|
|
||||||
height: var(--sidebar-icon-size);
|
|
||||||
|
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|
||||||
border-radius: var(--radius-xs);
|
padding: var(--sidebar-padding) !important;
|
||||||
}
|
border-radius: 99999px;
|
||||||
|
box-shadow: none;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.collapsed-button__label {
|
|
||||||
opacity: var(--sidebar-label-opacity);
|
|
||||||
transition: all ease-in-out 0.1s;
|
transition: all ease-in-out 0.1s;
|
||||||
|
|
||||||
|
.collapsed-button__icon,
|
||||||
|
svg {
|
||||||
|
width: var(--sidebar-icon-size) !important;
|
||||||
|
height: var(--sidebar-icon-size) !important;
|
||||||
|
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
border-radius: var(--radius-xs);
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsed-button__label {
|
||||||
|
word-spacing: normal; // Why is this even needed?
|
||||||
|
opacity: var(--sidebar-label-opacity);
|
||||||
|
transition: all ease-in-out 0.1s;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
theseus_gui/src/assets/icons/arrow-left-from-line.svg
Normal file
1
theseus_gui/src/assets/icons/arrow-left-from-line.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-left-from-line"><path d="m9 6-6 6 6 6"/><path d="M3 12h14"/><path d="M21 19V5"/></svg>
|
||||||
|
After Width: | Height: | Size: 294 B |
1
theseus_gui/src/assets/icons/arrow-right-from-line.svg
Normal file
1
theseus_gui/src/assets/icons/arrow-right-from-line.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-right-from-line"><path d="M3 5v14"/><path d="M21 12H7"/><path d="m15 18 6-6-6-6"/></svg>
|
||||||
|
After Width: | Height: | Size: 296 B |
@ -12,3 +12,5 @@ export { default as NewInstanceImage } from './new-instance.svg'
|
|||||||
export { default as MenuIcon } from './menu.svg'
|
export { default as MenuIcon } from './menu.svg'
|
||||||
export { default as BugIcon } from './bug.svg'
|
export { default as BugIcon } from './bug.svg'
|
||||||
export { default as ChatIcon } from './messages-square.svg'
|
export { default as ChatIcon } from './messages-square.svg'
|
||||||
|
export { default as ArrowLeftFromLineIcon } from './arrow-left-from-line.svg'
|
||||||
|
export { default as ArrowRightFromLineIcon } from './arrow-right-from-line.svg'
|
||||||
|
|||||||
@ -7,49 +7,40 @@
|
|||||||
>
|
>
|
||||||
<ModrinthLoginScreen :modal="true" :prev-page="signInAfter" :next-page="signInAfter" />
|
<ModrinthLoginScreen :modal="true" :prev-page="signInAfter" :next-page="signInAfter" />
|
||||||
</Modal>
|
</Modal>
|
||||||
<OverflowMenu
|
<PopoutMenu class="btn btn-transparent collapsed-button" direction="up" position="right">
|
||||||
v-if="auth?.user"
|
<Avatar class="collapsed-button__icon" circle size="sm" :src="auth?.user?.avatar_url" />
|
||||||
class="btn btn-transparent headless-button"
|
<span class="collapsed-button__label">
|
||||||
:options="[
|
<template v-if="auth?.user">
|
||||||
{
|
{{ auth.user.username }}
|
||||||
id: 'sign-out',
|
</template>
|
||||||
color: 'danger',
|
<template v-else> Sign in </template>
|
||||||
action: async () => {
|
</span>
|
||||||
await mrAuth.logout()
|
<template #menu>
|
||||||
},
|
<div class="selection-menu">
|
||||||
hoverFilledOnly: true,
|
<template v-if="auth?.user">
|
||||||
},
|
<Button color="danger" transparent hover-filled-only @click="() => mrAuth.logout()">
|
||||||
]"
|
<LogOutIcon /> Sign out
|
||||||
direction="up"
|
</Button>
|
||||||
position="right"
|
</template>
|
||||||
>
|
<template v-else>
|
||||||
<Avatar circle size="sm" :src="auth?.user?.avatar_url" />
|
<Button
|
||||||
<template #sign-out> <LogOutIcon /> Sign out </template>
|
color="primary"
|
||||||
</OverflowMenu>
|
transparent
|
||||||
<OverflowMenu
|
hover-filled-only
|
||||||
v-else
|
@click="() => $refs.modrinthLoginModal.show()"
|
||||||
class="btn btn-transparent headless-button"
|
>
|
||||||
:options="[
|
<LogInIcon /> Sign in
|
||||||
{
|
</Button>
|
||||||
id: 'sign-in',
|
</template>
|
||||||
color: 'primary',
|
</div>
|
||||||
action: () => {
|
</template>
|
||||||
modrinthLoginModal?.show()
|
</PopoutMenu>
|
||||||
},
|
|
||||||
},
|
|
||||||
]"
|
|
||||||
direction="up"
|
|
||||||
position="right"
|
|
||||||
>
|
|
||||||
<Avatar circle size="sm" />
|
|
||||||
<template #sign-in> <LogInIcon /> Sign in </template>
|
|
||||||
</OverflowMenu>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { Avatar, OverflowMenu, LogOutIcon, LogInIcon, Modal } from 'omorphia'
|
import { Avatar, Button, PopoutMenu, LogOutIcon, LogInIcon, Modal } from 'omorphia'
|
||||||
|
|
||||||
import { useTheming } from '@/store/state'
|
import { useTheming } from '@/store/state'
|
||||||
import { useModrinthAuth } from '@/store/mr_auth.js'
|
import { useModrinthAuth } from '@/store/mr_auth.js'
|
||||||
@ -70,12 +61,26 @@ const signInAfter = async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
:deep {
|
.account-dropdown {
|
||||||
.headless-button {
|
width: 100%;
|
||||||
padding: 0 !important;
|
}
|
||||||
border-radius: 99999px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
.selection-menu {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 0.35rem;
|
||||||
|
|
||||||
|
width: max-content;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: 100%;
|
||||||
|
justify-content: start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep {
|
||||||
.login-screen-modal {
|
.login-screen-modal {
|
||||||
.modal-container .modal-body {
|
.modal-container .modal-body {
|
||||||
width: auto;
|
width: auto;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user