-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow making default navigation accent color configurable
REDMINE-20704
- Loading branch information
Showing
5 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
entry_types/scrolled/config/locales/new/nav-palette-color.de.yml
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
de: | ||
pageflow: | ||
editor: | ||
widgets: | ||
attributes: | ||
defaultNavigation: | ||
accentColor: | ||
label: "Akzentfarbe" |
8 changes: 8 additions & 0 deletions
8
entry_types/scrolled/config/locales/new/nav-palette-color.en.yml
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
en: | ||
pageflow: | ||
editor: | ||
widgets: | ||
attributes: | ||
defaultNavigation: | ||
accentColor: | ||
label: "Accent color" |
26 changes: 26 additions & 0 deletions
26
entry_types/scrolled/package/spec/widgets/defaultNavigation/Defaultnavigation-spec.js
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
|
||
import {DefaultNavigation} from 'widgets/defaultNavigation/DefaultNavigation'; | ||
|
||
import {renderInEntry} from 'pageflow-scrolled/testHelpers'; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
describe('DefaultNavigation', () => { | ||
it('does not have style attribute on header by default', async () => { | ||
const {container} = renderInEntry( | ||
<DefaultNavigation configuration={{}} /> | ||
); | ||
|
||
expect(container.querySelector('header')).not.toHaveAttribute('style'); | ||
}); | ||
|
||
it('supports overriding accent color', async () => { | ||
const {container} = renderInEntry( | ||
<DefaultNavigation configuration={{accentColor: 'brand-blue'}} /> | ||
); | ||
|
||
expect(container.querySelector('header')).toHaveStyle( | ||
{'--theme-accent-color': 'var(--theme-palette-color-brand-blue)' | ||
}); | ||
}); | ||
}); |
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