-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34ee6a7
commit c420902
Showing
19 changed files
with
421 additions
and
16 deletions.
There are no files selected for viewing
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
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,20 @@ | ||
'use client'; | ||
import { UserExperience } from '@/components/profile/UserExperience'; | ||
import APP_PATHS from '@/config/path.config'; | ||
import { useSession } from 'next-auth/react'; | ||
import { useRouter } from 'next/navigation'; | ||
import React, { useEffect } from 'react'; | ||
|
||
export default function AccountExperiencePage() { | ||
const router = useRouter(); | ||
const session = useSession(); | ||
useEffect(() => { | ||
if (session.status !== 'loading' && session.status === 'unauthenticated') | ||
router.push(`${APP_PATHS.SIGNIN}?redirectTo=/profile`); | ||
}, [session.status, router]); | ||
return ( | ||
<div> | ||
<UserExperience /> | ||
</div> | ||
); | ||
} |
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,20 @@ | ||
'use client'; | ||
import { UserProjects } from '@/components/profile/UserProject'; | ||
import APP_PATHS from '@/config/path.config'; | ||
import { useSession } from 'next-auth/react'; | ||
import { useRouter } from 'next/navigation'; | ||
import React, { useEffect } from 'react'; | ||
|
||
export default function AccountProjectPage() { | ||
const router = useRouter(); | ||
const session = useSession(); | ||
useEffect(() => { | ||
if (session.status !== 'loading' && session.status === 'unauthenticated') | ||
router.push(`${APP_PATHS.SIGNIN}?redirectTo=/profile`); | ||
}, [session.status, router]); | ||
return ( | ||
<div className="overflow-x-hidden"> | ||
<UserProjects /> | ||
</div> | ||
); | ||
} |
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,20 @@ | ||
'use client'; | ||
import { UserResume } from '@/components/profile/UserResume'; | ||
import APP_PATHS from '@/config/path.config'; | ||
import { useSession } from 'next-auth/react'; | ||
import { useRouter } from 'next/navigation'; | ||
import React, { useEffect } from 'react'; | ||
|
||
export default function AccountResumePage() { | ||
const router = useRouter(); | ||
const session = useSession(); | ||
useEffect(() => { | ||
if (session.status !== 'loading' && session.status === 'unauthenticated') | ||
router.push(`${APP_PATHS.SIGNIN}?redirectTo=/profile`); | ||
}, [session.status, router]); | ||
return ( | ||
<div className="m-auto"> | ||
<UserResume /> | ||
</div> | ||
); | ||
} |
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,20 @@ | ||
'use client'; | ||
import { UserSkills } from '@/components/profile/UserSkills'; | ||
import APP_PATHS from '@/config/path.config'; | ||
import { useSession } from 'next-auth/react'; | ||
import { useRouter } from 'next/navigation'; | ||
import React, { useEffect } from 'react'; | ||
|
||
export default function AccountResumePage() { | ||
const router = useRouter(); | ||
const session = useSession(); | ||
useEffect(() => { | ||
if (session.status !== 'loading' && session.status === 'unauthenticated') | ||
router.push(`${APP_PATHS.SIGNIN}?redirectTo=/profile`); | ||
}, [session.status, router]); | ||
return ( | ||
<div> | ||
<UserSkills /> | ||
</div> | ||
); | ||
} |
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,86 @@ | ||
import { getUserExperience } from '@/actions/user.profile.actions'; | ||
import { useEffect, useState } from 'react'; | ||
import { useToast } from '../ui/use-toast'; | ||
import { Experience } from '@prisma/client'; | ||
import { Card, CardContent, CardHeader, CardTitle } from '../ui/card'; | ||
import _ from 'lodash'; | ||
|
||
export function UserExperience() { | ||
const { toast } = useToast(); | ||
const [experiences, setExperiences] = useState<Experience[] | undefined>(); | ||
|
||
useEffect(() => { | ||
async function fetchExperience() { | ||
try { | ||
const res = await getUserExperience(); | ||
if (!res.status) { | ||
toast({ | ||
title: 'Cannot Fetch Experiences! Please Try Again Later', | ||
variant: 'destructive', | ||
}); | ||
} | ||
if (res.status) { | ||
setExperiences(res.additional); | ||
} | ||
} catch (_error) { | ||
toast({ | ||
title: 'Cannot Fetch Experiences! Please Try Again Later', | ||
variant: 'destructive', | ||
}); | ||
} | ||
} | ||
|
||
fetchExperience(); | ||
}, []); | ||
|
||
if (!experiences) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className="space-y-2 mb-2"> | ||
{experiences.map((item: Experience) => ( | ||
<Card | ||
key={item.id} | ||
className="border-2 hover:bg-slate-100 dark:hover:bg-slate-900 text-black dark:text-white transition-shadow duration-300" | ||
> | ||
<CardHeader> | ||
<CardTitle className="text-lg font-semibold"> | ||
<strong>Company Name: </strong> | ||
{item.companyName} | ||
</CardTitle> | ||
</CardHeader> | ||
<CardContent> | ||
<p className="mb-2"> | ||
<strong>Designation:</strong> {item.designation} | ||
</p> | ||
<p className="mb-2"> | ||
<strong>Employment Type:</strong>{' '} | ||
{_.startCase(item.EmploymentType)} | ||
</p> | ||
<p className="mb-2"> | ||
<strong>Work Mode:</strong> {item.workMode} | ||
</p> | ||
<p className="mb-2"> | ||
<strong>Current Status:</strong>{' '} | ||
{item.currentWorkStatus | ||
? 'Currently Employed here' | ||
: 'Not Currently Employed here'} | ||
</p> | ||
<p className="mb-2"> | ||
<strong>Duration:</strong>{' '} | ||
{new Date(item.startDate).toLocaleDateString()}{' '} | ||
{item.endDate | ||
? ` - ${new Date(item.endDate).toLocaleDateString()}` | ||
: ' - Present'} | ||
</p> | ||
<p className="mb-4"> | ||
<strong>Description: </strong> | ||
{item.description} | ||
</p> | ||
</CardContent> | ||
</Card> | ||
))} | ||
</div> | ||
); | ||
} |
Oops, something went wrong.