Skip to content

Commit d2f70fc

Browse files
authored
Merge branch 'prod' into feat/bottom
2 parents 4dd0644 + 9c79c3e commit d2f70fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1825
-5363
lines changed

.eslintrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": [
33
"airbnb/hooks",
4-
"airbnb-typescript",
4+
"airbnb-typescript",
55
"eslint:recommended",
66
"plugin:react/recommended",
77
"plugin:prettier/recommended",
@@ -15,8 +15,8 @@
1515
"rules": {
1616
"react/react-in-jsx-scope": "off",
1717
"react/jsx-props-no-spreading": "off",
18-
"react/function-component-definition": "off",
1918
"react/prop-types": "off",
19+
"react/function-component-definition": "off",
2020
"import/no-extraneous-dependencies": "off",
2121
"import/extensions": "off",
2222
"linebreak-style": "off",

@types/sponsor.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export interface Sponsor {
66
managerTel: string;
77
managerEmail: string;
88
businessRegistrationNumber: string;
9-
logoImage: File | null;
10-
bankBookFile: File | null;
11-
businessRegistrationFile: File | null;
9+
logoImage: FileList | null;
10+
bankBookFile: FileList | null;
11+
businessRegistrationFile: FileList | null;
1212
}
1313

1414
export type SponsorInputInfo = Pick<

components/Portal.ts

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { css } from '@/stitches.config';
2+
import { useState, useLayoutEffect } from 'react';
3+
import { createPortal } from 'react-dom';
4+
5+
const portalStyle = css({
6+
position: 'fixed',
7+
top: 0,
8+
left: 0,
9+
height: '100%',
10+
width: '100%',
11+
backgroundColor: '$backgroundPrimary70',
12+
});
13+
14+
function ReactPortal({
15+
children,
16+
id = 'portal-wrapper',
17+
}: React.PropsWithChildren<{ id?: string }>) {
18+
const [wrapperElement, setWrapperElement] = useState<HTMLElement | null>(
19+
null
20+
);
21+
22+
useLayoutEffect(() => {
23+
let element = document.getElementById(id);
24+
let systemCreated = false;
25+
if (!element) {
26+
systemCreated = true;
27+
element = document.createElement('div');
28+
element.setAttribute('id', id);
29+
element.className = portalStyle();
30+
document.body.appendChild(element);
31+
}
32+
setWrapperElement(element);
33+
34+
return () => {
35+
if (systemCreated && element?.parentNode) {
36+
element.parentNode.removeChild(element);
37+
}
38+
};
39+
}, [id]);
40+
41+
if (wrapperElement === null) {
42+
return null;
43+
}
44+
45+
return createPortal(children, wrapperElement);
46+
}
47+
48+
export default ReactPortal;

components/common/Button.tsx

+18-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ export const StyledButton = styled('button', {
3939
width: '100%',
4040
},
4141
},
42+
reversal: {
43+
true: {
44+
color: '$backgroundPrimary',
45+
backgroundColor: '$textPrimary',
46+
},
47+
false: {
48+
color: '$textPrimary',
49+
backgroundColor: '$backgroundPrimary',
50+
},
51+
},
4252
},
4353
});
4454

@@ -62,17 +72,24 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6272
size?: 'small' | 'big' | 'flat';
6373
icon?: React.ReactNode;
6474
disabled?: boolean;
75+
reversal?: boolean;
6576
}
6677

6778
const Button = ({
6879
children,
6980
size = 'small',
7081
icon,
7182
disabled = false,
83+
reversal = false,
7284
...props
7385
}: ButtonProps) => {
7486
return (
75-
<StyledButton disabled={disabled} size={size} {...props}>
87+
<StyledButton
88+
disabled={disabled}
89+
size={size}
90+
reversal={reversal}
91+
{...props}
92+
>
7693
{icon ? <IconBox>{icon}</IconBox> : null}
7794
{children}
7895
</StyledButton>

components/common/FileUpload/FileItem.tsx

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { CloseIcon, FileUploadIcon } from '@/public/icons';
1+
import {
2+
CloseIcon,
3+
ImageFileSubmitIcon,
4+
PdfFileSubmitIcon,
5+
} from '@/public/icons';
26
import { styled } from '@/stitches.config';
37

48
const FileItemWrapper = styled('li', {
@@ -30,7 +34,13 @@ const CloseButton = styled('button', {
3034
cursor: 'pointer',
3135
});
3236

33-
const StyledFileUploadIcon = styled(FileUploadIcon, {
37+
const StyledPdfFileSubmitIcon = styled(PdfFileSubmitIcon, {
38+
'& path': {
39+
fill: '$textPrimary',
40+
},
41+
});
42+
43+
const StyledImageFileSubmitIcon = styled(ImageFileSubmitIcon, {
3444
'& path': {
3545
fill: '$textPrimary',
3646
},
@@ -46,14 +56,20 @@ const StyledCloseIcon = styled(CloseIcon, {
4656

4757
interface FileItemProps {
4858
file: File;
59+
fileType: 'pdf' | 'image';
4960
onRemove: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
5061
}
5162

52-
export const FileItem = ({ file, onRemove }: FileItemProps) => {
63+
const fileTypeIcon = {
64+
pdf: <StyledPdfFileSubmitIcon />,
65+
image: <StyledImageFileSubmitIcon />,
66+
};
67+
68+
export const FileItem = ({ file, fileType, onRemove }: FileItemProps) => {
5369
return (
5470
<FileItemWrapper>
5571
<FileItemLeftGroup>
56-
<StyledFileUploadIcon />
72+
{fileTypeIcon[fileType]}
5773
<FileItemName>{file.name}</FileItemName>
5874
</FileItemLeftGroup>
5975
<CloseButton onClick={onRemove}>

components/common/FileUpload/FileUpload.tsx

+24-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { useCallback, useState } from 'react';
2-
import { FileUploadIcon } from '@/public/icons';
2+
import { ImageFileIcon, PdfFileIcon } from '@/public/icons';
33
import { FileItem } from '@/components/common/FileUpload/FileItem';
44
import { styled } from '@/stitches.config';
55

66
const StyledFileUpload = styled('div', {
77
width: '100%',
8-
height: '180px',
8+
height: '100px',
99
backgroundColor: '$backgroundPrimary',
1010
border: '2px solid $textPrimary',
1111
});
@@ -37,7 +37,16 @@ const FileItemLabel = styled('label', {
3737
padding: 24,
3838
});
3939

40-
const StyledFileUploadIcon = styled(FileUploadIcon, {
40+
const StyledPdfFileIcon = styled(PdfFileIcon, {
41+
width: '24px',
42+
height: '24px',
43+
44+
'& path': {
45+
fill: '$textPrimary',
46+
},
47+
});
48+
49+
const StyledImageFileIcon = styled(ImageFileIcon, {
4150
width: '24px',
4251
height: '24px',
4352

@@ -48,14 +57,21 @@ const StyledFileUploadIcon = styled(FileUploadIcon, {
4857

4958
interface FileUploadProps {
5059
labelText: string;
60+
fileType: 'pdf' | 'image';
5161
onFileUpload: (file: FileList) => void;
5262
}
5363

5464
type FileUploadType = React.InputHTMLAttributes<HTMLInputElement> &
5565
FileUploadProps;
5666

67+
const fileTypeList = {
68+
pdf: { icon: <StyledPdfFileIcon />, accept: '.pdf' },
69+
image: { icon: <StyledImageFileIcon />, accept: 'image/png, image/jpg' },
70+
};
71+
5772
export const FileUpload = ({
5873
labelText,
74+
fileType,
5975
onFileUpload,
6076
...props
6177
}: FileUploadType) => {
@@ -122,6 +138,9 @@ export const FileUpload = ({
122138
id={fileInputId}
123139
type="file"
124140
onChange={handleFileUpload}
141+
multiple
142+
accept={fileTypeList[fileType].accept}
143+
required
125144
{...props}
126145
/>
127146
{uploadedFiles?.length ? (
@@ -130,6 +149,7 @@ export const FileUpload = ({
130149
<FileItem
131150
key={file.name}
132151
file={file}
152+
fileType={fileType}
133153
onRemove={(e) => handleFileRemove(e, index)}
134154
/>
135155
))}
@@ -140,7 +160,7 @@ export const FileUpload = ({
140160
onDragOver={stopSyntheticEvent}
141161
onDrop={handleDrop}
142162
>
143-
<StyledFileUploadIcon />
163+
{fileTypeList[fileType].icon}
144164
{labelText}
145165
</FileUploadLabel>
146166
)}

components/heading.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import { styled } from '@/stitches.config';
22

33
export const H1 = styled('h1', {
4-
fontSize: '58px',
5-
lineHeight: '68px',
6-
fontWeight: 'bold',
4+
'@bp1': {
5+
fontSize: '48px',
6+
lineHeight: '58px',
7+
},
8+
'@bp2': {
9+
fontSize: '58px',
10+
lineHeight: '68px',
11+
fontWeight: 'bold',
12+
},
713
});
814

915
export const H2 = styled('h2', {
@@ -21,5 +27,5 @@ export const H3 = styled('h3', {
2127
export const H4 = styled('h4', {
2228
fontSize: '24px',
2329
lineHeight: '36px',
24-
fontWeight: 'bold',
30+
fontWeight: '500',
2531
});

components/layout/Container.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ import NavBar from './NavBar';
33

44
const ContainerBody = styled('div', {
55
width: '100%',
6+
height: '100%',
67
});
78

89
const Main = styled('main', {
910
width: '100%',
1011
height: '100%',
1112
display: 'flex',
1213
flexDirection: 'column',
13-
justifyContent: 'center',
14+
justifyContent: 'flex-start',
1415
alignItems: 'center',
16+
backgroundColor: '$backgroundPrimary',
1517

1618
'@bp1': {},
1719
'@bp2': {},
@@ -21,6 +23,7 @@ const Main = styled('main', {
2123

2224
const Wrapper = styled('div', {
2325
width: '100%',
26+
height: '100%',
2427
marginTop: '80px',
2528
});
2629

components/layout/NavBar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const StyledNavArea = styled('div', {
2222
gap: 0,
2323
},
2424
'@bp2': {
25-
padding: '24px 80px',
25+
padding: '1rem 2rem',
2626
},
2727
});
2828

@@ -128,7 +128,7 @@ const NavBar = () => {
128128
return (
129129
<StyledNavArea>
130130
<Link href={Routes.HOME.route} passHref>
131-
<Logo width={230} />
131+
<Logo width={230} height={'100%'} />
132132
<Title>{Routes.HOME.title}</Title>
133133
</Link>
134134
<StyledMenuBox>

components/layout/SeoHeader.tsx

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import Head from 'next/head';
2+
import { PropsWithChildren } from 'react';
3+
4+
type HeaderProps = {
5+
title?: string;
6+
description?: string;
7+
};
8+
9+
const SeoHeader = ({
10+
title,
11+
description,
12+
children,
13+
}: PropsWithChildren<HeaderProps>) => {
14+
return (
15+
<Head>
16+
<title>{title || '파이콘 한국 2023'}</title>
17+
<meta
18+
name="description"
19+
content={description || '파이콘 한국 2023 홈페이지'}
20+
/>
21+
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
22+
{/* TODO:추후 dg 태그 추가하기 */}
23+
<link rel="icon" href="/favicon.ico" />
24+
{children}
25+
</Head>
26+
);
27+
};
28+
29+
export default SeoHeader;

0 commit comments

Comments
 (0)