diff --git a/site/src/component/ReportForm/ReportForm.scss b/site/src/component/ReportForm/ReportForm.scss index d39c55d0..0bac8bc8 100644 --- a/site/src/component/ReportForm/ReportForm.scss +++ b/site/src/component/ReportForm/ReportForm.scss @@ -57,20 +57,6 @@ margin-top: 0px; } -.submitted-report-form { - text-align: center; - width: 100%; - i { - color: var(--peterportal-secondary-green); - } - h1 { - margin: 15px 0; - } - p { - font-size: 1.25rem; - } -} - @media only screen and (max-width: 400px) { .report-form { button { diff --git a/site/src/component/ReportForm/ReportForm.tsx b/site/src/component/ReportForm/ReportForm.tsx index 2eaffd3d..6e49abd6 100644 --- a/site/src/component/ReportForm/ReportForm.tsx +++ b/site/src/component/ReportForm/ReportForm.tsx @@ -1,11 +1,11 @@ import React, { FC, useState } from 'react'; -import { Icon } from 'semantic-ui-react'; import Form from 'react-bootstrap/Form'; import Button from 'react-bootstrap/Button'; import './ReportForm.scss'; import Modal from 'react-bootstrap/Modal'; import trpc from '../../trpc'; import { ReportSubmission } from '@peterportal/types'; +import ThankYouMessage from '../ThankYouMessage/ThankYouMessage'; interface ReportFormProps { showForm: boolean; @@ -73,15 +73,7 @@ const ReportForm: FC = (props) => { return (
- {reportSubmitted ? ( -
- -

Thank You

-

Your report has been submitted successfully.

-
- ) : ( - reportForm - )} + {reportSubmitted ? : reportForm}
); diff --git a/site/src/component/ReviewForm/ReviewForm.scss b/site/src/component/ReviewForm/ReviewForm.scss index 39cf88bc..01ae883f 100644 --- a/site/src/component/ReviewForm/ReviewForm.scss +++ b/site/src/component/ReviewForm/ReviewForm.scss @@ -106,19 +106,7 @@ justify-content: space-between; align-items: center; } -.submitted-form { - text-align: center; - width: 100%; - i { - color: var(--peterportal-secondary-green); - } - h1 { - margin: 15px 0; - } - p { - font-size: 1.25rem; - } -} + .review-form-close { position: absolute; right: 2vh; diff --git a/site/src/component/ReviewForm/ReviewForm.tsx b/site/src/component/ReviewForm/ReviewForm.tsx index 715ad624..f28fc98d 100644 --- a/site/src/component/ReviewForm/ReviewForm.tsx +++ b/site/src/component/ReviewForm/ReviewForm.tsx @@ -15,6 +15,7 @@ import { ReviewProps } from '../Review/Review'; import ThemeContext from '../../style/theme-context'; import { quarters } from '@peterportal/types'; import trpc from '../../trpc'; +import ThankYouMessage from '../ThankYouMessage/ThankYouMessage'; import { anonymousName, EditReviewSubmission, @@ -499,15 +500,7 @@ const ReviewForm: FC = ({ return (
- {submitted ? ( -
- -

Thank You

-

Your form has been submitted successfully.

-
- ) : ( - reviewForm - )} + {submitted ? : reviewForm}
); diff --git a/site/src/component/ThankYouMessage/ThankYouMessage.scss b/site/src/component/ThankYouMessage/ThankYouMessage.scss new file mode 100644 index 00000000..f1f1267e --- /dev/null +++ b/site/src/component/ThankYouMessage/ThankYouMessage.scss @@ -0,0 +1,13 @@ +.thank-you-message { + text-align: center; + width: 100%; + i { + color: var(--peterportal-secondary-green); + } + h1 { + margin: 15px 0; + } + p { + font-size: 1.25rem; + } +} diff --git a/site/src/component/ThankYouMessage/ThankYouMessage.tsx b/site/src/component/ThankYouMessage/ThankYouMessage.tsx new file mode 100644 index 00000000..a080ef02 --- /dev/null +++ b/site/src/component/ThankYouMessage/ThankYouMessage.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +import { Icon } from 'semantic-ui-react'; +import './ThankYouMessage.scss'; + +interface ThankYouMessageProps { + message: string; +} + +const ThankYouMessage: React.FC = ({ message }) => { + return ( +
+ +

Thank You

+

{message}

+
+ ); +}; + +export default ThankYouMessage;