generated from theodorusclarence/ts-nextjs-tailwind-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: restructure; add Desktop structure
- Loading branch information
1 parent
8ccd871
commit 84d4a23
Showing
14 changed files
with
178 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const workSection = ['job', 'language', 'publication', 'school', 'skill']; | ||
const sharedSection = ['shortText', 'skillIcon']; | ||
|
||
export const customStructure = (S) => | ||
S.list() | ||
.title('Content') | ||
.items([ | ||
S.listItem() | ||
.title('Work') | ||
.child( | ||
S.list() | ||
.title('Work Documents') | ||
.items( | ||
workSection.map((section) => S.documentTypeListItem(section)) | ||
) | ||
), | ||
S.listItem() | ||
.title('Shared') | ||
.child( | ||
S.list() | ||
.title('Shared Documents') | ||
.items( | ||
sharedSection.map((section) => S.documentTypeListItem(section)) | ||
) | ||
), | ||
]); |
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
File renamed without changes.
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,126 @@ | ||
'use client'; | ||
|
||
import { PortableText } from '@portabletext/react'; | ||
import Image from 'next/image'; | ||
import * as React from 'react'; | ||
|
||
import { School } from '@/types/School'; | ||
|
||
export interface EducationProps { | ||
schools: School[]; | ||
} | ||
|
||
const Education = ({ schools }: EducationProps) => { | ||
return ( | ||
<div className=''> | ||
<div className='m-2 flex'> | ||
<h2>Education</h2> | ||
</div> | ||
|
||
<div> | ||
{schools.map((school) => ( | ||
<div | ||
key={school._id} | ||
className='mb-4 rounded-md p-4 shadow-md dark:bg-slate-900' | ||
> | ||
{/* Start School Header - Desktop */} | ||
<div className='hidden border-b-2 border-slate-200 pb-2 md:flex'> | ||
<Image | ||
className='me-3 rounded-sm' | ||
src={school.schoolIcon} | ||
alt={school.schoolName} | ||
width={60} | ||
height={60} | ||
/> | ||
|
||
<div className='flex w-full justify-between'> | ||
<div className='flex flex-col'> | ||
<div className='flex flex-row'> | ||
<h4 className='me-4'> | ||
<a href={school.degreeUrl}>{school.schoolName}</a> | ||
</h4> | ||
|
||
<Image | ||
src={school.flagUrl} | ||
alt={school.schoolName} | ||
width={28} | ||
height={28} | ||
/> | ||
</div> | ||
|
||
<h5 className='font-medium'>{school.degreeName}</h5> | ||
</div> | ||
|
||
<div className='flex'> | ||
<div className='me-20 flex flex-col justify-center'> | ||
<span className='text-lg font-semibold'> | ||
{school.grade} | ||
</span> | ||
</div> | ||
|
||
<div className='flex flex-col justify-center'> | ||
<span className='text-lg font-semibold'> | ||
{school.startYear} — {school.endYear} | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{/* End School Header - Desktop */} | ||
|
||
{/* Start School Header - Mobile */} | ||
<div className='flex flex-col border-b-2 border-slate-200 pb-2 md:hidden'> | ||
<div className='flex'> | ||
<Image | ||
className='me-3 rounded-sm' | ||
src={school.schoolIcon} | ||
alt={school.schoolName} | ||
width={60} | ||
height={60} | ||
/> | ||
|
||
<div className='flex w-full justify-between'> | ||
<div className='flex flex-col'> | ||
<div className='flex flex-row justify-between'> | ||
<h4 className='me-4'> | ||
<a href={school.degreeUrl}>{school.schoolName}</a> | ||
</h4> | ||
|
||
<Image | ||
src={school.flagUrl} | ||
alt={school.schoolName} | ||
width={20} | ||
height={20} | ||
/> | ||
</div> | ||
|
||
<h5 className='font-medium'>{school.degreeName}</h5> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div className='-mt-1 flex flex-row justify-end'> | ||
<span className='me-8 text-sm font-normal'>{school.grade}</span> | ||
|
||
<span className='text-sm font-normal'> | ||
{school.startYear} — {school.endYear} | ||
</span> | ||
</div> | ||
</div> | ||
{/* End School Header - Mobile */} | ||
|
||
{/* Start School Content */} | ||
<div className='job-content pt-4'> | ||
<div className='sm-skill-description md:skill-description pb-2 text-justify font-light'> | ||
<PortableText value={school.description} /> | ||
</div> | ||
</div> | ||
{/* End School Content */} | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Education; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export interface SkillIcon { | ||
export interface Icon { | ||
_id: string; | ||
title: string; | ||
url: string; | ||
|
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { TypedObject } from '@portabletext/types'; | ||
|
||
import { SkillIcon } from '@/types/SkillIcon'; | ||
import { Icon } from '@/types/Icon'; | ||
|
||
export interface Skill { | ||
name: string; | ||
title: string; | ||
description: TypedObject; | ||
icons: SkillIcon[]; | ||
icons: Icon[]; | ||
} |