-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11613 from bbc/WSTEAM1-1011-UGC-submit-button
WSTEAM1-1011 UGC Form Submit Button
- Loading branch information
Showing
12 changed files
with
98 additions
and
13 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
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
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
50 changes: 47 additions & 3 deletions
50
ws-nextjs-app/pages/[service]/send/[id]/SubmitButton/__snapshots__/index.test.tsx.snap
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,8 +1,52 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`SubmitButton should render a submit button with an associated label 1`] = ` | ||
<input | ||
.emotion-0 { | ||
background-color: #0071F1; | ||
color: #FFFFFF; | ||
width: 100%; | ||
font-family: ReithSans,Helvetica,Arial,sans-serif; | ||
font-style: normal; | ||
font-weight: 700; | ||
font-size: 0.9375rem; | ||
line-height: 1.25rem; | ||
border: none; | ||
padding: 0.75rem 0; | ||
margin-bottom: 1rem; | ||
cursor: pointer; | ||
} | ||
@media (min-width: 20rem) and (max-width: 37.4375rem) { | ||
.emotion-0 { | ||
font-size: 1rem; | ||
line-height: 1.375rem; | ||
} | ||
} | ||
@media (min-width: 37.5rem) { | ||
.emotion-0 { | ||
margin-top: 0.5rem; | ||
margin-bottom: 1.5rem; | ||
} | ||
} | ||
.emotion-0:hover, | ||
.emotion-0:focus { | ||
-webkit-text-decoration: underline; | ||
text-decoration: underline; | ||
background-color: #0051AD; | ||
} | ||
@media (min-width: 15rem) { | ||
.emotion-0 { | ||
margin-bottom: 1.5rem; | ||
} | ||
} | ||
<button | ||
class="emotion-0" | ||
type="submit" | ||
value="Submit" | ||
/> | ||
> | ||
Submit | ||
</button> | ||
`; |
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
10 changes: 8 additions & 2 deletions
10
ws-nextjs-app/pages/[service]/send/[id]/SubmitButton/index.tsx
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,8 +1,14 @@ | ||
import React from 'react'; | ||
/** @jsx jsx */ | ||
import { jsx } from '@emotion/react'; | ||
import styles from './styles'; | ||
|
||
const Submit = () => { | ||
const translation = 'Submit'; | ||
return <input type="submit" value={translation} />; | ||
return ( | ||
<button css={styles.submit} type="submit"> | ||
{translation} | ||
</button> | ||
); | ||
}; | ||
|
||
export default Submit; |
27 changes: 27 additions & 0 deletions
27
ws-nextjs-app/pages/[service]/send/[id]/SubmitButton/styles.ts
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,27 @@ | ||
import { Theme, css } from '@emotion/react'; | ||
|
||
export default { | ||
submit: ({ palette, fontSizes, fontVariants, spacings, mq }: Theme) => | ||
css({ | ||
backgroundColor: palette.SERVICE_NEUTRAL_CORE, | ||
color: palette.WHITE, | ||
width: '100%', | ||
...fontVariants.sansBold, | ||
...fontSizes.bodyCopy, | ||
border: 'none', | ||
padding: `${spacings.FULL + spacings.HALF}rem 0`, | ||
marginBottom: `${spacings.DOUBLE}rem`, | ||
cursor: 'pointer', | ||
'&:hover,&:focus': { | ||
textDecoration: 'underline', | ||
backgroundColor: palette.SERVICE_NEUTRAL_DARK, | ||
}, | ||
[mq.GROUP_1_MIN_WIDTH]: { | ||
marginBottom: `${spacings.TRIPLE}rem`, | ||
}, | ||
[mq.GROUP_3_MIN_WIDTH]: { | ||
marginTop: `${spacings.FULL}rem`, | ||
marginBottom: `${spacings.TRIPLE}rem`, | ||
}, | ||
}), | ||
}; |
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