Skip to content

Commit

Permalink
confirmation message implementation
Browse files Browse the repository at this point in the history
closes #123 added confirmation message on successful project submission
  • Loading branch information
Frenziecodes authored Jun 21, 2023
2 parents e6aeb9c + 6b905f7 commit af8ad7b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

tasks:
- init: npm install && npm run build
command: npm run start


2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Layout from './components/Layout';
import NotFound from './pages/404';
import PrivacyPolicyPage from './pages/PrivacyPolicy';
import TermsOfServicePage from './pages/Terms';
import Success from './pages/Success'

function App() {
return (
Expand All @@ -28,6 +29,7 @@ function App() {
<Route path='/login' element={<Login />} />
<Route path='/logout' element={<Logout />} />
<Route path='*' element={<NotFound />} />
<Route path='/success' element={<Success />} />
</Routes>
</Layout>
</BrowserRouter>
Expand Down
2 changes: 2 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import Layout from './components/Layout';
import NotFound from './pages/404';
import PrivacyPolicyPage from './pages/PrivacyPolicy';
import TermsOfServicePage from './pages/Terms';
import Success from './pages/Success'

function App() {
return (
<BrowserRouter>
<Layout>
<Routes>
<Route path='/404' element={<NotFound />} />
<Route path='/success' element={<Success />} />
<Route path='/' element={<HomePage />} />
<Route path='/viewprojects' element={<ViewProject />} />
<Route path='/addproject' element={<AddProject />} />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/AddProject.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function AddProject() {

// Save the project data to Firestore
const docRef = await addDoc(collection(db, 'projects'), projectData);
navigate('/viewprojects');
navigate('/success');
} catch (error) {
setErrorMessage(error.message);
}
Expand Down
14 changes: 14 additions & 0 deletions src/pages/Success.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import { Link } from 'react-router-dom';

function NotFound() {
return (
<div className="flex flex-col bg-white text-gray-700 items-center justify-center h-screen">
<h1 className="text-4xl font-bold mb-4">Thank you for your Submission!</h1>
<p className="text-gray-600">Your project has been submitted</p>
<Link className="text-blue-600" to={"/"}>Go back to the homepage?</Link>
</div>
);
}

export default NotFound;

1 comment on commit af8ad7b

@vercel
Copy link

@vercel vercel bot commented on af8ad7b Jun 21, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

projest – ./

projest-git-master-lewisushindi.vercel.app
projest-lewisushindi.vercel.app
projest.vercel.app

Please sign in to comment.