Add DEBUG component for development environment
Introduced a new DEBUG component exclusively for the development environment. This component contains navigation options for email verification and the 'thank you' page. Updated the .gitignore file to no longer exclude DEBUG files, and included a basic layout and styling for the component.
This commit is contained in:
@@ -21,6 +21,3 @@
|
|||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
|
||||||
**/DEBUG
|
|
||||||
**/DEBUG*
|
|
||||||
@@ -6,6 +6,7 @@ import Footer from "./components/footer/footer";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import VerifyMail from "./components/verify_email/verify_mail";
|
import VerifyMail from "./components/verify_email/verify_mail";
|
||||||
import ThankYou from "./components/verify_email/thank_you";
|
import ThankYou from "./components/verify_email/thank_you";
|
||||||
|
import DEBUG from "./components/DEBUG/DEBUG";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
@@ -16,6 +17,7 @@ function App() {
|
|||||||
<Route path="/contact" element={<ContactForm/>}/>
|
<Route path="/contact" element={<ContactForm/>}/>
|
||||||
<Route path="/verify-email" element={<VerifyMail/>}/>
|
<Route path="/verify-email" element={<VerifyMail/>}/>
|
||||||
<Route path="/thank-you" element={<ThankYou/>}/>
|
<Route path="/thank-you" element={<ThankYou/>}/>
|
||||||
|
{process.env.NODE_ENV === 'development' && <Route path="/debug" element={<DEBUG/>}/>}
|
||||||
</Routes>
|
</Routes>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
<Footer/>
|
<Footer/>
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import {FC} from "react";
|
||||||
|
import {useNavigate} from 'react-router-dom';
|
||||||
|
import {NavigateOptions} from "react-router/dist/lib/context";
|
||||||
|
import './DEBUG.css'
|
||||||
|
|
||||||
|
const DEBUG: FC = () => {
|
||||||
|
const navigate = useNavigate()
|
||||||
|
const handleClick = (link: string, options: NavigateOptions) => {
|
||||||
|
navigate(link, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='container'>
|
||||||
|
<button onClick={() => handleClick('/verify-email', {
|
||||||
|
state: {
|
||||||
|
email: '[email protected]'
|
||||||
|
}
|
||||||
|
})}>Verify Email Debug</button>
|
||||||
|
<button onClick={() => handleClick('/thank-you', {
|
||||||
|
state: {
|
||||||
|
formData: {
|
||||||
|
row1: 'This is some text',
|
||||||
|
row2: 'This is text as well',
|
||||||
|
row3: 'And finally, here is even more text!'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})}>Thank You Debug</button>
|
||||||
|
{/*<button onClick={() => handleClick('/page3', {})}>Page 3</button>*/}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default DEBUG;
|
||||||
Reference in New Issue
Block a user