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

Create email invite confirmation screen #215

Merged
merged 11 commits into from
Oct 19, 2023
32 changes: 32 additions & 0 deletions src/components/EmailInviteConfirmation/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React, { useEffect } from 'react';
import { useNavigate } from 'react-router-dom';

import './stylesheet.scss';

export default function EmailInviteConfirmation(): React.ReactElement {
const navigate = useNavigate();

useEffect(() => {
setTimeout(() => {
navigate('/');
}, 30000);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change the timeout to 5s. Websites usually mention 30s in case the redirect fails or takes too much time, but they trigger the redirect much earlier on.


return (
<div className="EmailInviteConfirmation">
<h1>Congratulations on Adding a New Schedule to your View!</h1>
<p>You are being redirected to our main site, please wait...</p>
<p>
If you have not been redirected in 30 seconds, please click the button
below
</p>
<button type="button" className="continue-button">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The button is missing the on-click redirect functionality.

Continue
</button>

<a className="footer" href="https://bitsofgood.org/">
<img alt="Bits of Good Logo" src="bitsOfGood.png" />
</a>
</div>
);
}
53 changes: 53 additions & 0 deletions src/components/EmailInviteConfirmation/stylesheet.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@import '../../variables';

body {
background-color: $theme-dark-background;
color: $theme-dark-foreground;
}

.EmailInviteConfirmation {
display: flex;
flex-direction: column;
align-items: center;
padding-top: 160px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this responsive. For larger screens, the gap appears to be too large:

image

padding-bottom: 38px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed since the footer is already absolutely positioned.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applies to line 13

padding-left: 32px;
padding-right: 32px;
font-size: 24px;
height: 100%;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a text-align: center; over here so all text is center aligned even when broken into multiple lines.


@media (max-width: 1000px) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The page is responsive to the width but not the height. The button appears below the BoG text and logo:

padding-top: 80px;

h1 {
font-size: 24px;
align-self: flex-start;
}

p {
align-self: flex-start;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text should be center-aligned even in mobile view. So, this can be removed.


h1 {
font-size: 36px;
font-weight: 600;
}

.footer {
position: absolute;
bottom: 38px;
}

.continue-button {
background-color: #FE7C53;
color: white;
margin-top: 96px;
padding: 8px 24px;
border: none;
border-radius: 16px;
cursor: pointer;
font-size: 32px;
font-weight: 600;
}
}
2 changes: 2 additions & 0 deletions src/components/RouterComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';

import App from '../App';
import EmailInviteConfirmation from '../EmailInviteConfirmation';
import InviteBackLink from '../InviteBackLink';

export default function RouterComponent(): React.ReactElement {
Expand All @@ -10,6 +11,7 @@ export default function RouterComponent(): React.ReactElement {
<Routes>
<Route path="/" element={<App />} />
<Route path="/invite/:id" element={<InviteBackLink />} />
<Route path="/confirm-invite" element={<EmailInviteConfirmation />} />
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</BrowserRouter>
Expand Down