Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ui #21

Merged
merged 4 commits into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions src/components/Dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
import { React } from 'react';
import Layout from './Layout.jsx';
import { AuthContext } from '../../context/AuthContext.jsx';
import { useContext } from 'react';
import Profile from '../Profile/Profile.jsx';
export default function Dashboard() {
const { userData } = useContext(AuthContext);

return (
<Layout>
<div className={'prose flex flex-col mx-auto container'}>
<h1 className={'mt-5 mx-auto'}>Profile</h1>
<h2>Id: {userData.id}</h2>
<h2>Role: {userData.role}</h2>
<h2>User: {userData.name}</h2>
<h2>Email: {userData.email}</h2>
{userData.role === 'User' ? (
<h3>Waiting for Admin to assign you your role</h3>
) : null}
</div>
<Profile />
</Layout>
);
}
5 changes: 3 additions & 2 deletions src/components/LeaveHistory/LeaveModify.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ function LeaveModify() {
setStartDate(la.startDate);
setEndDate(la.endDate);
setReason(la.reason);
setContactInfo(la.contactInfo || ''); // For not oversea leave, contactInfo may be null
setIsOverseas(la.isOverseas || false);
setContactInfo(la.contactInfo);
setIsOverseas(la.overseas);
setWorkDissemination(la.workDissemination);
} else {
console.error('Error fetching leave application:', response);
}
Expand Down