-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix: simply nav bar on public page #5454
fix: simply nav bar on public page #5454
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/605godrex |
Codecov Report
@@ Coverage Diff @@
## development #5454 +/- ##
===============================================
+ Coverage 23.23% 23.24% +0.01%
===============================================
Files 493 493
Lines 5169 5170 +1
Branches 38 38
===============================================
+ Hits 1201 1202 +1
Misses 3963 3963
Partials 5 5
Continue to review full report at Codecov.
|
app/components/nav-bar.js
Outdated
import Component from '@ember/component'; | ||
|
||
@classic | ||
export default class NavBar extends Component { | ||
@computed('session.currentRouteName') | ||
get currentRoute() { |
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.
This doesn't return the current route, it returns if it is public route. Change to isEventPageRoute
app/templates/components/nav-bar.hbs
Outdated
@@ -10,9 +10,11 @@ | |||
@route="pricing" class="item" | |||
@activeClass="">{{t 'Pricing'}}</LinkTo> | |||
{{/if}} | |||
{{#if currentRoute}} |
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.
this.
is missing
Will throw a warning
app/templates/components/nav-bar.hbs
Outdated
@@ -5,14 +5,16 @@ | |||
<h3>{{this.settings.appName}}</h3> | |||
</LinkTo> | |||
<div class="right menu nav-bar"> | |||
{{#if (not this.session.isAuthenticated)}} | |||
{{#if (and (not this.session.isAuthenticated) this.isEventPageRoute)}} |
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.
This means show Pricing if user is not logged in and the page is event page
app/components/nav-bar.js
Outdated
import Component from '@ember/component'; | ||
|
||
@classic | ||
export default class NavBar extends Component { | ||
@computed('session.currentRouteName') | ||
get isEventPageRoute() { |
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.
This returns true if the page is not event page. It should either be named isNotEventPageRoute
or return opposite of what it does. Please check the function names make sense. Change the name
Fixes #5448
Checklist
development
branch.