-
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.
- Loading branch information
Showing
8 changed files
with
122 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
push: | ||
branches: | ||
- main | ||
- refactor/academics | ||
- feat/search | ||
|
||
jobs: | ||
build: | ||
|
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,55 @@ | ||
import { Link } from '@/navigation'; | ||
|
||
import RangeBolded from '@/components/common/RangeBolded'; | ||
|
||
import { AboutPreview } from '@/types/search'; | ||
|
||
import { getPath } from '@/utils/page'; | ||
import { | ||
contact, | ||
directions, | ||
facilities, | ||
futureCareers, | ||
greetings, | ||
history, | ||
overview, | ||
studentClubs, | ||
} from '@/utils/segmentNode'; | ||
|
||
import OrangeCircle from './OrangeCircle'; | ||
|
||
export default function AboutRow({ preview }: { preview: AboutPreview }) { | ||
const node = postTypeToNode(preview.aboutPostType); | ||
|
||
return ( | ||
<Link className="group flex flex-col gap-1" href={getPath(node)}> | ||
<div className="flex items-center gap-2"> | ||
<OrangeCircle /> | ||
<h3 className="text-base font-semibold">{node.name}</h3> | ||
</div> | ||
<RangeBolded {...preview} /> | ||
<p className="text-md text-main-orange group-hover:underline">{`소개 > ${node.name}`}</p> | ||
</Link> | ||
); | ||
} | ||
|
||
const postTypeToNode = (postType: AboutPreview['aboutPostType']) => { | ||
switch (postType) { | ||
case 'OVERVIEW': | ||
return overview; | ||
case 'GREETINGS': | ||
return greetings; | ||
case 'HISTORY': | ||
return history; | ||
case 'FUTURE_CAREERS': | ||
return futureCareers; | ||
case 'STUDENT_CLUBS': | ||
return studentClubs; | ||
case 'FACILITIES': | ||
return facilities; | ||
case 'CONTACT': | ||
return contact; | ||
case 'DIRECTIONS': | ||
return directions; | ||
} | ||
}; |
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,3 @@ | ||
export default function OrangeCircle() { | ||
return <div className="h-[.625rem] w-[.625rem] rounded-full border border-main-orange" />; | ||
} |
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,17 @@ | ||
export default function RangeBolded({ | ||
partialDescription, | ||
boldStartIndex, | ||
boldEndIndex, | ||
}: { | ||
partialDescription: string; | ||
boldStartIndex: number; | ||
boldEndIndex: number; | ||
}) { | ||
return ( | ||
<p className="line-clamp-1 text-md font-normal text-neutral-700"> | ||
{partialDescription.slice(0, boldStartIndex)} | ||
<span className="font-bold">{partialDescription.slice(boldStartIndex, boldEndIndex)}</span> | ||
{partialDescription.slice(boldEndIndex)} | ||
</p> | ||
); | ||
} |
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