2nd half of initial commit

This commit is contained in:
Gregory Kenneth Bowne 2024-04-12 00:24:37 -07:00
parent 37f0362d41
commit 8ac49bf4b3
14 changed files with 124 additions and 4 deletions

View File

@ -5,12 +5,14 @@ import Register from './pages/Dashboard/Dashboard';
import Login from './pages/Login/Login'; import Login from './pages/Login/Login';
import Profile from './pages/Profile/Profile'; import Profile from './pages/Profile/Profile';
import NotFound from './pages/NotFound/NotFound'; import NotFound from './pages/NotFound/NotFound';
import Home from './pages/Home/Home';
const App = () => { const App = () => {
return ( return (
<Router> <Router>
<Routes> <Routes>
<Route path="/" element={<Dashboard />} /> <Route path="/" element={<Home />} />
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/register" element={<Register />} /> <Route path="/register" element={<Register />} />
<Route path="/login" element={<Login />} /> <Route path="/login" element={<Login />} />
<Route path="/profile" element={<Profile />} /> <Route path="/profile" element={<Profile />} />

BIN
src/assets/bc250.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

BIN
src/assets/mwradio.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
src/assets/radio_01.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

BIN
src/assets/radio_02.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
src/assets/radio_03.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

BIN
src/assets/swl.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

BIN
src/assets/swradio.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
src/assets/swradio1.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

69
src/pages/Home/Home.jsx Normal file
View File

@ -0,0 +1,69 @@
import React, { useState, useEffect } from 'react';
import { Box, Typography, Button, Modal, Container } from '@mui/material';
import { useNavigate } from 'react-router-dom';
import { useTheme } from '@mui/material/styles';
import './Home.css'; // Import the CSS file
const Home = () => {
const [open, setOpen] = useState(true); // Assuming the modal should be open by default
const navigate = useNavigate();
const theme = useTheme();
// Simulate checking if the user is a returning user
const isReturningUser = false; // This should be replaced with actual logic
const handleClose = () => {
setOpen(false);
};
const handleNavigate = () => {
if (isReturningUser) {
navigate('/login');
} else {
navigate('/register');
}
};
useEffect(() => {
// This is where you would check if the user is a returning user
// For demonstration, we're setting isReturningUser to false
// In a real application, you would replace this with actual logic
// For example, checking localStorage or a backend service
}, []);
return (
<Container maxWidth="sm">
<Modal
open={open}
onClose={handleClose}
aria-labelledby="home-modal-title"
aria-describedby="home-modal-description"
>
<Box
sx={{
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: 400,
bgcolor: theme.palette.background.paper,
boxShadow: 24,
p: 4,
}}
>
<Typography id="home-modal-title" variant="h6" component="h2">
RadioLogger
</Typography>
<Typography id="home-modal-description" variant="body1">
A software tool that helps radio enthusiasts keep track of their radio communications and log their listening experiences.
</Typography>
<Button variant="contained" color="primary" onClick={handleNavigate}>
Go to {isReturningUser ? 'Login' : 'Register'}
</Button>
</Box>
</Modal>
</Container>
);
};
export default Home;

View File

@ -0,0 +1,51 @@
import React from 'react';
import { Box, Typography, Link } from '@mui/material';
import { useNavigate } from 'react-router-dom';
const NotFound = () => {
const navigate = useNavigate();
return (
<Box
sx={{
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
height: '100vh',
backgroundColor: '#f5f5f5',
textAlign: 'center',
}}
>
<Typography variant="h1" sx={{ fontSize: '8em', color: '#4a4a4a' }}>
404
</Typography>
<Typography variant="body1" sx={{ fontSize: '1.5em', color: '#4a4a4a' }}>
Oops! The page you're looking for doesn't exist.
</Typography>
<Link
href="/"
underline="none"
sx={{
color: '#4a4a4a',
fontSize: '1.2em',
borderBottom: '1px solid #4a4a4a',
paddingBottom: '2px',
transition: 'all 0.3s ease',
'&:hover': {
color: '#2e2e2e',
borderBottomColor: '#2e2e2e',
},
}}
onClick={(e) => {
e.preventDefault();
navigate('/');
}}
>
Go Home
</Link>
</Box>
);
};
export default NotFound;

View File

@ -1,20 +1,18 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Button, TextField, Box, Typography } from '@mui/material'; import { Button, TextField, Box, Typography } from '@mui/material';
import { useHistory } from 'react-router-dom';
import '../Login/Login.css'; // Import the CSS file import '../Login/Login.css'; // Import the CSS file
const Register = () => { const Register = () => {
const [username, setUsername] = useState(''); const [username, setUsername] = useState('');
const [password, setPassword] = useState(''); const [password, setPassword] = useState('');
const [email, setEmail] = useState(''); const [email, setEmail] = useState('');
const history = useHistory();
const handleRegister = (e) => { const handleRegister = (e) => {
e.preventDefault(); e.preventDefault();
// Implement your registration logic here // Implement your registration logic here
console.log('Registering user:', username, password, email); console.log('Registering user:', username, password, email);
// After successful registration, redirect to login or dashboard // After successful registration, redirect to login or dashboard
history.push('/login'); // history.push('/login');
}; };
return ( return (