Skip to content

Commit

Permalink
Merge branch 'dev' into aidanprior/credentialsToBackend
Browse files Browse the repository at this point in the history
# Conflicts:
#	client/src/App.tsx
#	client/src/components/Navbar.tsx
#	client/src/pages/Home.tsx
#	client/src/pages/Login.tsx
#	client/src/pages/Profile.tsx
#	client/src/types.ts
  • Loading branch information
aidanprior committed Oct 30, 2024
2 parents 19931a1 + 65b2f97 commit 8919474
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { UserDetails } from './types';

const App: React.FC = () => {
const [isDarkMode, setIsDarkMode] = useState(false); // Dark mode state
<<<<<<< HEAD
const [user, setUser] = useState<UserDetails | null>(null);
=======
const [user, setUser] = useState<Record<string, string> | null>(null);
>>>>>>> dev

const toggleDarkMode = () => {
setIsDarkMode((prev) => !prev);
Expand Down Expand Up @@ -66,6 +70,7 @@ const App: React.FC = () => {
checkLogin(<EventsDashboard isDarkMode={isDarkMode} />)
)}
/>
{/* </>} */}
</Routes>
</Router>
);
Expand Down
8 changes: 8 additions & 0 deletions client/src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@ import { useNavigate, Link } from 'react-router-dom';
import { UserDetails } from '../types';

const Login: React.FC<{
<<<<<<< HEAD
setUser: React.Dispatch<React.SetStateAction<UserDetails | null>>;
}> = ({ setUser }) => {
const [localUsername, setLocalUsername] = useState('');
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
=======
setUser: React.Dispatch<React.SetStateAction<Record<string, string> | null>>;
}> = ({ setUser }) => {
const [localUsername, setLocalUsername] = useState("");
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
>>>>>>> dev
const [error, setError] = useState<string | null>(null);
const navigate = useNavigate();

Expand Down
33 changes: 33 additions & 0 deletions client/src/pages/Profile.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
<<<<<<< HEAD
import { AWSCredentials, ProfileProps, UserDetails } from '../types';

const Profile: React.FC<ProfileProps> = ({ isDarkMode, user, setUser }) => {
Expand Down Expand Up @@ -37,6 +38,11 @@ const Profile: React.FC<ProfileProps> = ({ isDarkMode, user, setUser }) => {
console.error(error);
});
}
=======
import { ProfileProps } from "../types";

const Profile: React.FC<ProfileProps> = ({ isDarkMode, user }) => {
>>>>>>> dev

return (
<div className={`profile-container ${isDarkMode ? 'dark-mode' : ''}`}>
Expand All @@ -50,6 +56,7 @@ const Profile: React.FC<ProfileProps> = ({ isDarkMode, user, setUser }) => {
</div>
<div className="profile-info">
<div className="info-container">
<<<<<<< HEAD
<p>Username: {user?.username ?? 'Not Logged In'}</p>
</div>
<div className="info-container">
Expand All @@ -61,6 +68,22 @@ const Profile: React.FC<ProfileProps> = ({ isDarkMode, user, setUser }) => {
<div className="info-container">
<p>Work Phone: {user?.work_phone ?? 'Not Logged In'}</p>
</div>
=======
<p>Username: {user?.username ?? "Not Logged In"}</p>
</div>
<div className="info-container">
<p>Display Name: {user?.display_name ?? "Not Logged In"}</p>
</div>
<div className="info-container">
<p>Work Email: {user?.work_email ?? "Not Logged In"}</p>
</div>
<div className="info-container">
<p>Work Phone: {user?.work_phone ?? "Not Logged In"}</p>
</div>
{/* <div className="info-container">
<p>Company: {user.company}</p>
</div> */}
>>>>>>> dev
<img
className="aws-logo"
src="https://a0.awsstatic.com/libra-css/images/logos/aws_logo_smile_1200x630.png"
Expand All @@ -80,6 +103,7 @@ const Profile: React.FC<ProfileProps> = ({ isDarkMode, user, setUser }) => {
<label htmlFor="region">Enter Region</label>
<input type="text" id="region" name="region" />
</div>
<<<<<<< HEAD
<button className="submit-button" onClick={handleCredentialSubmit}>
Submit
</button>
Expand All @@ -89,10 +113,19 @@ const Profile: React.FC<ProfileProps> = ({ isDarkMode, user, setUser }) => {
target="_blank"
rel="noopener noreferrer"
>
=======
<button className="submit-button">Submit</button>
{/* <button className="logout-button logout-button-styled" >Logout</button> */}
<a className="aws-login-button submit-button" href='https://aws.amazon.com' target="_blank" rel="noopener noreferrer">
>>>>>>> dev
AWS Log-in Information
</a>
</div>

<<<<<<< HEAD
=======

>>>>>>> dev
{/*}
<div className="right-container">
<div className="settings-section">
Expand Down

0 comments on commit 8919474

Please sign in to comment.