Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Thank You Message Component #512

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions site/src/component/ReportForm/ReportForm.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 2 additions & 10 deletions site/src/component/ReportForm/ReportForm.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -73,15 +73,7 @@ const ReportForm: FC<ReportFormProps> = (props) => {
return (
<Modal show={props.showForm} centered animation={false} onHide={props.closeForm}>
<div className="report-form">
{reportSubmitted ? (
<div className="submitted-report-form">
<Icon name="check circle" size="huge" />
<h1>Thank You</h1>
<p>Your report has been submitted successfully.</p>
</div>
) : (
reportForm
)}
{reportSubmitted ? <ThankYouMessage message="Your report has been submitted successfully." /> : reportForm}
</div>
</Modal>
);
Expand Down
14 changes: 1 addition & 13 deletions site/src/component/ReviewForm/ReviewForm.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 2 additions & 9 deletions site/src/component/ReviewForm/ReviewForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -499,15 +500,7 @@ const ReviewForm: FC<ReviewFormProps> = ({
return (
<Modal show={show} onHide={closeForm} centered animation={false}>
<div className="review-form">
{submitted ? (
<div className="submitted-form">
<Icon name="check circle" size="huge" />
<h1>Thank You</h1>
<p>Your form has been submitted successfully.</p>
</div>
) : (
reviewForm
)}
{submitted ? <ThankYouMessage message="Your form has been submitted successfully." /> : reviewForm}
</div>
</Modal>
);
Expand Down
13 changes: 13 additions & 0 deletions site/src/component/ThankYouMessage/ThankYouMessage.scss
Original file line number Diff line number Diff line change
@@ -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;
}
}
19 changes: 19 additions & 0 deletions site/src/component/ThankYouMessage/ThankYouMessage.tsx
Original file line number Diff line number Diff line change
@@ -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<ThankYouMessageProps> = ({ message }) => {
return (
<div className="thank-you-message">
<Icon name="check circle" size="huge" />
<h1>Thank You</h1>
<p>{message}</p>
</div>
);
};

export default ThankYouMessage;
Loading