From 5edb7a3bc95339b34da35b11b29b02a2cf30d05c Mon Sep 17 00:00:00 2001 From: Ben Furber Date: Fri, 31 May 2024 16:15:27 +0100 Subject: [PATCH] feat: use guidelines component across app --- src/pages/Howto/Content/Common/Howto.form.tsx | 6 +- .../Content/Common/HowtoPostingGuidelines.tsx | 55 +++++++++++++++++ .../Content/Common/PostingGuidelines.tsx | 60 ------------------- src/pages/Howto/Content/Common/index.ts | 2 +- .../Content/Common/PostingGuidelines.tsx | 48 --------------- .../Question/Content/Common/QuestionForm.tsx | 6 +- .../Common/QuestionPostingGuidelines.tsx | 56 +++++++++++++++++ src/pages/Question/Content/Common/index.ts | 2 +- .../Content/Common/PostingGuidelines.tsx | 51 ---------------- .../Research/Content/Common/Research.form.tsx | 6 +- .../Common/ResearchPostingGuidelines.tsx | 43 +++++++++++++ src/pages/Research/Content/Common/index.ts | 2 +- .../content/PostingGuidelines.tsx | 41 ++++++------- 13 files changed, 183 insertions(+), 195 deletions(-) create mode 100644 src/pages/Howto/Content/Common/HowtoPostingGuidelines.tsx delete mode 100644 src/pages/Howto/Content/Common/PostingGuidelines.tsx delete mode 100644 src/pages/Question/Content/Common/PostingGuidelines.tsx create mode 100644 src/pages/Question/Content/Common/QuestionPostingGuidelines.tsx delete mode 100644 src/pages/Research/Content/Common/PostingGuidelines.tsx create mode 100644 src/pages/Research/Content/Common/ResearchPostingGuidelines.tsx diff --git a/src/pages/Howto/Content/Common/Howto.form.tsx b/src/pages/Howto/Content/Common/Howto.form.tsx index b1aecfe0e3..ad387b5182 100644 --- a/src/pages/Howto/Content/Common/Howto.form.tsx +++ b/src/pages/Howto/Content/Common/Howto.form.tsx @@ -31,8 +31,8 @@ import { HowtoFieldTags, HowtoFieldTime, HowtoFieldTitle, + HowtoPostingGuidelines, HowToSubmitStatus, - PostingGuidelines, } from '.' import type { FormApi } from 'final-form' @@ -172,7 +172,7 @@ export const HowtoForm = observer((props: IProps) => { - + { }} > - + ( + + Choose what you want to share{' '} + + πŸ™Œ + + , + <> + Read{' '} + + our guidelines{' '} + + πŸ€“ + + + , + <> + Prepare your text & images{' '} + + πŸ—„οΈ + + , + <> + Create your How-to{' '} + + ✍️ + + , + <> + Click on β€œPublish”{' '} + + πŸ–±οΈ + + , + <>We will either send you feedback, or, + <> + Approve if everything is okay{' '} + + βœ… + + , + <> + Be proud{' '} + + πŸ™‚ + + , + ]} + /> +) diff --git a/src/pages/Howto/Content/Common/PostingGuidelines.tsx b/src/pages/Howto/Content/Common/PostingGuidelines.tsx deleted file mode 100644 index 7c9abccc4b..0000000000 --- a/src/pages/Howto/Content/Common/PostingGuidelines.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import { ExternalLink } from 'oa-components' -import { Card, Flex, Heading, Text } from 'theme-ui' - -export const PostingGuidelines = () => ( - - - - How does it work? - - - 1. Choose what you want to share{' '} - - πŸ™Œ - - - - 2. Read{' '} - - our guidelines{' '} - - πŸ€“ - - - - - 3. Prepare your text & images{' '} - - πŸ—„οΈ - - - - 4. Create your How-to{' '} - - ✍️ - - - - 5. Click on β€œPublish”{' '} - - πŸ–±οΈ - - - - 6. We will either send you feedback, or - - - 7. Approve if everything is okay{' '} - - βœ… - - - - 8. Be proud{' '} - - πŸ™‚ - - - - -) diff --git a/src/pages/Howto/Content/Common/index.ts b/src/pages/Howto/Content/Common/index.ts index 1c622313d7..3ca756cdda 100644 --- a/src/pages/Howto/Content/Common/index.ts +++ b/src/pages/Howto/Content/Common/index.ts @@ -16,4 +16,4 @@ export { HowtoFieldTags } from './HowtoFieldTags' export { HowtoFieldTime } from './HowtoFieldTime' export { HowtoFieldTitle } from './HowtoFieldTitle' export { HowToSubmitStatus } from './SubmitStatus' -export { PostingGuidelines } from './PostingGuidelines' +export { HowtoPostingGuidelines } from './HowtoPostingGuidelines' diff --git a/src/pages/Question/Content/Common/PostingGuidelines.tsx b/src/pages/Question/Content/Common/PostingGuidelines.tsx deleted file mode 100644 index 37fe984843..0000000000 --- a/src/pages/Question/Content/Common/PostingGuidelines.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { ExternalLink } from 'oa-components' -import { Card, Flex, Heading, Text } from 'theme-ui' - -export const PostingGuidelines = () => ( - - - - How does it work? - - - 1. Write your question{' '} - - πŸ™Œ - - - - 2. Double check if it's already made and{' '} - - search{' '} - - - - 3. Provide enough info for people to help{' '} - - πŸ—„οΈ - - - - 4. Add a category and search so others can find it{' '} - - ✍️ - - - - 5. Publish - - - 6. Come back to comment the answers - - - 7. Get your best answer{' '} - - πŸ™‚ - - - - -) diff --git a/src/pages/Question/Content/Common/QuestionForm.tsx b/src/pages/Question/Content/Common/QuestionForm.tsx index 6bdcb3a083..075c171c0b 100644 --- a/src/pages/Question/Content/Common/QuestionForm.tsx +++ b/src/pages/Question/Content/Common/QuestionForm.tsx @@ -4,7 +4,7 @@ import { Button, ElWithBeforeIcon } from 'oa-components' import { IModerationStatus } from 'oa-shared' import IconHeaderHowto from 'src/assets/images/header-section/howto-header-icon.svg' import { logger } from 'src/logger' -import { PostingGuidelines } from 'src/pages/Question/Content/Common' +import { QuestionPostingGuidelines } from 'src/pages/Question/Content/Common' import * as LABELS from 'src/pages/Question/labels' import { useQuestionStore } from 'src/stores/Question/question.store' import { setAllowDraftSaveFalse } from 'src/utils/validators' @@ -90,7 +90,7 @@ export const QuestionForm = (props: IProps) => { - + { }} > - +