Skip to content

Commit f4eaf2b

Browse files
authored
Merge pull request #405 from Moadong/develop-fe
[release] v1.0.3
2 parents 312a425 + 0cff80b commit f4eaf2b

File tree

41 files changed

+962
-148
lines changed

Some content is hidden

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

41 files changed

+962
-148
lines changed

frontend/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ build-storybook.log
1616
*.csr
1717

1818
*storybook.log
19-
coverage/
19+
coverage/
20+
# Sentry Config File
21+
.env.sentry-build-plugin

frontend/package-lock.json

Lines changed: 527 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"description": "",
2222
"dependencies": {
2323
"@channel.io/channel-web-sdk-loader": "^2.0.0",
24+
"@sentry/react": "^9.18.0",
25+
"@sentry/webpack-plugin": "^3.4.0",
2426
"@tanstack/react-query": "^5.66.0",
2527
"date-fns": "^4.1.0",
2628
"dotenv-webpack": "^8.1.0",
133 KB
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

frontend/src/components/common/Button/Button.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import styled, { keyframes, css } from 'styled-components';
44
export interface ButtonProps {
55
width?: string;
66
children: React.ReactNode;
7-
onClick: () => void;
7+
type?: string;
8+
onClick?: () => void;
89
animated?: boolean;
910
}
1011

@@ -44,9 +45,10 @@ const Button = ({
4445
width,
4546
children,
4647
onClick,
48+
type,
4749
animated = false,
4850
}: ButtonProps) => (
49-
<StyledButton width={width} onClick={onClick} animated={animated}>
51+
<StyledButton width={width} onClick={onClick} animated={animated} type={type}>
5052
{children}
5153
</StyledButton>
5254
);

frontend/src/components/common/InputField/InputField.styles.ts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,32 @@ export const InputWrapper = styled.div`
1919
align-items: center;
2020
`;
2121

22-
export const Input = styled.input`
22+
export const Input = styled.input<{ hasError?: boolean }>`
2323
flex: 1;
2424
height: 45px;
2525
padding: 12px 80px 12px 18px;
26-
border: 1px solid #c5c5c5;
26+
border: 1px solid ${({ hasError }) => (hasError ? 'red' : '#c5c5c5')};
2727
border-radius: 6px;
2828
outline: none;
2929
font-size: 1.125rem;
3030
letter-spacing: 0;
31-
color: rgba(0, 0, 0, 0.5);
31+
color: rgba(0, 0, 0, 0.8);
3232
3333
&:focus {
34-
border-color: #007bff;
35-
box-shadow: 0 0 3px rgba(0, 123, 255, 0.5);
34+
border-color: ${({ hasError }) => (hasError ? 'red' : '#007bff')};
35+
box-shadow: 0 0 3px
36+
${({ hasError }) =>
37+
hasError ? 'rgba(255, 0, 0, 0.5)' : 'rgba(0, 123, 255, 0.5)'};
3638
}
3739
3840
${({ disabled }) =>
3941
disabled &&
4042
`
4143
background-color: rgba(0, 0, 0, 0.05);
4244
`}
45+
&::placeholder {
46+
color: rgba(0, 0, 0, 0.3);
47+
}
4348
`;
4449

4550
export const ClearButton = styled.button`
@@ -85,3 +90,15 @@ export const CharCount = styled.span`
8590
font-size: 12px;
8691
letter-spacing: -0.96px;
8792
`;
93+
94+
export const HelperText = styled.div`
95+
position: absolute;
96+
left: 0;
97+
top: 100%;
98+
font-size: 0.75rem;
99+
color: red;
100+
margin-top: 4px;
101+
pointer-events: none;
102+
white-space: nowrap;
103+
z-index: 1;
104+
`;

frontend/src/components/common/InputField/InputField.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ interface CustomInputProps {
1414
value?: string;
1515
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
1616
onClear?: () => void;
17+
isError?: boolean;
18+
helperText?: string;
1719
}
1820

1921
const InputField = ({
@@ -28,6 +30,8 @@ const InputField = ({
2830
value = '',
2931
onChange,
3032
onClear,
33+
isError,
34+
helperText,
3135
}: CustomInputProps) => {
3236
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
3337

@@ -64,6 +68,7 @@ const InputField = ({
6468
placeholder={placeholder}
6569
maxLength={maxLength}
6670
disabled={disabled}
71+
hasError={isError}
6772
/>
6873
{showClearButton && !disabled && (
6974
<Styled.ClearButton type='button' onClick={clearInput}>
@@ -81,6 +86,9 @@ const InputField = ({
8186
</Styled.CharCount>
8287
)}
8388
</Styled.InputWrapper>
89+
{isError && helperText && (
90+
<Styled.HelperText>{helperText}</Styled.HelperText>
91+
)}
8492
</Styled.InputContainer>
8593
);
8694
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import youtube_icon from '@/assets/images/icons/sns/youtube_icon.svg';
2+
import instagram_icon from '@/assets/images/icons/sns/instagram_icon.png';
3+
import x_icon from '@/assets/images/icons/sns/x_icon.svg';
4+
5+
export const SNS_CONFIG = {
6+
instagram: {
7+
label: '인스타그램',
8+
placeholder: 'https://www.instagram.com/id',
9+
regex: /^https:\/\/(www\.)?instagram\.com\/[A-Za-z0-9._%-]+\/?$/,
10+
icon: instagram_icon,
11+
},
12+
youtube: {
13+
label: '유튜브',
14+
placeholder: 'https://www.youtube.com/@id',
15+
regex: /^https:\/\/(www\.)?youtube\.com\/(channel\/|@)[A-Za-z0-9._%-]+\/?$/,
16+
icon: youtube_icon,
17+
},
18+
x: {
19+
label: 'X',
20+
placeholder: 'https://x.com/id',
21+
regex: /^https:\/\/(www\.)?x\.com\/[A-Za-z0-9._%-]+\/?$/,
22+
icon: x_icon,
23+
},
24+
} as const;

0 commit comments

Comments
 (0)