Skip to content

Commit 04cec38

Browse files
authored
Merge pull request #321 from Nexters/fix/qa-1
fix: 사용자 코드 수정 대응 QA
2 parents c774c2b + dc75ba0 commit 04cec38

File tree

5 files changed

+15
-35
lines changed

5 files changed

+15
-35
lines changed

apps/admin/src/components/ShowCastInfoFormDialogContent/ShowCastInfoFormDialogContent.styles.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,6 @@ const TextFieldWrap = styled.div`
9494
}
9595
`;
9696

97-
const HashTag = styled.span`
98-
color: ${({ theme }) => theme.palette.grey.g90};
99-
line-height: 24px;
100-
padding-right: 4px;
101-
`;
102-
10397
const Input = styled.input`
10498
width: 100%;
10599
line-height: 24px;
@@ -247,7 +241,6 @@ export default {
247241
ShowInfoFormLabel,
248242
InputWrapper,
249243
Handle,
250-
HashTag,
251244
Input,
252245
Row,
253246
TrashCanButton,

apps/admin/src/components/ShowCastInfoFormDialogContent/ShowCastInfoMemberRow.tsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,19 @@ const ShowCastInfoMemberRow = forwardRef<HTMLDivElement, ShowCastInfoMemberRowPr
7575
</Styled.RemoveButton>
7676
</>
7777
) : (
78-
<>
79-
<Styled.HashTag>#</Styled.HashTag>
80-
<Styled.Input
81-
placeholder="ID"
82-
required
83-
onChange={(e) => {
84-
const nextValue = replaceUserCode(e.target.value);
85-
onChange(nextValue);
86-
}}
87-
onBlur={async (event) => {
88-
onBlur();
89-
onSetUser?.(event.target.value);
90-
}}
91-
value={value ?? ''}
92-
/>
93-
</>
78+
<Styled.Input
79+
placeholder="ID"
80+
required
81+
onChange={(e) => {
82+
const nextValue = replaceUserCode(e.target.value);
83+
onChange(nextValue);
84+
}}
85+
onBlur={async (event) => {
86+
onBlur();
87+
onSetUser?.(event.target.value);
88+
}}
89+
value={value ?? ''}
90+
/>
9491
)}
9592
</Styled.InputWrapper>
9693
{isError && <Styled.ErrorMessage>필수 입력사항입니다.</Styled.ErrorMessage>}

apps/admin/src/components/ShowSettingDialogContent/components/HostInputForm/HostInputForm.styles.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ const InputWrapper = styled.div<InputWrapperProps>`
3131
align-items: center;
3232
`;
3333

34-
const HashTag = styled.span`
35-
color: ${({ theme }) => theme.palette.grey.g90};
36-
line-height: 24px;
37-
padding-right: 4px;
38-
`;
39-
4034
const Input = styled.input<InputProps>`
4135
width: ${({ value }) => (value ? 'calc(100% - 80px)' : '100%')};
4236
line-height: 24px;
@@ -128,7 +122,6 @@ const InviteButton = styled(Button)`
128122
export default {
129123
Form,
130124
InputWrapper,
131-
HashTag,
132125
Input,
133126
Dropdown,
134127
DropdownList,

apps/admin/src/components/ShowSettingDialogContent/components/HostInputForm/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ const HostInputForm = ({ showId }: HostInputFormProps) => {
7272
return (
7373
<Styled.Form onSubmit={onSubmit}>
7474
<Styled.InputWrapper text={memberId}>
75-
<Styled.HashTag>#</Styled.HashTag>
7675
<Styled.Input
7776
placeholder="그룹원의 ID를 입력해 주세요"
7877
value={memberId}

apps/admin/src/utils/replace.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1+
// 20자 이내의 ID 생성 가능 (영어 소문자, 숫자, _ 사용 가능)
12
export const replaceUserCode = (text: string) => {
2-
return text
3-
.replace(/[^a-z0-9]/gi, '')
4-
.toUpperCase()
5-
.slice(0, 8);
3+
return text.replace(/[^a-z0-9_]/g, '').slice(0, 20);
64
};

0 commit comments

Comments
 (0)