Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: top and bottom slots for sidebar and page #90

Merged
merged 4 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/client/theme-default/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,29 @@
<ToggleSideBarButton @toggle="toggleSidebar" />
</header>
<aside :class="{ open }">
<SideBar/>
<SideBar>
<template #top>
<slot name="sidebar-top" />
</template>
<template #bottom>
<slot name="sidebar-bottom" />
</template>
</SideBar>
</aside>
<div
class="sidebar-mask"
:class="{ 'sidebar-open': open }"
@click="toggleSidebar(false)"
/>
<main>
<Page />
<Page>
<template #top>
<slot name="page-top" />
</template>
<template #bottom>
<slot name="page-bottom" />
</template>
</Page>
</main>
</div>
<Debug />
Expand Down
5 changes: 4 additions & 1 deletion src/client/theme-default/components/Page.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
<template>
<div class="content">
<slot name="top" />
<Content />
<NextAndPrevLinks />
<PageEdit />
<slot name="bottom" />
</div>
</template>

<script>
import NextAndPrevLinks from './NextAndPrevLinks.vue'
import PageEdit from './PageEdit.vue'
export default {
components:{ NextAndPrevLinks, PageEdit }
components: { NextAndPrevLinks, PageEdit }
}
</script>

<style>
.content {
margin: 0 auto;
padding: 0.025rem 2.5rem 2rem;
/* if this is moved to a variable, add it to BuySellAds.vue */
max-width: 50rem;
}

Expand Down
4 changes: 4 additions & 0 deletions src/client/theme-default/components/SideBar.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<template>
<NavBarLinks class="show-mobile" />

<slot name="top" />

<ul class="sidebar">
<SideBarItem v-for="item of items" :item="item" />
</ul>

<slot name="bottom" />
</template>

<script src="./SideBar"></script>
Expand Down