From e7f0a4485d59818c563cf167945f6bde6f3674f9 Mon Sep 17 00:00:00 2001 From: gofnnp Date: Mon, 14 Aug 2023 01:07:05 +0400 Subject: [PATCH] feat: add feedback page and checkbox with text component --- src/components/CheckboxWithText/index.tsx | 21 +++++ .../CheckboxWithText/styles.module.css | 77 +++++++++++++++++++ src/components/FeedbackPage/index.tsx | 26 +++++++ src/components/FeedbackPage/styles.module.css | 33 ++++++++ 4 files changed, 157 insertions(+) create mode 100644 src/components/CheckboxWithText/index.tsx create mode 100644 src/components/CheckboxWithText/styles.module.css create mode 100644 src/components/FeedbackPage/index.tsx create mode 100644 src/components/FeedbackPage/styles.module.css diff --git a/src/components/CheckboxWithText/index.tsx b/src/components/CheckboxWithText/index.tsx new file mode 100644 index 0000000..c4eca56 --- /dev/null +++ b/src/components/CheckboxWithText/index.tsx @@ -0,0 +1,21 @@ +import styles from "./styles.module.css" + +export type CheckboxWithTextProps = { + text: string + onChange?: (value: React.FormEvent) => void +} + +function CheckboxWithText({ text, onChange }: CheckboxWithTextProps): JSX.Element { + + return ( +
+ + {text} +
+ ) +} + +export default CheckboxWithText diff --git a/src/components/CheckboxWithText/styles.module.css b/src/components/CheckboxWithText/styles.module.css new file mode 100644 index 0000000..dd0d7b8 --- /dev/null +++ b/src/components/CheckboxWithText/styles.module.css @@ -0,0 +1,77 @@ +.container { + display: flex; + flex-direction: row; + align-items: center; + gap: 12px; + width: 100%; +} + +.container__input { + display: block; + position: relative; + padding-left: 27px; + margin-bottom: 27px; + cursor: pointer; + font-size: 22px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +/* hover */ +/* .container__input:hover .container__checkbox ~ .container__checkmark { + background-color: #ccc; +} */ + +.container__input .container__checkbox { + position: absolute; + opacity: 0; + cursor: pointer; + height: 0; + width: 0; +} + +.container__input .container__checkbox:checked ~ .container__checkmark { + background-color: #878585; +} + +.container__checkmark { + position: absolute; + top: 0; + left: 0; + height: 25px; + width: 25px; + /* background-color: #878585; */ + border: solid 2px #878585; + border-radius: 5px; +} + +.container__checkmark:after { + content: ""; + position: absolute; + display: none; +} + +.container__input .container__checkbox:checked ~ .container__checkmark:after { + display: block; +} + +.container__checkmark:after { + left: 7px; + top: 3px; + width: 5px; + height: 10px; + border: solid white; + border-width: 0 3px 3px 0; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); +} + +.container__text { + text-align: left; + line-height: 1.2; + color: #878585; + font-weight: 500; +} diff --git a/src/components/FeedbackPage/index.tsx b/src/components/FeedbackPage/index.tsx new file mode 100644 index 0000000..af3c72e --- /dev/null +++ b/src/components/FeedbackPage/index.tsx @@ -0,0 +1,26 @@ +import { useNavigate } from 'react-router-dom' +import { useTranslation } from 'react-i18next' +import routes from '../../routes' +import styles from './styles.module.css' +import MainButton from '../MainButton' + +function FeedbackPage(): JSX.Element { + const { t } = useTranslation() + const navigate = useNavigate() + const handleNext = () => navigate(routes.client.emailEnter()) + + return ( +
+
+ profile picture + stop +
+

{t('feedback')}

+ + {t('next')} + +
+ ) +} + +export default FeedbackPage diff --git a/src/components/FeedbackPage/styles.module.css b/src/components/FeedbackPage/styles.module.css new file mode 100644 index 0000000..f52b045 --- /dev/null +++ b/src/components/FeedbackPage/styles.module.css @@ -0,0 +1,33 @@ +.page { + flex: auto; + height: calc(100vh - 50px); + max-height: -webkit-fill-available; + justify-content: center; + gap: 16px; +} + +.images { + display: flex; + align-items: flex-end; + gap: 18px; + width: 100%; + justify-content: flex-start; +} + +.profile-picture { + width: 96px; +} + +.stars { + width: 116px; + margin-bottom: 14px; +} + +.text { + color: #000; + font-weight: 600; + padding: 18px; + background-color: #e2e0e0; + border-radius: 24px; + margin-bottom: 8px; +}