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

[FEATURE] 공홈 어드민 홈 페이지 퍼블리싱 #128

Merged
merged 14 commits into from
Nov 20, 2024
Merged
3,770 changes: 1,898 additions & 1,872 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file removed .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const nextConfig = {
return config;
},
images: {
unoptimized: true,
remotePatterns: [
{
protocol: 'https',
Expand Down
Binary file added src/assets/img/latestNewsSample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/partIntroduceSample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/common/Layout/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export const StLayout = styled.div`
width: 100%;
padding: 88px 0 0 212px;
main {
max-width: 98rem;
width: 100%;
margin: 0 auto;

padding: 0px 49px 0px 124px;
}
}
`;
43 changes: 43 additions & 0 deletions src/components/org/OrgAdmin/home/ButtonSection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { TextField } from '@sopt-makers/ui';

import LiveAppliedButton from '@/components/org/OrgAdmin/home/LiveAppliedButton';
import {
StButtonFormContainer,
StContentContainer,
StFirstSectionContainer,
StTitle,
} from '@/components/org/OrgAdmin/home/style';

const ButtonSection = () => {
return (
<StFirstSectionContainer>
<StTitle>메인 버튼</StTitle>

<StContentContainer>
<StButtonFormContainer>
<TextField
labelText="문구"
placeholder="ex. 00기 YB 지원하기"
value={''}
/>
<TextField
labelText="키 컬러"
descriptionText="호버 시, 하이라이트는 키컬러로 보여요."
placeholder="ex. ffffff"
value={''}
/>
<TextField
labelText="서브 컬러"
descriptionText="호버하지 않았을 때, 버튼은 서브 컬러로 보여요."
placeholder="ex. ffffff"
value={''}
/>
</StButtonFormContainer>

<LiveAppliedButton keyColor="#3c92ff" subColor="#8fc0ff" />
</StContentContainer>
</StFirstSectionContainer>
);
};

export default ButtonSection;
18 changes: 18 additions & 0 deletions src/components/org/OrgAdmin/home/HomeSection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import ButtonSection from '@/components/org/OrgAdmin/home/ButtonSection';
import NewsSection from '@/components/org/OrgAdmin/home/NewsSection';
import PartIntroSection from '@/components/org/OrgAdmin/home/PartIntroSection';
import { StContainer, StWrapper } from '@/components/org/OrgAdmin/home/style';

const HomeSection = () => {
return (
<StContainer>
<StWrapper>
<ButtonSection />
<PartIntroSection />
</StWrapper>
<NewsSection />
</StContainer>
);
};

export default HomeSection;
81 changes: 81 additions & 0 deletions src/components/org/OrgAdmin/home/ImageInput.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import styled from '@emotion/styled';
import { colors } from '@sopt-makers/colors';
import { fontsObject } from '@sopt-makers/fonts';
import { HTMLAttributes } from 'react';
import { useFormContext } from 'react-hook-form';

import MyDropZone from '../MyDropzone';

interface ImageInputProps extends HTMLAttributes<HTMLInputElement> {
label?: string;
description?: string;
}

const ImageInput = ({ label, description }: ImageInputProps) => {
const method = useFormContext();

return (
<StInputContainer>
<StLabel aria-labelledby={label}>
{label}
<StRequiredIcon>*</StRequiredIcon>
</StLabel>
<StDescription>{description}</StDescription>

<MyDropZone
method={method}
label="newsImage"
width="167px"
height="211px"
/>
</StInputContainer>
);
};

export default ImageInput;

const StInputContainer = styled.div`
display: flex;
flex-direction: column;
gap: 8px;
`;

const StLabel = styled.p`
${fontsObject.LABEL_3_14_SB};
color: ${colors.white};
`;

const StRequiredIcon = styled.span`
color: ${colors.secondary};
margin-left: 4px;
`;

const StDescription = styled.p`
${fontsObject.LABEL_4_12_SB};
color: ${colors.gray300};

padding-bottom: 5px;
`;

const StImageLabel = styled.label`
display: flex;
justify-content: center;
align-items: center;

width: 167px;
height: 211px;

border-radius: 10px;
background-color: ${colors.gray800};

cursor: pointer;

& > svg {
width: 24px;
height: 24px;
}
`;

const StImageInput = styled.input`
display: none;
`;
106 changes: 106 additions & 0 deletions src/components/org/OrgAdmin/home/LiveAppliedButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import { keyframes } from '@emotion/react';
import styled from '@emotion/styled';
import { colors } from '@sopt-makers/colors';
import { fontsObject } from '@sopt-makers/fonts';

interface LiveAppliedButtonProps {
keyColor: string;
subColor: string;
}

const LiveAppliedButton = ({ keyColor, subColor }: LiveAppliedButtonProps) => {
return (
<StContainer>
<StExampleText>
<StExample>&lt;예시&gt;</StExample>
키컬러 #ffffff / 서브컬러 #ffffff
</StExampleText>
<StOrgButtonWrapper keyColor={keyColor} subColor={subColor}>
35기 YB 지원하기
</StOrgButtonWrapper>

<StList>
<StItem>
· 모집기간이 종료되면, &apos;모집 알림 신청하기&apos;로 문구를
변경해주세요.
</StItem>
<StItem>
· 버튼 설정 내용은 메인 페이지 상단, 하단 버튼 모두에 반영돼요.
</StItem>
</StList>
</StContainer>
);
};

export default LiveAppliedButton;

export const BackgroundMove = keyframes`
0% {
background-position: 0% 50%;
}
100% {
background-position: 100% 50%;
}
`;

export const StContainer = styled.div`
display: flex;
flex-direction: column;
gap: 14px;
`;

export const StExampleText = styled.p`
${fontsObject.BODY_3_14_M};
color: ${colors.gray200};
`;

export const StExample = styled.span`
${fontsObject.LABEL_3_14_SB};
color: ${colors.gray10};

padding-right: 10px;
`;

export const StOrgButtonWrapper = styled.button<{
keyColor: string;
subColor: string;
}>`
display: inline-flex;
justify-content: center;
align-items: center;
border-radius: 62.01px;

width: 176px;

background: linear-gradient(
274deg,
${(props) => props.keyColor},
${(props) => props.subColor},
${(props) => props.subColor}
);
background-size: 200% 200%;
animation: ${BackgroundMove} 1.8s ease-out infinite alternate;

padding: 9px 18px;

color: ${colors.gray800};
text-align: center;

${fontsObject.BODY_1_18_M};
font-size: 17.54px;
font-weight: 600;
line-height: 26.31px;

&:hover {
background: ${(props) => props.subColor};
}
`;

export const StList = styled.ul`
margin-top: 4px;
`;

export const StItem = styled.li`
${fontsObject.BODY_3_14_M};
color: ${colors.gray200};
`;
76 changes: 76 additions & 0 deletions src/components/org/OrgAdmin/home/Modal.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import styled from '@emotion/styled';
import { colors } from '@sopt-makers/colors';
import { fontsObject } from '@sopt-makers/fonts';
import { Button } from '@sopt-makers/ui';

export const StModalContainer = styled.div`
display: flex;
flex-direction: column;
gap: 12px;

padding: 24px;

& > h2 {
${fontsObject.TITLE_4_20_SB};
color: ${colors.gray10};
}

& > p {
${fontsObject.BODY_2_16_R};
color: ${colors.gray100};
}
`;

export const StModalBtnWrapper = styled.div`
place-self: end;

display: flex;
gap: 12px;

padding-top: 24px;
`;

export const StCancelButton = styled(Button)`
background-color: ${colors.gray600};
color: ${colors.white};

&:hover {
color: ${colors.black};
}
`;
wuzoo marked this conversation as resolved.
Show resolved Hide resolved

export const StActionButton = styled(Button)<{ btnType: 'add' | 'delete' }>`
color: ${(props) => (props.btnType === 'add' ? colors.black : colors.white)};

background-color: ${(props) =>
props.btnType === 'add' ? colors.white : colors.error};

&:disabled {
cursor: default;
}
`;

export const StAddButton = styled(Button)`
background-color: ${colors.white};
color: ${colors.black};
`;

export const StAddModalContainer = styled.div`
display: flex;
flex-direction: column;
gap: 36px;

width: 500px;

padding: 22px 32px 43px 32px;

background-color: ${colors.gray900};
border-radius: 12px;
`;

export const StAddModalBtnWrapper = styled.div`
place-self: end;

display: flex;
gap: 12px;
`;
Loading