-
Notifications
You must be signed in to change notification settings - Fork 9
ToU: navigation panel component #1140
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <template> | ||
| <v-expansion-panels v-bind:value="$vuetify.breakpoint.mdAndUp ? 0 : null" v-if="links"> | ||
| <v-expansion-panel> | ||
| <v-expansion-panel-header>{{ title }}</v-expansion-panel-header> | ||
|
|
||
| <v-expansion-panel-content> | ||
| <v-list class="wrap"> | ||
| <v-list-item v-for="(link) in links" :key="link.routeName"> | ||
| <v-list-item-content> | ||
| <v-list-item-title v-if="! isCurrentPage(link.routeName)"> | ||
| <router-link :to="{ name: link.routeName }" class="text-decoration-none"> | ||
| <v-list-item-title>{{ link.title }}</v-list-item-title> | ||
| </router-link> | ||
| </v-list-item-title> | ||
|
|
||
| <v-list-item-title v-else>{{ link.title }}</v-list-item-title> | ||
| </v-list-item-content> | ||
| </v-list-item> | ||
| </v-list> | ||
| </v-expansion-panel-content> | ||
| </v-expansion-panel> | ||
| </v-expansion-panels> | ||
| </template> | ||
|
|
||
| <script> | ||
| export default { | ||
| name: 'NavigationPanel', | ||
| props: { | ||
| title: String, | ||
| links: Array, | ||
| }, | ||
| methods: { | ||
| isCurrentPage (routeName) { | ||
| return this.$route.name === routeName | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I'd rather we also pass in the current link as a prop to this component rather than have it magically determined it by the route name. While we just have two hardcoded routes this works but once we are getting the policy list over the wire I don't think we'll be able to rely on the route name. We'll need to look at the params of the route and I think at that point it's probably cleaner for the caller of this component to specify which is the current page. To try and give an example I think we will need to handle:
|
||
| }, | ||
| }, | ||
| } | ||
|
|
||
| </script> | ||
|
|
||
| <style scoped></style> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good idea to leave this there (clearly marked as |
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this was added as an attempt to remove the list from the NavigationPanel but not currently used? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| const termsOfUseLinks = [ | ||
| { title: 'Upcoming Version', route: 'TermsOfUseUpcoming' }, | ||
| { title: 'April 11th 2022 (current)', route: 'TermsOfUse' }, | ||
| ] | ||
|
|
||
| export default termsOfUseLinks |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <template> | ||
| <NavigationPanel title="All Versions" :links="termsOfUseLinks" /> | ||
| </template> | ||
|
|
||
| <script> | ||
| import NavigationPanel from '../Components/NavigationPanel.vue' | ||
|
|
||
| export default { | ||
| name: 'TermsOfUseNavigationPanel', | ||
| components: { | ||
| NavigationPanel, | ||
| }, | ||
| data: () => ({ | ||
| termsOfUseLinks: [ | ||
| { title: 'Upcoming Version', routeName: 'TermsOfUseUpcoming' }, | ||
| { title: 'April 11th 2022 (current)', routeName: 'TermsOfUse' }, | ||
| ], | ||
| }), | ||
| } | ||
|
|
||
| </script> | ||
|
|
||
| <style scoped></style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice clean vuetify2 way to handle the responsiveness. I love it.
I did have to go hunting to confirm
valueis the name for prop that controls if the panel is open or closed but that's not on you; for me that's not a super clear prop name :D