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

179 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 00:27:09 +02:00
<div class="spacer" />
<button
class="button-unstyled"
@click="toggleCollapse"
>
<FAIcon
class="timelines-chevron"
fixed-width
:icon="collapsed ? 'chevron-down' : 'chevron-up'"
/>
</button>
</div>
2022-08-12 00:27:09 +02: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 15:24:04 +01: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 01:36:41 +02:00
:title="$t('lists.manage_lists')"
class="extra-button"
:to="{ name: 'lists' }"
@click.stop
2022-08-06 16:26:43 +02:00
>
2022-08-12 00:27:09 +02:00
<FAIcon
class="extra-button"
2022-08-12 00:27:09 +02:00
fixed-width
icon="wrench"
2022-08-06 16:26:43 +02: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 00:27:09 +02:00
<NavigationEntry
v-for="item in rootItems"
:key="item.name"
2022-08-15 20:56:07 +02:00
:show-pin="editMode || forceEditMode"
2022-08-12 00:27:09 +02: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 11:35:48 +02:00
<script src="./nav_panel.js"></script>
2016-11-06 20:10:20 +01:00
<style lang="scss">
@import '../../_variables.scss';
.NavPanel {
.panel {
overflow: hidden;
box-shadow: var(--panelShadow);
}
ul {
list-style: none;
margin: 0;
padding: 0;
2018-04-07 18:30:27 +02:00
}
li {
2020-10-31 12:59:58 +01:00
position: relative;
border-bottom: 1px solid;
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
padding: 0;
2022-06-29 20:40:54 +02:00
}
2016-11-06 20:10:20 +01:00
2022-06-29 20:40:54 +02:00
> li {
2021-02-22 15:24:04 +01: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 15:24:04 +01: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 18:30:27 +02:00
}
li:last-child {
border: none;
}
2021-02-22 15:24:04 +01:00
.timelines-chevron {
margin-left: 0.8em;
margin-right: 0.8em;
2021-02-22 15:24:04 +01:00
font-size: 1.1em;
}
.menu-item {
.timelines-chevron {
margin-right: 0;
}
}
2021-02-22 15:24:04 +01: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 15:24:04 +01: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 {
// breaks without a unit
--panel-heading-height-padding: 0em;
}
}
2016-11-06 20:10:20 +01:00
</style>