Skip to content

Commit bb266c1

Browse files
authored
Merge pull request #202 from mash-up-kr/release/v1.0.0
Main Release/v1.0.0
2 parents 06e70f4 + ca93dd1 commit bb266c1

File tree

28 files changed

+458
-197
lines changed

28 files changed

+458
-197
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @mango906 @dididy @minsour @Baek2back @HaJunRyu
1+
* @mango906 @minsour @Baek2back @HaJunRyu

.pnp.cjs

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
33 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
"@emotion/styled": "^11.6.0",
105105
"axios": "^0.26.0",
106106
"dayjs": "^1.10.7",
107+
"history": "^5.3.0",
107108
"lodash-es": "^4.17.21",
108109
"react": "^17.0.2",
109110
"react-dom": "^17.0.2",

src/components/ApplicationDetail/ApplicationPanel/ApplicationPanel.component.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,15 @@ interface ControlAreaProps {
4646
confirmationStatus: ApplicationConfirmationStatusKeyType;
4747
resultStatus: ApplicationResultStatusKeyType;
4848
interviewDate?: string;
49+
isLoading?: boolean;
4950
}
5051

51-
const ControlArea = ({ confirmationStatus, resultStatus, interviewDate }: ControlAreaProps) => {
52+
const ControlArea = ({
53+
confirmationStatus,
54+
resultStatus,
55+
interviewDate,
56+
isLoading = false,
57+
}: ControlAreaProps) => {
5258
const { setValue, getValues, watch, register } = useFormContext<FormValues>();
5359
const date = getValues('interviewStartedAt');
5460
const isEdit = watch('isEdit');
@@ -205,7 +211,13 @@ const ControlArea = ({ confirmationStatus, resultStatus, interviewDate }: Contro
205211
label="취소"
206212
onClick={handleToggleIsEdit}
207213
/>
208-
<Button type="submit" $size={ButtonSize.sm} shape={ButtonShape.primary} label="저장" />
214+
<Button
215+
type="submit"
216+
$size={ButtonSize.sm}
217+
shape={ButtonShape.primary}
218+
label="저장"
219+
isLoading={isLoading}
220+
/>
209221
</Styled.ButtonContainer>
210222
</>
211223
);
@@ -263,6 +275,7 @@ const ApplicationPanel = ({
263275
isEdit: false,
264276
},
265277
});
278+
const [isLoading, setIsLoading] = useState(false);
266279

267280
const { handleSubmit } = methods;
268281

@@ -299,6 +312,7 @@ const ApplicationPanel = ({
299312

300313
request({
301314
requestFunc: async () => {
315+
setIsLoading(true);
302316
await api.postUpdateResult(requestDto);
303317
},
304318
errorHandler: handleAddToast,
@@ -311,6 +325,7 @@ const ApplicationPanel = ({
311325
message: '성공적으로 합격 여부가 변경되었습니다.',
312326
});
313327
},
328+
onCompleted: () => setIsLoading(false),
314329
});
315330
},
316331
[],
@@ -329,6 +344,7 @@ const ApplicationPanel = ({
329344
confirmationStatus={confirmationStatus}
330345
resultStatus={resultStatus}
331346
interviewDate={interviewDate}
347+
isLoading={isLoading}
332348
{...restProps}
333349
/>
334350
</Styled.ApplicationStatusForm>

src/components/ApplicationDetail/MessageListPanel/MessageListPanel.component.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { useSetRecoilState } from 'recoil';
3+
import unescape from 'lodash-es/unescape';
34
import UserProfile, {
45
splitMemberPosition,
56
} from '@/components/common/UserProfile/UserProfile.component';
@@ -10,6 +11,7 @@ import { MemberPositionType, ApplicationResponse } from '@/types';
1011
import { $modalByStorage, ModalKey } from '@/store';
1112
import { formatDate } from '@/utils/date';
1213
import { SmsStatus, SmsStatusType } from '@/types/dto/sms';
14+
import { useConvertTextToLink } from '@/hooks';
1315

1416
export interface MessageInfoProps {
1517
notificationName?: string;
@@ -29,6 +31,7 @@ const MessageInfo = ({
2931
status,
3032
createdAt,
3133
}: MessageInfoProps) => {
34+
const convertedContent = useConvertTextToLink(unescape(notificationContent));
3235
return (
3336
<Styled.MessageInfoContainer>
3437
<Styled.Label status={status}>{SmsStatus[status]}</Styled.Label>
@@ -45,7 +48,7 @@ const MessageInfo = ({
4548
removePadding
4649
/>
4750
</TitleWithContent>
48-
<TitleWithContent title="발송내용">{notificationContent}</TitleWithContent>
51+
<TitleWithContent title="발송내용">{convertedContent}</TitleWithContent>
4952
</Styled.MessageInfoContainer>
5053
);
5154
};

src/components/ApplicationForm/ApplicationFormAside/ApplicationFormAside.component.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ interface ActionButton {
1313
type?: 'submit' | 'reset' | 'button';
1414
disabled?: boolean;
1515
onClick?: () => void;
16+
isLoading?: boolean;
1617
}
1718

1819
export interface ApplicationFormAsideProps {

src/components/ApplicationForm/ApplicationFormSection/ApplicationFormSection.component.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import React from 'react';
2-
import { useNavigate } from 'react-router-dom';
32
import { BackButton } from '@/components';
43
import * as Styled from './ApplicationFormSection.styled';
54
import { PATH } from '@/constants';
5+
import { useHistory } from '@/hooks';
66

77
interface ApplicationFormSectionProps {
88
headline: string;
99
}
1010

1111
const ApplicationFormSection = ({ headline }: ApplicationFormSectionProps) => {
12-
const navigate = useNavigate();
12+
const { handleGoBack } = useHistory();
1313

1414
return (
1515
<section>
16-
<BackButton label="목록 돌아가기" onClick={() => navigate(PATH.APPLICATION_FORM)} />
16+
<BackButton label="목록 돌아가기" onClick={() => handleGoBack(PATH.APPLICATION_FORM)} />
1717
<Styled.Headline>{headline}</Styled.Headline>
1818
</section>
1919
);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React from 'react';
2+
import { usePrompt } from '@/hooks';
3+
import { AlertModalDialog } from '..';
4+
5+
interface PromptProps {
6+
isBlocking?: boolean;
7+
}
8+
9+
const Blocker = ({ isBlocking = true }: PromptProps) => {
10+
const { showPrompt, confirmNavigation, cancelNavigation } = usePrompt(isBlocking);
11+
12+
if (!showPrompt) {
13+
return null;
14+
}
15+
16+
return (
17+
<AlertModalDialog
18+
heading="삭제하시겠습니까?"
19+
paragraph="작성 또는 수정하신 데이터가 삭제됩니다."
20+
cancelButtonLabel="취소"
21+
confirmButtonLabel="닫기"
22+
handleClickCancelButton={cancelNavigation}
23+
handleClickConfirmButton={confirmNavigation}
24+
/>
25+
);
26+
};
27+
28+
export default Blocker;

src/components/common/Button/Button.component.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,24 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
2626
shape?: ButtonShapeType;
2727
Icon?: (props: SVGProps<SVGElement>) => ReactElement;
2828
label?: string;
29+
isLoading?: boolean;
2930
}
3031

3132
export interface ParentRef {
3233
focus: () => void;
3334
}
3435

3536
const Button = (
36-
{ children, className, $size = 'sm', shape = 'default', Icon, label, ...resetProps }: ButtonProps,
37+
{
38+
children,
39+
className,
40+
$size = 'sm',
41+
shape = 'default',
42+
Icon,
43+
label,
44+
isLoading = false,
45+
...resetProps
46+
}: ButtonProps,
3747
parentRef: React.Ref<ParentRef>,
3848
) => {
3949
const childRef = useRef<HTMLButtonElement>(null);
@@ -55,11 +65,13 @@ const Button = (
5565
className={className}
5666
$size={$size}
5767
shape={shape}
68+
disabled={isLoading}
5869
{...resetProps}
5970
>
6071
{Icon && <Icon />}
6172
{shape !== ButtonShape.icon && label}
6273
{children}
74+
{isLoading && <Styled.Spinner />}
6375
</Styled.ButtonWrapper>
6476
);
6577
};

0 commit comments

Comments
 (0)