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] 프로젝트 페이지 디테일한 디자인 수정 2 #252

Merged
merged 3 commits into from
Nov 6, 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/common/Carousel/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Arrow = styled.div<{ type: CarouselArrowType }>`
background-color: ${colors.gray600};
color: white;
z-index: 2;
top: 50%;
top: calc(50% - 16px);
transform: translateY(-50%);
cursor: pointer;
background-repeat: no-repeat;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function Select<T extends LabelKeyType>({
onClick={toggleSelect}
isSelectionExist={selectedValue !== baseValue}
isOpened={isOpen}
selectedValue={selectedValue}
isWide={labels[selectedValue].length >= 5}
>
{selectedValue === baseValue ? baseLabel : labels[selectedValue]}
</S.SelectTrigger>
Expand Down
7 changes: 3 additions & 4 deletions src/components/common/Select/style.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import styled from '@emotion/styled';
import { colors } from '@sopt-makers/colors';
import arrowDown from '@src/assets/icons/arrow_down.svg';
import { LabelKeyType } from '@src/lib/types/universal';

const SelectWrapper = styled.div`
position: relative;
Expand All @@ -10,11 +9,11 @@ const SelectWrapper = styled.div`
const SelectTrigger = styled.button<{
isSelectionExist: boolean;
isOpened: boolean;
selectedValue: LabelKeyType;
isWide: boolean;
Comment on lines -13 to +12
Copy link
Member Author

Choose a reason for hiding this comment

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

요 방식은 앞으로 길게 써야할 경우가 추가되면 관리하기 어려워질 것 같아서 프롭 성격을 살짝 변경했습니다!!
(@f0rever0 참고해 주셔요..!)

Copy link
Contributor

Choose a reason for hiding this comment

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

확인했습니다! 5 글자수를 넘어가면 width 가 넓어지도록 한거죠?!

Copy link
Member Author

Choose a reason for hiding this comment

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

옙 맞습니다!!

}>`
cursor: pointer;
position: relative;
width: ${({ selectedValue }) => (selectedValue === 'ANDROID' ? '132px' : '110px')};
width: ${({ isWide }) => (isWide ? '132px' : '110px')};
font-size: 16px;
font-weight: 500;
padding: 9px ${({ isSelectionExist }) => (isSelectionExist ? '16px' : '22px')};
Expand All @@ -40,7 +39,7 @@ const SelectTrigger = styled.button<{
}
@media (max-width: 899px) {
padding: 8px 12px;
border-radius: 16px;
border-radius: 99px;
font-size: 13px;
line-height: 150%;
letter-spacing: -0.13px;
Expand Down
4 changes: 3 additions & 1 deletion src/views/ProjectPage/ProjectPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { css } from '@emotion/react';
import { useState } from 'react';
import PageLayout from '@src/components/common/PageLayout';
import Select from '@src/components/common/Select';
import { useIsMobile } from '@src/hooks/useDevice';
import {
activeProjectCategoryList,
activeProjectPlatformList,
Expand All @@ -19,6 +20,7 @@ function Projects() {
const [selectedPlatform, setPlatform] = useState<ProjectPlatformType>(ProjectPlatformType.ALL);

const state = useFetch(selectedCategory, selectedPlatform);
const isMobile = useIsMobile('899px');

return (
<PageLayout
Expand All @@ -31,7 +33,7 @@ function Projects() {
<S.ContentWrapper>
<RecentProjectList />
<S.Spacing />
<S.SectionTitle>SOPT에서 진행된 프로젝트 둘러보기</S.SectionTitle>
<S.SectionTitle>SOPT{!isMobile && '에서 진행된'} 프로젝트 둘러보기</S.SectionTitle>
<S.FilterWrapper>
<Select
options={activeProjectCategoryList}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useDeviceType, useIsDesktop, useIsMobile } from '@src/hooks/useDevice';
import { CarouselArrowType, CarouselOverflowType } from '@src/lib/types/universal';

export default function RecentProjectListCarousel({ children }: { children: JSX.Element[] }) {
const isDesktopSize = useIsDesktop('1920px');
const isDesktopSize = useIsDesktop('1280px');
const isMobileSize = useIsMobile('899px');
const deviceType = useDeviceType();

Expand All @@ -14,7 +14,7 @@ export default function RecentProjectListCarousel({ children }: { children: JSX.
return (
<Carousel
stride={isDesktopSize ? 2 : 1}
itemWidth={isMobileSize ? 345 : 588}
itemWidth={isMobileSize ? 345 : 544}
leftArrowType={arrowType}
rightArrowType={arrowType}
overflowType={overflowType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import icArrowStickRight from '@src/assets/icons/ic_arrow_stick_right.svg';
import { textSingularLineEllipsis } from '@src/lib/styles/textEllipsis';

const GridWrapper = styled.div`
width: 568px;
width: 524px;
display: grid;
grid-template-areas: 'img detail' 'img footer';
grid-template-columns: 116px auto;
column-gap: 16px;
background-color: ${colors.gray800};
background-color: ${colors.gray900};
border-radius: 12px;
padding: 24px;
margin-right: 20px;
Expand All @@ -21,6 +21,8 @@ const GridWrapper = styled.div`
grid-template-areas: 'img detail' 'footer footer';
grid-template-columns: 48px auto;
column-gap: 10px;
row-gap: 16px;
padding: 16px;
}
`;

Expand Down
6 changes: 6 additions & 0 deletions src/views/ProjectPage/components/RecentProjectList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ export default function RecentProjectList() {
return (
<>
<S.SectionTitle>최근 출시한 프로젝트</S.SectionTitle>
<S.PlaygroundLinkWrapper>
<span>SOPT에서 출시한 프로젝트가 있으신가요?</span>
<S.PlaygroundLink href="https://playground.sopt.org" target="_blank">
릴리즈 소식 알리기
</S.PlaygroundLink>
</S.PlaygroundLinkWrapper>
<RecentProjectListCarousel>
{state.data.slice(0, 6).map((d) => (
<RecentProjectListItem key={d.id} {...d} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { track } from '@amplitude/analytics-browser';
import { useIsMobile } from '@src/hooks/useDevice';
import { useMediaQuery } from 'react-responsive';
import { ProjectType } from '@src/lib/types/project';
import * as S from './style';

export default function ProjectCard({ project }: { project: ProjectType }) {
const isMobile = useIsMobile('899px');
const isMobile = useMediaQuery({ query: '(max-width: 899px)' });
Copy link
Member Author

Choose a reason for hiding this comment

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

제가 git 실수로 이 커밋을 흡수해 버렸습니다 .........
정말 미안해요 ㅜㅜㅜㅜ @solar3070
원래 PR에 로컬 브랜치에 있는 기존 커밋을 올려 주신다면 정말 감사하겠습니다!!!!


return (
<S.ProjectCard href={`/project/${project.id}`} onClick={() => track('click_project_detail')}>
Expand Down
43 changes: 42 additions & 1 deletion src/views/ProjectPage/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const Root = styled.div`
align-items: center;
min-height: 100vh;
margin: 0 auto;
width: 100vw;
overflow-x: hidden;
`;

const ContentWrapper = styled.div`
Expand Down Expand Up @@ -61,5 +63,44 @@ const FilterWrapper = styled.div`
}
`;

const S = { SectionTitle, Root, ContentWrapper, Spacing, FilterWrapper };
const PlaygroundLinkWrapper = styled.div`
@media (max-width: 899px) {
display: none;
}
color: ${colors.gray400};
/* Body/2_Medium_16 */
font-family: SUIT;
font-size: 16px;
font-style: normal;
font-weight: 500;
line-height: 165%; /* 26.4px */
letter-spacing: -0.24px;
margin-top: -44px;
margin-bottom: 28px;
display: flex;
gap: 4px;
`;

const PlaygroundLink = styled.a`
position: relative;
&::after {
content: '';
position: absolute;
width: 100%;
height: 1px;
background-color: ${colors.gray400};
left: 0;
bottom: 4px;
}
`;

const S = {
SectionTitle,
Root,
ContentWrapper,
Spacing,
FilterWrapper,
PlaygroundLinkWrapper,
PlaygroundLink,
};
export default S;
Loading