-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Robert Wagner <rwwagner90@gmail.com>
- Loading branch information
1 parent
33d45c9
commit 57312b2
Showing
20 changed files
with
411 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,47 @@ | ||
{{#if @href}} | ||
|
||
<a href={{@href}} | ||
class=" | ||
docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs docs-font-bold | ||
docs-text-grey-darkest docs-no-underline hover:docs-text-brand | ||
{{if this.push "docs-ml-auto"}} | ||
" | ||
data-test-id={{this.data-test-id}}> | ||
<a | ||
href={{@href}} | ||
class="docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs docs-font-bold docs-text-grey-darkest docs-no-underline hover:docs-text-brand | ||
{{if @push 'docs-ml-auto'}} | ||
" | ||
...attributes | ||
> | ||
{{yield}} | ||
</a> | ||
|
||
{{else if @on-click}} | ||
{{else if @onClick}} | ||
|
||
<a {{action @on-click}} | ||
<a | ||
{{on "click" @onClick}} | ||
href="#" | ||
class=" | ||
docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs docs-font-bold | ||
docs-text-grey-darkest docs-no-underline hover:docs-text-brand | ||
{{if this.push "docs-ml-auto"}} | ||
" | ||
data-test-id={{this.data-test-id}}> | ||
class="docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs docs-font-bold docs-text-grey-darkest docs-no-underline hover:docs-text-brand | ||
{{if @push 'docs-ml-auto'}}" | ||
...attributes | ||
> | ||
{{yield}} | ||
</a> | ||
|
||
{{else}} | ||
|
||
<LinkTo @route={{@route}} class={{concat "docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs | ||
docs-font-bold docs-no-underline " (if (not (eq @route "index")) (if this.isActive "docs-text-brand" "docs-text-grey-darkest hover:docs-text-brand") "docs-text-grey-darkest")}} data-test-id={{this.data-test-id}}> | ||
<LinkTo | ||
@route={{@route}} | ||
class={{concat | ||
"docs-px-4 docs-py-5 docs-transition docs-uppercase docs-text-xxs | ||
docs-font-bold docs-no-underline " | ||
(if | ||
(not (eq @route "index")) | ||
(if | ||
this.isActive | ||
"docs-text-brand" | ||
"docs-text-grey-darkest hover:docs-text-brand" | ||
) | ||
"docs-text-grey-darkest" | ||
) | ||
}} | ||
...attributes | ||
> | ||
{{yield}} | ||
</LinkTo> | ||
|
||
{{/if}} | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
import Component from '@ember/component'; | ||
import Component from '@glimmer/component'; | ||
import { inject as service } from '@ember/service'; | ||
import { computed } from '@ember/object'; | ||
|
||
export default Component.extend({ | ||
tagName: '', | ||
export default class DocsHeaderLink extends Component { | ||
@service router; | ||
|
||
router: service(), | ||
|
||
isActive: computed('router.currentRouteName', 'route', function () { | ||
// Naive isActive check. Replace with router service when updated. | ||
return this.get('router.currentRouteName').indexOf(this.route) === 0; | ||
}), | ||
}).reopenClass({ | ||
positionalParams: ['route'], | ||
}); | ||
get isActive() { | ||
return this.router.isActive(this.args.route); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.