Skip to content

Commit

Permalink
Merge pull request #338 from nextcloud/enhancement/app-sidebar-component
Browse files Browse the repository at this point in the history
Add a component for #app-sidebar
  • Loading branch information
ChristophWurst authored Apr 8, 2019
2 parents 4acef54 + 398dada commit cc5fc6a
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 4 deletions.
31 changes: 31 additions & 0 deletions src/components/AppSidebar/AppSidebar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
- @copyright Copyright (c) 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
-
- @author Christoph Wurst <christoph@winzerhof-wurst.at>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->

<template>
<div id="app-sidebar">
<slot />
</div>
</template>

<script>
export default {}
</script>
24 changes: 24 additions & 0 deletions src/components/AppSidebar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import AppSidebar from './AppSidebar'

export default AppSidebar
export { AppSidebar }
5 changes: 1 addition & 4 deletions src/components/Content/Content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
<slot name="navigation" />
<slot name="content" />
<slot />
<div v-if="$slots['sidebar'] !== undefined"
id="app-sidebar">
<slot name="sidebar" />
</div>
<slot name="sidebar" />
</div>
</template>

Expand Down
2 changes: 2 additions & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import AppNavigationItem from './AppNavigationItem'
import AppNavigationNew from './AppNavigationNew'
import AppNavigationSettings from './AppNavigationSettings'
import AppNavigationSpacer from './AppNavigationSpacer'
import AppSidebar from './AppSidebar'
import Avatar from './Avatar'
import Content from './Content'
import DatetimePicker from './DatetimePicker'
Expand All @@ -42,6 +43,7 @@ export {
AppNavigationNew,
AppNavigationSettings,
AppNavigationSpacer,
AppSidebar,
Avatar,
Content,
DatetimePicker,
Expand Down

0 comments on commit cc5fc6a

Please sign in to comment.