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

[SP2] 프로젝트 탭 피드 디자인 변경 #245

Merged
merged 15 commits into from
Oct 28, 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
2 changes: 1 addition & 1 deletion src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function Layout({
return <Main css={moreStyle}>{children}</Main>;
}

const Main = styled.div<{ moreStyle?: CSSProperties }>`
const Main = styled.div<{ moreStyle?: SerializedStyles }>`
display: flex;
flex-direction: column;
`;
4 changes: 2 additions & 2 deletions src/lib/api/remote/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const getProjectDetail = async (projectId: number): Promise<GetProjectDetailResp
const { data } = await client.get(`/projects/${projectId}`);
const dataServiceType = data.serviceType;

const serviceTypes = Array.isArray(dataServiceType) ? dataServiceType : [dataServiceType];
const serviceType = Array.isArray(dataServiceType) ? dataServiceType : [dataServiceType];

return { project: { ...data, serviceTypes } };
return { project: { ...data, serviceType } };
};

const getProjectList = async (
Expand Down
8 changes: 0 additions & 8 deletions src/lib/constants/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ export const projectCategoryLabel: Record<ProjectCategoryType, string> = {
[ProjectCategoryType.APPJAM]: '앱잼',
[ProjectCategoryType.SOPKATHON]: '솝커톤',
[ProjectCategoryType.SOPTERM]: '솝텀',
[ProjectCategoryType.STUDY]: '스터디',
[ProjectCategoryType.JOINTSEMINAR]: '합동 세미나',
[ProjectCategoryType.ETC]: '기타',
};

export const projectCategoryDescription: Record<ProjectCategoryType, string> = {
Expand All @@ -25,11 +22,6 @@ export const projectCategoryDescription: Record<ProjectCategoryType, string> = {
'무박 2일간의 해커톤을 통해 아이디어를 빠르게 프로덕트로 만들어보는 프로젝트, SOPKATHON',
[ProjectCategoryType.SOPTERM]:
'4개월간의 장기 협업을 통해 한 개의 온전한 프로덕트를 만드는 프로젝트, SOPT-TERM',
[ProjectCategoryType.STUDY]:
'2개월간 지식 공유를 진행하며 아이디어를 시각화 하거나 프로덕트로 만들어보는 프로젝트, 스터디',
[ProjectCategoryType.JOINTSEMINAR]:
'기획, 디자인, 개발 파트가 배운 내용을 통해 간단한 아이디어를 시각화 해보는 프로젝트, 합동 세미나',
[ProjectCategoryType.ETC]: '',
};

export const activeProjectPlatformList: ProjectPlatformType[] = [
Expand Down
5 changes: 1 addition & 4 deletions src/lib/types/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ export enum ProjectCategoryType {
APPJAM = 'APPJAM',
SOPKATHON = 'SOPKATHON',
SOPTERM = 'SOPTERM',
STUDY = 'STUDY',
JOINTSEMINAR = 'JOINTSEMINAR',
ETC = 'ETC',
}

export enum LinkType {
Expand Down Expand Up @@ -47,7 +44,7 @@ export interface ProjectType {
thumbnailImage?: string;
members: ProjectMemberType[];
name: string;
serviceTypes: string[];
serviceType: string[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 array 형태라서 s 붙는게 좋아보이는데 s가 없어진 이유가 무엇인가요..?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API 리스펀스랑 맞추는 게 좋을 거 같아서 없앴습니다! 그리고 serviceType이 프로젝트 페이지와 프로젝트 디테일 페이지에서 사용되고 있는데 프로젝트 페이지에서는 리스펀스 값을 받을 때 serviceTypes로 받아주지 않아서 여태까지 웹인지 앱인지가 안나오고 있었어요!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오ㅓ 그런 에러가 있었군요.......... 발견해주셔서 정말 감사해여....

startAt: string;
endAt: string;
summary: string;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/project/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function ProjectDetailPage({ project }: GetProjectDetailResponse) {
name,
summary,
generation,
serviceTypes,
serviceType,
startAt,
endAt,
isFounding,
Expand Down Expand Up @@ -87,7 +87,7 @@ function ProjectDetailPage({ project }: GetProjectDetailResponse) {
</span>
<span>{generation ? generation + '기' : '-'}</span>
<span>
{serviceTypes
{serviceType
.map((type: string) => (type === 'WEB' ? '웹' : '앱'))
.join(', ')}
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/views/ProjectPage/ProjectPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
projectPlatformLabel,
} from '@src/lib/constants/project';
import { ProjectCategoryType, ProjectPlatformType } from '@src/lib/types/project';
import { ProjectList } from './components';
import { ProjectList } from '@src/views/ProjectPage/components/project/ProjectList';
import RecentProjectList from './components/RecentProjectList';
import useFetch from './hooks/useFetch';
import S from './styles';
Expand Down
1 change: 0 additions & 1 deletion src/views/ProjectPage/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './common/EmptyContent';
export * from './common/OvalSpinner';
export * from './project';
183 changes: 0 additions & 183 deletions src/views/ProjectPage/components/project/ProjectCard.tsx

This file was deleted.

50 changes: 50 additions & 0 deletions src/views/ProjectPage/components/project/ProjectCard/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { track } from '@amplitude/analytics-browser';
import { useIsMobile } from '@src/hooks/useDevice';
import { ProjectType } from '@src/lib/types/project';
import * as S from './style';

export default function ProjectCard({ project }: { project: ProjectType }) {
const isMobile = useIsMobile('899px');

return (
<S.ProjectCard href={`/project/${project.id}`} onClick={() => track('click_project_detail')}>
{!isMobile && (
<S.ProjectThumbnail
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모바일일 때랑 모바일이 아닐 때랑 구조가 다른 이유는 무엇인가요..??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모바일일 때는 프로젝트 목록이 리스트 형태로 바뀌는데 썸네일이 제목같은 텍스트들과 같은 라인에 있어서요!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇군요.!! 그렇담 조아요~~~~~

나중에 모바일과 데탑에서 달라지는 요소가 추가되면, grid-temlate-area 등도 사용해보면 좋을 것 가타요!! ((이미 알고 있으실 것 같슴당))

src={project.thumbnailImage ?? project.logoImage}
alt="프로젝트 썸네일"
width={324}
height={192}
loading="lazy"
placeholder="blur"
blurDataURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mPU0zOtBwACNQES9P3nGQAAAABJRU5ErkJggg=="
/>
)}
<S.ProjectContent>
<S.ProjectHeader>
{isMobile && (
<S.ProjectThumbnail
src={project.logoImage}
alt="프로젝트 로고"
width={40}
height={40}
loading="lazy"
placeholder="blur"
blurDataURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mPU0zOtBwACNQES9P3nGQAAAABJRU5ErkJggg=="
/>
)}
<S.ProjectText>
<S.ProjectTitle>{project.name}</S.ProjectTitle>
{project.serviceType.map((type, index) => (
<S.ProjectType key={type}>
<span>{type}</span>
{project.serviceType.length - 1 !== index && <S.Divider>∙</S.Divider>}
</S.ProjectType>
))}
</S.ProjectText>
</S.ProjectHeader>
<S.ProjectSummary>{project.summary}</S.ProjectSummary>
</S.ProjectContent>
{/* TODO: 서비스 이용 가능 및 창업 정보와 멤버 정보 추가 필요 */}
</S.ProjectCard>
);
}
Loading
Loading