diff --git a/src/components/Atoms/Logo/Logo.js b/src/components/Atoms/Logo/Logo.js index a300020b3..bb7aa3e87 100644 --- a/src/components/Atoms/Logo/Logo.js +++ b/src/components/Atoms/Logo/Logo.js @@ -47,7 +47,7 @@ const themeSwitcher = theme => { const Logo = ({ rotate, sizeSm, sizeMd, campaign }) => ( - + { + ``` # Sport Relief Logo diff --git a/src/components/Atoms/Logo/Logo.test.js b/src/components/Atoms/Logo/Logo.test.js index 3a240b857..a2b47a338 100644 --- a/src/components/Atoms/Logo/Logo.test.js +++ b/src/components/Atoms/Logo/Logo.test.js @@ -1,9 +1,9 @@ -import React from 'react'; -import 'jest-styled-components'; -import renderWithTheme from '../../../hoc/shallowWithTheme'; -import Logo from './Logo'; +import React from "react"; +import "jest-styled-components"; +import renderWithTheme from "../../../hoc/shallowWithTheme"; +import Logo from "./Logo"; -it('renders correctly', () => { +it("renders correctly", () => { const tree = renderWithTheme().toJSON(); expect(tree).toMatchInlineSnapshot(` @@ -32,7 +32,7 @@ it('renders correctly', () => {
Comic Relief logo size}; + margin-right: ${spacing('sm')}; `; const HelperText = styled.span` @@ -24,7 +29,7 @@ const HelperText = styled.span` `; const Icon = ({ - href, target, icon, brand, title, ...restProps + href, target, icon, brand, title, size, hideLabel, ...restProps }) => ( - + {title !== 'Sign up for emails' && ( (opens in new window) )} + {!hideLabel ? ( + + {title} + + ) : null} ); @@ -46,7 +57,14 @@ Icon.propTypes = { href: PropTypes.string.isRequired, target: PropTypes.string.isRequired, icon: PropTypes.string.isRequired, - title: PropTypes.string.isRequired + title: PropTypes.string.isRequired, + hideLabel: PropTypes.bool, + size: PropTypes.string +}; + +Icon.defaultProps = { + hideLabel: true, + size: 'auto' }; export default Icon; diff --git a/src/components/Atoms/SocialIcons/__snapshots__/SocialIcons.test.js.snap b/src/components/Atoms/SocialIcons/__snapshots__/SocialIcons.test.js.snap index 2c3e4d6cb..fd23d3c94 100644 --- a/src/components/Atoms/SocialIcons/__snapshots__/SocialIcons.test.js.snap +++ b/src/components/Atoms/SocialIcons/__snapshots__/SocialIcons.test.js.snap @@ -5,7 +5,14 @@ exports[`renders correctly with Comic Relief links 1`] = ` -webkit-text-decoration: none; text-decoration: none; cursor: pointer; - display: block; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; -webkit-transition: opacity 0.2s; transition: opacity 0.2s; } @@ -17,6 +24,8 @@ exports[`renders correctly with Comic Relief links 1`] = ` .c3 { width: 100%; + width: auto; + margin-right: 0.5rem; } .c4 { @@ -89,6 +98,7 @@ exports[`renders correctly with Comic Relief links 1`] = ` facebook @@ -461,6 +471,7 @@ exports[`renders correctly with error message 1`] = ` Close email sign-up @@ -612,7 +633,14 @@ exports[`renders correctly with modal open 1`] = ` -webkit-text-decoration: none; text-decoration: none; cursor: pointer; - display: block; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; -webkit-transition: opacity 0.2s; transition: opacity 0.2s; } @@ -624,6 +652,8 @@ exports[`renders correctly with modal open 1`] = ` .c2 { width: 100%; + width: auto; + margin-right: 0.5rem; } .c21 { @@ -839,6 +869,7 @@ exports[`renders correctly with modal open 1`] = ` Sign up for emails @@ -944,6 +975,7 @@ exports[`renders correctly with modal open 1`] = ` Close email sign-up @@ -1197,6 +1239,7 @@ exports[`renders correctly with success message 1`] = ` Close email sign-up { return ( <> - + @@ -21,11 +21,10 @@ const Logos = ({ campaign }) => { return ( <> - + { if (campaign === 'Sport Relief') { return ( - + ); } return ( - + ); }; diff --git a/src/components/Molecules/ShareButton/ShareButton.test.js b/src/components/Molecules/ShareButton/ShareButton.test.js index 690a4511b..b1c94d96d 100644 --- a/src/components/Molecules/ShareButton/ShareButton.test.js +++ b/src/components/Molecules/ShareButton/ShareButton.test.js @@ -1,9 +1,9 @@ -import React from 'react'; -import 'jest-styled-components'; -import renderWithTheme from '../../../hoc/shallowWithTheme'; -import ShareButton from './ShareButton'; +import React from "react"; +import "jest-styled-components"; +import renderWithTheme from "../../../hoc/shallowWithTheme"; +import ShareButton from "./ShareButton"; -it('renders correctly', () => { +it("renders correctly", () => { const tree = renderWithTheme().toJSON(); expect(tree).toMatchInlineSnapshot(` @@ -11,7 +11,14 @@ it('renders correctly', () => { -webkit-text-decoration: none; text-decoration: none; cursor: pointer; - display: block; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; -webkit-transition: opacity 0.2s; transition: opacity 0.2s; } @@ -23,6 +30,8 @@ it('renders correctly', () => { .c5 { width: 100%; + width: auto; + margin-right: 0.5rem; } .c6 { @@ -105,6 +114,7 @@ it('renders correctly', () => { comicrelief { comicrelief
Comic Relief logo - - Donate - -
-
+
- setSuccess(!success)} - /> + + Donate + } />; diff --git a/src/components/Organisms/Header/Header.style.js b/src/components/Organisms/Header/Header.style.js index 2cd88254d..7d46088fc 100644 --- a/src/components/Organisms/Header/Header.style.js +++ b/src/components/Organisms/Header/Header.style.js @@ -32,9 +32,9 @@ const InnerWrapper = styled.div` const Brand = styled.div` ${zIndex('high')}; - margin-right: auto; display: flex; align-items: center; + margin-right: auto; a { border: 0; color: transparent; @@ -47,6 +47,9 @@ const Brand = styled.div` border: 0; } } + @media ${({ theme }) => theme.breakpoint('nav')} { + margin-right: 0; + } `; const MetaIcons = styled.div` @@ -54,24 +57,6 @@ const MetaIcons = styled.div` display: flex; align-items: center; - > div { - height: 35px; - width: auto; - display: inline-block; - - > a { - height: inherit; - width: inherit; - margin-left: ${({ theme }) => theme.fontSize('xxs')}; - - img { - padding: 5px; - height: inherit; - width: inherit; - } - } - } - @media ${({ theme }) => theme.breakpoint('nav')} { position: relative; display: flex; diff --git a/src/components/Organisms/Header/Nav/Nav.style.js b/src/components/Organisms/Header/Nav/Nav.style.js index 6497a6873..292da1172 100644 --- a/src/components/Organisms/Header/Nav/Nav.style.js +++ b/src/components/Organisms/Header/Nav/Nav.style.js @@ -46,6 +46,7 @@ const Nav = styled.nav` margin: 0 10px; width: auto; height: 100%; + margin-right: auto; } > h2 { ${hideVisually}; diff --git a/src/components/Organisms/Header/assets/pay-in.svg b/src/components/Organisms/Header/assets/pay-in.svg new file mode 100644 index 000000000..ecc8ba5d8 --- /dev/null +++ b/src/components/Organisms/Header/assets/pay-in.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/Organisms/Header/assets/search.svg b/src/components/Organisms/Header/assets/search.svg new file mode 100644 index 000000000..e4f68e9a5 --- /dev/null +++ b/src/components/Organisms/Header/assets/search.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/Organisms/Header/assets/shop.svg b/src/components/Organisms/Header/assets/shop.svg new file mode 100644 index 000000000..da648432a --- /dev/null +++ b/src/components/Organisms/Header/assets/shop.svg @@ -0,0 +1,3 @@ + + +