-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
project setup with React and React Router setup
- Loading branch information
Showing
8 changed files
with
776 additions
and
18 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
function Dashboard() { | ||
return ( | ||
<div> | ||
<h1>Dashboard</h1> | ||
<p>Welcome to your Dashboard. Here you can see the overview of operations.</p> | ||
</div> | ||
); | ||
} | ||
|
||
export default Dashboard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React, { useState } from 'react'; | ||
|
||
function LoginForm() { | ||
const [username, setUsername] = useState(''); | ||
const [password, setPassword] = useState(''); | ||
|
||
const handleLogin = (event) => { | ||
event.preventDefault(); | ||
// Implement login logic here | ||
console.log(`Login attempt with username: ${username} and password: ${password}`); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<h1>Login</h1> | ||
<form onSubmit={handleLogin}> | ||
<label> | ||
Username: | ||
<input | ||
type="text" | ||
value={username} | ||
onChange={e => setUsername(e.target.value)} | ||
/> | ||
</label> | ||
<label> | ||
Password: | ||
<input | ||
type="password" | ||
value={password} | ||
onChange={e => setPassword(e.target.value)} | ||
/> | ||
</label> | ||
<button type="submit">Login</button> | ||
</form> | ||
</div> | ||
); | ||
} | ||
|
||
export default LoginForm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
function Navbar() { | ||
return ( | ||
<nav> | ||
<ul> | ||
<li><Link to="/">Dashboard</Link></li> | ||
<li><Link to="/submit">Submit Data</Link></li> | ||
<li><Link to="/login">Login</Link></li> | ||
</ul> | ||
</nav> | ||
); | ||
} | ||
|
||
export default Navbar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { useState } from 'react'; | ||
|
||
function SubmissionForm() { | ||
const [inputValue, setInputValue] = useState(''); | ||
|
||
const handleSubmit = (event) => { | ||
event.preventDefault(); | ||
// Implement what happens when the form is submitted | ||
console.log(inputValue); | ||
}; | ||
|
||
return ( | ||
<form onSubmit={handleSubmit}> | ||
<label> | ||
Enter Data: | ||
<input | ||
type="text" | ||
value={inputValue} | ||
onChange={e => setInputValue(e.target.value)} | ||
/> | ||
</label> | ||
<button type="submit">Submit</button> | ||
</form> | ||
); | ||
} | ||
|
||
export default SubmissionForm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { configureStore } from '@reduxjs/toolkit'; | ||
import submissionReducer from './features/submissions/submissionSlice'; | ||
|
||
export const store = configureStore({ | ||
reducer: { | ||
submissions: submissionReducer | ||
} | ||
}); |