Skip to content

Commit

Permalink
feat: categorized sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Jan 6, 2023
1 parent c11a7cc commit 36f11e4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
23 changes: 14 additions & 9 deletions components/nav/NavSide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ const { notifications } = useNotifications()
</script>

<template>
<nav sm:px3 sm:py4 flex="~ col gap2" text-size-base leading-normal md:text-lg>
<SearchWidget lg:ms-1 lg:me-5 mb-5 hidden xl:block />
<NavSideItem :text="$t('nav.search')" to="/search" icon="i-ri:search-line" xl:hidden :command="command" mb-5 />
<nav sm:px3 flex="~ col gap2" shrink text-size-base leading-normal md:text-lg>
<div shrink hidden sm:block mt-4 />
<SearchWidget lg:ms-1 lg:me-5 hidden xl:block />
<NavSideItem :text="$t('nav.search')" to="/search" icon="i-ri:search-line" xl:hidden :command="command" />

<div shrink hidden sm:block mt-4 />
<NavSideItem :text="$t('nav.home')" to="/home" icon="i-ri:home-5-line" user-only :command="command" />
<NavSideItem :text="$t('nav.notifications')" to="/notifications" icon="i-ri:notification-4-line" user-only :command="command">
<template #icon>
Expand All @@ -21,16 +23,19 @@ const { notifications } = useNotifications()
</div>
</template>
</NavSideItem>
<NavSideItem :text="$t('action.compose')" to="/compose" icon="i-ri:quill-pen-line" user-only :command="command" />
<NavSideItem :text="$t('nav.conversations')" to="/conversations" icon="i-ri:at-line" user-only :command="command" />
<NavSideItem :text="$t('nav.favourites')" to="/favourites" icon="i-ri:heart-3-line" user-only :command="command" />
<NavSideItem :text="$t('nav.bookmarks')" to="/bookmarks" icon="i-ri:bookmark-line" user-only :command="command" />

<!-- Use Search for small screens once the right sidebar is collapsed -->
<NavSideItem :text="$t('nav.search')" to="/search" icon="i-ri:search-line" sm:hidden :command="command" />
<div shrink hidden sm:block mt-4 />
<NavSideItem :text="$t('nav.explore')" :to="`/${currentServer}/explore`" icon="i-ri:hashtag" :command="command" />
<NavSideItem :text="$t('nav.local')" :to="`/${currentServer}/public/local`" icon="i-ri:group-2-line " :command="command" />
<NavSideItem :text="$t('nav.federated')" :to="`/${currentServer}/public`" icon="i-ri:earth-line" :command="command" />
<NavSideItem :text="$t('nav.conversations')" to="/conversations" icon="i-ri:at-line" user-only :command="command" />
<NavSideItem :text="$t('nav.favourites')" to="/favourites" icon="i-ri:heart-3-line" user-only :command="command" />
<NavSideItem :text="$t('nav.bookmarks')" to="/bookmarks" icon="i-ri:bookmark-line" user-only :command="command" />

<div shrink hidden sm:block mt-4 />
<NavSideItem :text="$t('action.compose')" to="/compose" icon="i-ri:quill-pen-line" user-only :command="command" />

<div shrink hidden sm:block mt-4 />
<NavSideItem :text="$t('nav.settings')" to="/settings" icon="i-ri:settings-3-line" :command="command" />
</nav>
</template>
2 changes: 1 addition & 1 deletion components/search/SearchWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const activate = () => {

<template>
<div ref="el" relative group>
<div bg-base border="~ base" h10 px-3 rounded-3 flex="~ row" items-center relative focus-within:box-shadow-outline gap-3>
<div bg-base border="~ base" h10 px-4 rounded-3 flex="~ row" items-center relative focus-within:box-shadow-outline gap-3>
<div i-ri:search-2-line pointer-events-none text-secondary mt="1px" class="rtl-flip" />
<input
ref="input"
Expand Down
8 changes: 3 additions & 5 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ const wideLayout = computed(() => route.meta.wideLayout ?? false)
<div sticky top-0 w-20 xl:w-100 h-screen flex="~ col" lt-xl-items-center>
<slot name="left">
<div flex="~ col" overflow-y-auto justify-between h-full max-w-full mt-5>
<div flex flex-col gap-2>
<NavTitle />
<NavSide command />
<!-- <PublishButton ms5.5 mt4 xl:me8 xl:ms4 /> -->
</div>
<NavTitle />
<NavSide command />
<div flex-auto />
<div v-if="isMastoInitialised" flex flex-col>
<div hidden xl:block>
<UserSignInEntry v-if="!currentUser" />
Expand Down

0 comments on commit 36f11e4

Please sign in to comment.