-
Notifications
You must be signed in to change notification settings - Fork 54
Update psammead-navigation to require colours as props #4187
Conversation
packages/components/psammead-navigation/src/ScrollableNavigation/index.jsx
Outdated
Show resolved
Hide resolved
packages/components/psammead-navigation/src/ScrollableNavigation/index.jsx
Outdated
Show resolved
Hide resolved
|
||
import notes from '../README.md'; | ||
|
||
const defaultBrandBackgroundColour = '#B80000'; |
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.
Should this use a constant here?
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 used for the background colour of the brand component when shown in storybook, not by the navigation component, so I didn't feel it was relevant to the change I was making.
@@ -21,6 +21,9 @@ const navigationUlComponent = ( | |||
currentPageText="Current page" | |||
service="news" | |||
data-navigation="test_navigation" | |||
brandForegroundColour="#FDFDFD" |
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.
Throughout these tests I'd imagine the colours should refer to constants rather than being hardcoded?
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.
What benefit would that give?
packages/components/psammead-navigation/src/ScrollableNavigation/index.jsx
Show resolved
Hide resolved
Co-authored-by: Andrew Bennett <[email protected]>
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.
Thanks for the changes
LGTM.. |
Resolves #3123
Overall change:
Upgrades psammead-navigation so that it will work for non-Red brands
Code changes:
brandBackgroundColour
prop to set the background of the navigationbrandBackgroundColour
for the fade in ScrollableNavigation, including adding a new function to generate the value for the transparencybrandBorderColour
for the separator line where the nav wraps onto a second rowbrandHighlightColour
for the current page indicator, and the hover/active state bordersbrandForegroundColour
for the text in the navTesting notes
In Storybook, this can be tested by viewing the Navigation stories and changing the service drop-down to Sport, which has different values to News for all colours
Screenshots
Screenshots from Storybook with
news
andsport
selected