From d75519a4464262fdac5253168725705f2fffc9c6 Mon Sep 17 00:00:00 2001 From: brz95 Date: Thu, 23 Feb 2023 20:39:43 +0300 Subject: [PATCH 1/4] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D1=83=20=D0=BA=D0=BE?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D1=83=D1=8E=20=D0=B2=D1=8B=D0=B4=D0=B0=D0=B2?= =?UTF-8?q?=D0=B0=D0=BB=D0=B0=20=D0=BA=D0=BE=D0=BD=D1=81=D0=BE=D0=BB=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/questions/create-question/CreateQuestionPage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/questions/create-question/CreateQuestionPage.jsx b/src/features/questions/create-question/CreateQuestionPage.jsx index 915adf5..8cad653 100644 --- a/src/features/questions/create-question/CreateQuestionPage.jsx +++ b/src/features/questions/create-question/CreateQuestionPage.jsx @@ -260,8 +260,8 @@ const CreateQuestion = () => {
- - Отмена + + Отмена
From 31ba8e3e67dff531f17738dd87db71c8aa0969c2 Mon Sep 17 00:00:00 2001 From: brz95 Date: Thu, 23 Feb 2023 21:00:43 +0300 Subject: [PATCH 2/4] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D1=83=20=D0=B5=D1=89?= =?UTF-8?q?=D0=B5=20=D0=B2=20=D0=BE=D0=B4=D0=BD=D0=BE=D0=BC=20=D0=BC=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/questions/create-question/CreateQuestionPage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/questions/create-question/CreateQuestionPage.jsx b/src/features/questions/create-question/CreateQuestionPage.jsx index 8cad653..f310ef1 100644 --- a/src/features/questions/create-question/CreateQuestionPage.jsx +++ b/src/features/questions/create-question/CreateQuestionPage.jsx @@ -156,8 +156,8 @@ const CreateQuestion = () => {

Добавление вопроса

- - Вернуться назад + + Вернуться назад
From 760e14e0f2c67a54bd91c6beec6febd779c6cafb Mon Sep 17 00:00:00 2001 From: brz95 Date: Thu, 23 Feb 2023 21:51:10 +0300 Subject: [PATCH 3/4] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82=20Can?= =?UTF-8?q?celLinkLabel=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=BE=D1=85=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B0=D1=82=D1=80=D0=B8?= =?UTF-8?q?=D0=B1=D1=83=D1=82=D0=BE=D0=B2=20Typography.Text=20=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D1=81=D1=82=D0=B8=D0=BB=20?= =?UTF-8?q?Typography.Link=20=D0=B2=20=D0=BF=D1=80=D0=BE=D0=BF=D1=81=20com?= =?UTF-8?q?ponent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-question/CreateQuestionPage.jsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/features/questions/create-question/CreateQuestionPage.jsx b/src/features/questions/create-question/CreateQuestionPage.jsx index f310ef1..ee1f80b 100644 --- a/src/features/questions/create-question/CreateQuestionPage.jsx +++ b/src/features/questions/create-question/CreateQuestionPage.jsx @@ -11,6 +11,7 @@ import { addQuestion } from 'features/questions/questionsSlice'; import { selectProfile } from 'features/profile/profileSlice'; import { useAuth } from 'common/context/Auth/useAuth'; import { MAX_NUMBER_OF_TAGS, TAG_MAX_LENGTH } from 'app/constants'; +import PropTypes from 'prop-types'; const StyledQuestionWrapper = styled.div` & .new-tag { @@ -70,6 +71,14 @@ const StyledTagBlock = styled.div` margin-top: 5px; `; +function CancelLinkLabel({ children }) { + return {children}; +} + +CancelLinkLabel.propTypes = { + children: PropTypes.node.isRequired, +}; + const CreateQuestion = () => { const dispatch = useDispatch(); const editorRef = useRef(); @@ -217,8 +226,8 @@ const CreateQuestion = () => {
{tags.map((tag) => ( - - removeTag(tag)}> + + removeTag(tag)}> {tag} @@ -260,7 +269,7 @@ const CreateQuestion = () => {
- + Отмена
From 6074903a7900ad1603304143d6ad9d4c9d03f862 Mon Sep 17 00:00:00 2001 From: Kuduzow Akhmad Date: Thu, 23 Feb 2023 22:06:46 +0300 Subject: [PATCH 4/4] fix: wrap CancelLinkLabel with right props --- .../create-question/CreateQuestionPage.jsx | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/features/questions/create-question/CreateQuestionPage.jsx b/src/features/questions/create-question/CreateQuestionPage.jsx index ee1f80b..0dd1243 100644 --- a/src/features/questions/create-question/CreateQuestionPage.jsx +++ b/src/features/questions/create-question/CreateQuestionPage.jsx @@ -1,4 +1,4 @@ -import { useState, useCallback, useEffect, useRef } from 'react'; +import React, { useState, useCallback, useEffect, useRef } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { Link, Redirect } from 'react-router-dom'; import styled from 'styled-components'; @@ -71,11 +71,23 @@ const StyledTagBlock = styled.div` margin-top: 5px; `; -function CancelLinkLabel({ children }) { - return {children}; -} +const CancelButtonWrapper = styled.span` + cursor: pointer; +`; + +const CancelLinkLabel = ({ navigate, href, children }) => { + return ( + + navigate(href)}> + {children} + + + ); +}; CancelLinkLabel.propTypes = { + navigate: PropTypes.func.isRequired, + href: PropTypes.string.isRequired, children: PropTypes.node.isRequired, };