Skip to content

Commit

Permalink
Add Thank You page component and update main.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
nttminh committed Feb 29, 2024
1 parent d375eff commit 72f74b5
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 14 deletions.
53 changes: 53 additions & 0 deletions src/components/thankyou/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React, { useEffect, useState } from 'react';

const HackathonThankYouPage = () => {
const [windowWidth, setWindowWidth] = useState(window.innerWidth);

const updateDimensions = () => {
setWindowWidth(window.innerWidth);
};

useEffect(() => {
window.addEventListener('resize', updateDimensions);
return () => window.removeEventListener('resize', updateDimensions);
}, []);

const pageStyle = {
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
height: '100vh',
padding: '20px',
textAlign: 'center',
fontSize: windowWidth > 768 ? '18px' : '16px',
color: '#ffffff',
backgroundColor: '#0A0A0A',
fontFamily: '"Lucida Console", Monaco, monospace'
};

const headingStyle = {
color: '#4CAF50',
fontSize: windowWidth > 768 ? '32px' : '28px'
};

const linkStyle = {
color: '#4CAF50',
textDecoration: 'none',
fontWeight: 'bold',
fontSize: windowWidth > 768 ? '20px' : '18px',
margin: '10px'
};

return (
<div style={pageStyle}>
<h1 style={headingStyle}>Thank You!</h1>
<p>Thank you for joining our BostonBridge Hackathon 2024. We will be back in the near future.</p>
<p>In the meantime, please follow us for more information:</p>
<a href="https://www.instagram.com/umb_csc/" target="_blank" rel="noopener noreferrer" style={linkStyle}>Instagram</a>
<a href="https://discord.com/invite/xJZhRBtX" target="_blank" rel="noopener noreferrer" style={linkStyle}>Discord</a>
</div>
);
};

export default HackathonThankYouPage;
37 changes: 23 additions & 14 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,11 @@ import { Analytics } from '@vercel/analytics/react';
import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter, Route, Routes } from "react-router-dom";
import {
About,
Events,
Guildelines,
Hero,
Judges,
Login,
Navbar,
Set1,
Set2,
Verify,
} from "./components";
import Error from "./error.jsx";
import HackathonThankYouPage from "./components/thankyou";
import Error from "./error";
import "./index.css";


import ReactGA from "react-ga";
ReactGA.initialize("K6F7N5MR4K");
ReactGA.pageview(window.location.pathname + window.location.search);
Expand All @@ -25,7 +15,7 @@ ReactDOM.createRoot(document.getElementById("root")).render(
<React.StrictMode>
<Analytics />
<BrowserRouter>
<Routes>
{/* <Routes>
<Route
path="*"
element={
Expand Down Expand Up @@ -99,6 +89,25 @@ ReactDOM.createRoot(document.getElementById("root")).render(
/>
<Route path="/qr/verify/:id" element={<Verify />} />
<Route path="/login" element={<Login />} />
</Routes> */}
{/* Make a */}
<Routes>
<Route
path="*"
element={
<div className="bg-error">
<Error />
</div>
}
/>
<Route
path="/"
element={
<div className="bg">
<HackathonThankYouPage />
</div>
}
/>
</Routes>
</BrowserRouter>
</React.StrictMode>
Expand Down

0 comments on commit 72f74b5

Please sign in to comment.