From 19e03e94e05a16a108dc83dcfd8759daeea5a911 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Sun, 27 Feb 2022 15:57:30 +0100 Subject: [PATCH] style page 2 --- .../UserFeedback/UserFeedback.stories.jsx | 18 ++- website/src/components/UserFeedback/index.jsx | 127 ++++++++++++++++-- .../components/UserFeedback/styles.module.css | 25 ++-- 3 files changed, 145 insertions(+), 25 deletions(-) diff --git a/website/src/components/UserFeedback/UserFeedback.stories.jsx b/website/src/components/UserFeedback/UserFeedback.stories.jsx index c1aab5462f..d9be103141 100644 --- a/website/src/components/UserFeedback/UserFeedback.stories.jsx +++ b/website/src/components/UserFeedback/UserFeedback.stories.jsx @@ -13,13 +13,17 @@ FullComponent.args = { // initialData, }; -// export const Step2 = Template.bind({}); -// Step2.args = { -// seedData: { -// ...initialData, -// currentStep: 2, -// }, -// }; +export const Step2 = Template.bind({}); +Step2.args = { + seedData: { + currentStep: 2, + }, +}; export const Step3 = Template.bind({}); +Step3.args = { + seedData: { + currentStep: 3, + }, +}; export const Closed = Template.bind({}); diff --git a/website/src/components/UserFeedback/index.jsx b/website/src/components/UserFeedback/index.jsx index f90c04539e..3517e020a7 100644 --- a/website/src/components/UserFeedback/index.jsx +++ b/website/src/components/UserFeedback/index.jsx @@ -88,10 +88,14 @@ export const FeedbackWrapper = ({ seedData }) => { const setCustomerType = (customerType) => dispatch({ kind: 'set customer type', data: customerType }); + const submitFeedback = () => { + console.log('send feedback here '); + }; + const Step1 = () => { const [newValue, setNewValue] = React.useState(undefined); return ( -
+

On a scale from 1 to 5 where 1 is very unsatisfied and 5 @@ -135,16 +139,10 @@ export const FeedbackWrapper = ({ seedData }) => {

- + + +
+
+ ); + }; + + const Step3 = () => { + const [customerType, setCustomerType] = React.useState(); + + return ( +
+ + Finally, would you mind telling us a little about yourself? + What kind of customer are you? + +
+ {[ + ['an', 'open source', 'opensource'], + ['a', 'paying', 'paying'], + ].map(([article, customerType, key]) => ( + + { + const value = e.target.value; + console.log('the value is', value); + setCustomerType(value); + }} + /> + + + ))} +
+ +
+ + +
+
+ ); + }; return (
diff --git a/website/src/components/UserFeedback/styles.module.css b/website/src/components/UserFeedback/styles.module.css index fea0099b37..bbdbe82c72 100644 --- a/website/src/components/UserFeedback/styles.module.css +++ b/website/src/components/UserFeedback/styles.module.css @@ -29,8 +29,12 @@ margin-right: auto; } +.user-feedback > form > * + * { + margin-top: var(--row-gap); +} + .user-feedback * { - outline-offset: 4px; + outline-offset: 4px; } .user-feedback *:focus-visible { @@ -44,7 +48,6 @@ gap: var(--element-horizontal-gap); } - .user-satisfaction-score-label { display: grid; place-content: center; @@ -59,7 +62,7 @@ } .user-satisfaction-score-label:hover { - color: var(--ifm-color-primary) + color: var(--ifm-color-primary); } .user-satisfaction-score-input:checked + label { @@ -85,11 +88,11 @@ button.close-button { height: 1em; } -.close-button:hover{ +.close-button:hover { color: var(--ifm-color-primary); } -.close-button:active{ +.close-button:active { color: var(--ifm-color-primary-darker); } @@ -98,17 +101,17 @@ button.close-button { justify-content: end; } -.user-feedback button[type=submit] { +.user-feedback button[type='submit'] { background-color: var(--ifm-color-primary); color: var(--ifm-background-color); padding-inline: calc(var(--ifm-spacing-horizontal) * 4); } -.user-feedback button[type=submit]:hover { +.user-feedback button[type='submit']:hover { background-color: var(--ifm-color-primary-lighter); } -.user-feedback button[type=submit]:active { +.user-feedback button[type='submit']:active { background-color: var(--ifm-color-primary-dark); } @@ -117,7 +120,6 @@ button.close-button { background: none; } - .button-secondary:active { color: var(--ifm-color-primary-darker); } @@ -125,3 +127,8 @@ button.close-button { .button-secondary:hover { color: var(--ifm-color-primary-lightest); } + +.user-feedback textarea { + display: block; + width: 100%; +}