pleroma-fe/src/components/nav_panel/nav_panel.vue

177 lines
4.5 KiB
Vue
Raw Normal View History

2016-11-06 20:10:20 +01:00
<template>
<div class="NavPanel">
<div class="panel panel-default">
<div
v-if="!forceExpand"
class="panel-heading nav-panel-heading"
>
<NavigationPins :limit="6" />
2022-08-12 01:27:09 +03:00
<div class="spacer" />
<button
class="button-unstyled"
@click="toggleCollapse"
>
<FAIcon
2022-10-09 19:04:45 +03:00
class="navigation-chevron"
fixed-width
:icon="collapsed ? 'chevron-down' : 'chevron-up'"
/>
</button>
</div>
2022-08-12 01:27:09 +03:00
<ul
v-if="!collapsed || forceExpand"
class="panel-body"
>
<NavigationEntry
v-if="currentUser || !privateMode"
:show-pin="false"
:item="{ icon: 'stream', label: 'nav.timelines' }"
:aria-expanded="showTimelines ? 'true' : 'false'"
@click="toggleTimelines"
>
<FAIcon
class="timelines-chevron"
fixed-width
:icon="showTimelines ? 'chevron-up' : 'chevron-down'"
/>
</NavigationEntry>
<div
v-show="showTimelines"
class="timelines-background"
>
<div class="timelines">
<NavigationEntry
v-for="item in timelinesItems"
:key="item.name"
:show-pin="editMode || forceEditMode"
:item="item"
2021-02-22 16:24:04 +02:00
/>
</div>
</div>
<NavigationEntry
v-if="currentUser"
:show-pin="false"
:item="{ icon: 'list', label: 'nav.lists' }"
:aria-expanded="showLists ? 'true' : 'false'"
@click="toggleLists"
>
<router-link
2022-08-30 02:36:41 +03:00
:title="$t('lists.manage_lists')"
class="extra-button"
:to="{ name: 'lists' }"
@click.stop
2022-08-06 17:26:43 +03:00
>
2022-08-12 01:27:09 +03:00
<FAIcon
class="extra-button"
2022-08-12 01:27:09 +03:00
fixed-width
icon="wrench"
2022-08-06 17:26:43 +03:00
/>
</router-link>
<FAIcon
class="timelines-chevron"
fixed-width
:icon="showLists ? 'chevron-up' : 'chevron-down'"
/>
</NavigationEntry>
<div
v-show="showLists"
class="timelines-background"
>
<ListsMenuContent
:show-pin="editMode || forceEditMode"
class="timelines"
/>
</div>
2022-08-12 01:27:09 +03:00
<NavigationEntry
v-for="item in rootItems"
:key="item.name"
2022-08-15 21:56:07 +03:00
:show-pin="editMode || forceEditMode"
2022-08-12 01:27:09 +03:00
:item="item"
/>
<NavigationEntry
v-if="!forceEditMode && currentUser"
:show-pin="false"
:item="{ label: editMode ? $t('nav.edit_finish') : $t('nav.edit_pinned'), icon: editMode ? 'check' : 'wrench' }"
@click="toggleEditMode"
/>
2016-11-06 20:10:20 +01:00
</ul>
</div>
</div>
</template>
2022-07-31 12:35:48 +03:00
<script src="./nav_panel.js"></script>
2016-11-06 20:10:20 +01:00
<style lang="scss">
2023-01-09 13:02:16 -05:00
@import "../../variables";
.NavPanel {
.panel {
overflow: hidden;
box-shadow: var(--panelShadow);
}
ul {
list-style: none;
margin: 0;
padding: 0;
2018-04-07 19:30:27 +03:00
}
li {
2020-10-31 13:59:58 +02:00
position: relative;
border-bottom: 1px solid;
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
2022-06-29 21:40:54 +03:00
}
2016-11-06 20:10:20 +01:00
2022-06-29 21:40:54 +03:00
> li {
2021-02-22 16:24:04 +02:00
&:first-child .menu-item {
border-top-right-radius: $fallback--panelRadius;
border-top-right-radius: var(--panelRadius, $fallback--panelRadius);
border-top-left-radius: $fallback--panelRadius;
border-top-left-radius: var(--panelRadius, $fallback--panelRadius);
}
2021-02-22 16:24:04 +02:00
&:last-child .menu-item {
border-bottom-right-radius: $fallback--panelRadius;
border-bottom-right-radius: var(--panelRadius, $fallback--panelRadius);
border-bottom-left-radius: $fallback--panelRadius;
border-bottom-left-radius: var(--panelRadius, $fallback--panelRadius);
}
2018-04-07 19:30:27 +03:00
}
li:last-child {
border: none;
}
2022-10-09 19:04:45 +03:00
.navigation-chevron {
2021-02-22 16:24:04 +02:00
margin-left: 0.8em;
margin-right: 0.8em;
2021-02-22 16:24:04 +02:00
font-size: 1.1em;
}
2022-10-09 19:04:45 +03:00
.timelines-chevron {
margin-left: 0.8em;
font-size: 1.1em;
}
2021-02-22 16:24:04 +02:00
.timelines-background {
padding: 0 0 0 0.6em;
background-color: $fallback--lightBg;
background-color: var(--selectedMenu, $fallback--lightBg);
border-bottom: 1px solid;
2021-02-22 16:24:04 +02:00
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
}
.timelines {
background-color: $fallback--bg;
background-color: var(--bg, $fallback--bg);
}
.nav-panel-heading {
2023-01-09 13:02:16 -05:00
// breaks without a unit
// stylelint-disable-next-line length-zero-no-unit
--panel-heading-height-padding: 0px;
}
}
2016-11-06 20:10:20 +01:00
</style>