Skip to content

Commit

Permalink
feat: dnd 11기 프로젝트 thumbnail, pdf 추가 (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
saseungmin authored Oct 20, 2024
1 parent 0c33c51 commit ab4c38a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 45 deletions.
18 changes: 8 additions & 10 deletions apps/web/src/components/organisms/ProjectCards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ function ProjectCards({ projects }: Props) {
flag, id, title, thumbnail, skill: skills, name,
}) => (
<Link key={id} className={styles.projectCardWrapper} href={`/projects/${id}`}>
{thumbnail && (
<Image
src={thumbnail}
alt={name}
width="0"
height="0"
sizes="(max-width: 1204px) 50vw, 33vw"
className={styles.thumbnail}
/>
)}
<Image
src={thumbnail}
alt={name}
width="0"
height="0"
sizes="(max-width: 1204px) 50vw, 33vw"
className={styles.thumbnail}
/>
<div className={styles.contents}>
<div className={styles.flag}>{flag}</div>
<div className={styles.name}>{name}</div>
Expand Down
7 changes: 0 additions & 7 deletions apps/web/src/components/organisms/ProjectsSlider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@ import Marquee from 'react-fast-marquee';
import Image from 'next/image';
import Link from 'next/link';

import { type Project } from '@dnd-academy/core';

import { getProjects } from '@/lib/apis/project';
import blurDataUrl from '@/lib/data/blurDataUrl';

import styles from './index.module.scss';

type ThumbnailProject = Project & {
thumbnail: string;
};

function ProjectsSlider() {
const projects = getProjects();

Expand All @@ -22,7 +16,6 @@ function ProjectsSlider() {
<Marquee pauseOnHover speed={100} className={styles.marquee}>
<div className={styles.projectSliderWrapper}>
{[...projects]
.filter((project): project is ThumbnailProject => Boolean(project?.thumbnail))
.slice(0, 20)
.map(({ id, thumbnail, title }) => (
<Link key={id} href={`/projects/${id}`} prefetch={false}>
Expand Down
33 changes: 17 additions & 16 deletions apps/web/src/components/pages/ProjectPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,20 @@ function ProjectPage({ project }: Props) {
/>
<div className={styles.projectPageContents}>
<section className={styles.projectDetail}>
{project?.pdf && (
{project?.pdf ? (
<div className={styles.pdfWrapper}>
<PDFViewer url={project.pdf} />
</div>
)}
{!project?.pdf && project?.thumbnail && (
<div className={styles.thumbnailWrapper}>
<Image
fill
src={project.thumbnail}
alt={project.name}
className={styles.thumbnail}
sizes="(max-width: 768px) 100vw, 768px"
/>
</div>
) : (
<div className={styles.thumbnailWrapper}>
<Image
fill
src={project.thumbnail}
alt={project.name}
className={styles.thumbnail}
sizes="(max-width: 768px) 100vw, 768px"
/>
</div>
)}
<div className={styles.projectIntroduceTitleWrapper}>
<div className={styles.header}>
Expand Down Expand Up @@ -111,10 +110,12 @@ function ProjectPage({ project }: Props) {
<div className={styles.description}>{project.desc}</div>
</div>
</section>
<section className={styles.projectSubSection}>
<h2>참가자</h2>
<ReviewList reviews={reviews} hasProjectLink={false} />
</section>
{reviews.length > 0 && (
<section className={styles.projectSubSection}>
<h2>참가자</h2>
<ReviewList reviews={reviews} hasProjectLink={false} />
</section>
)}
<section className={styles.projectSubSection}>
<h2>프로젝트 더보기</h2>
<ProjectCards
Expand Down
22 changes: 11 additions & 11 deletions apps/web/src/lib/assets/data/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -2038,8 +2038,8 @@
"Mockito",
"Git"
],
"thumbnail": "",
"pdf": "",
"thumbnail": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/images/project/11/1/1.png",
"pdf": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/files/project/11/1/1.pdf",
"projectLinks": {
"appStore": "",
"github": [
Expand Down Expand Up @@ -2081,8 +2081,8 @@
"Docker",
"Test Container"
],
"thumbnail": "",
"pdf": "",
"thumbnail": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/images/project/11/3/3.png",
"pdf": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/files/project/11/3/3.pdf",
"projectLinks": {
"appStore": "",
"github": [
Expand Down Expand Up @@ -2112,7 +2112,7 @@
"Figma",
"Blender"
],
"thumbnail": "",
"thumbnail": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/images/project/11/4/4.png",
"pdf": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/files/project/11/4/4.pdf",
"projectLinks": {
"appStore": "",
Expand Down Expand Up @@ -2150,8 +2150,8 @@
"GIthub Action",
"TailwindCSS"
],
"thumbnail": "",
"pdf": "",
"thumbnail": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/images/project/11/5/5.png",
"pdf": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/files/project/11/5/5.pdf",
"projectLinks": {
"appStore": "",
"github": [
Expand All @@ -2175,7 +2175,7 @@
"TanstackQuery",
"TailwindCss"
],
"thumbnail": "",
"thumbnail": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/images/project/11/6/6.png",
"pdf": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/files/project/11/6/6.pdf",
"projectLinks": {
"appStore": "",
Expand Down Expand Up @@ -2238,8 +2238,8 @@
"figma",
"c4d"
],
"thumbnail": "",
"pdf": "",
"thumbnail": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/images/project/11/9/9.png",
"pdf": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/files/project/11/9/9.pdf",
"projectLinks": {
"appStore": "",
"github": [
Expand Down Expand Up @@ -2289,7 +2289,7 @@
"Docker",
"Github Actions"
],
"thumbnail": "",
"thumbnail": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/images/project/11/10/10.png",
"pdf": "https://dnd-academy-v3.s3.ap-northeast-2.amazonaws.com/files/project/11/10/10.pdf",
"projectLinks": {
"appStore": "",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/@types/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface Project {
images?: string[];
flag: ProjectFlag;
skill: string[];
thumbnail?: string;
thumbnail: string;
pdf: string | null;
projectLinks: ProjectLinks;
}
Expand Down

0 comments on commit ab4c38a

Please sign in to comment.