Skip to content

Commit

Permalink
dynamically render footer depending on route
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoykumardas12 committed Nov 1, 2023
1 parent 9dddd20 commit 26e6d59
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
34 changes: 18 additions & 16 deletions app/components/footer.hbs
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{{#if this.isDevMode}}
<footer aria-label='footer under dev feature flag' class='footer--dev'>
<Events />
<h3 data-test-footer-info class='footer__info'>
To know how this page is developed, join our Discord channel by contacting
one of
<a
data-test-footer-info-members-link
href={{this.MEMBERS_URL}}
class='footer__info__link'
>our existing members</a>
or our
<a
data-test-footer-info-faq-link
href={{this.FAQ_URL}}
class='footer__info__link'
> FAQ section</a>.
</h3>
{{#if this.isHome}}
<Events />
<h3 data-test-footer-info class='footer__info'>
To know how this page is developed, join our Discord channel by
contacting one of
<a
data-test-footer-info-members-link
href={{this.MEMBERS_URL}}
class='footer__info__link'
>our existing members</a>
or our
<a
data-test-footer-info-faq-link
href={{this.FAQ_URL}}
class='footer__info__link'
> FAQ section</a>.
</h3>
{{/if}}
<p data-test-footer-repo-text-dev class='footer__repo--dev'>The contents of
the website are deployed from this
<a
Expand Down
5 changes: 5 additions & 0 deletions app/components/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@ import { ABOUT, APPS } from '../constants/urls';
import { APPS_PROPERTIES, ABOUT_PROPERTIES } from '../constants/footer-data';
import { SOCIAL_LINK_PROPERTIES } from '../constants/social-data';
import { inject as service } from '@ember/service';
import { tracked } from '@glimmer/tracking';

export default class FooterComponent extends Component {
@service featureFlag;
@service router;

REPOSITORY_URL = ABOUT.REPOSITORY;
APPS_PROPERTIES = APPS_PROPERTIES;
ABOUT_PROPERTIES = ABOUT_PROPERTIES;
SOCIAL_LINK_PROPERTIES = SOCIAL_LINK_PROPERTIES;
MEMBERS_URL = APPS.MEMBERS;
FAQ_URL = ABOUT.FAQ;

@tracked isHome = this.router.currentRoute.name === 'index';

get isDevMode() {
return this.featureFlag.isDevMode;
}
Expand Down

0 comments on commit 26e6d59

Please sign in to comment.