Skip to content

Commit b63d520

Browse files
authored
♻️ function 키워드는 화살표 함수로 변경 (#30)
* ♻️ function 키워드는 화살표 함수로 변경 * ✏️ 화살표 함수에서 => 누락한 부분 반영
1 parent 87a31f0 commit b63d520

9 files changed

Lines changed: 21 additions & 21 deletions

File tree

src/lib/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type ClassValue, clsx } from 'clsx';
22
import { twMerge } from 'tailwind-merge';
33

4-
export function cn(...inputs: ClassValue[]) {
4+
export const cn = (...inputs: ClassValue[]) => {
55
return twMerge(clsx(inputs));
6-
}
6+
};

src/main.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ if (rootElement === null) {
88
throw new Error('Root element not found');
99
}
1010

11-
async function enableMocking() {
11+
const enableMocking = async () => {
1212
if (import.meta.env.DEV) {
1313
const { worker } = await import('./mocks');
1414
return worker.start({ onUnhandledRequest: 'bypass' });
1515
}
16-
}
16+
};
1717

1818
enableMocking().then(() => {
1919
createRoot(rootElement!).render(

src/mocks/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export type MockRole = 'OWNER' | 'REVIEWER' | null;
22

3-
export function getRole(request: Request): MockRole {
3+
export const getRole = (request: Request): MockRole => {
44
const auth = request.headers.get('Authorization');
55
if (auth === 'Bearer mock-owner-token') {
66
return 'OWNER';
@@ -9,7 +9,7 @@ export function getRole(request: Request): MockRole {
99
return 'REVIEWER';
1010
}
1111
return null;
12-
}
12+
};
1313

1414
// 특수 케이스 트리거 값
1515
export const CLOSED_EVENT_ID = 'closed-event-001';

src/stories/sign-up-page.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ const VALID_NAME = '홍길동';
77
const VALID_EMAIL = 'test@example.com';
88
const VALID_CODE = '123456';
99

10-
async function completeEmailVerification(
10+
const completeEmailVerification = async (
1111
canvas: ReturnType<typeof within>,
1212
email = VALID_EMAIL
13-
) {
13+
) => {
1414
await userEvent.type(canvas.getByLabelText('이메일'), email);
1515
await userEvent.click(canvas.getByRole('button', { name: '인증 코드 발송' }));
1616
const codeInput = await canvas.findByLabelText('인증 코드');
@@ -19,7 +19,7 @@ async function completeEmailVerification(
1919
await expect(
2020
canvas.findByText('이메일 인증이 완료되었습니다.')
2121
).resolves.toBeInTheDocument();
22-
}
22+
};
2323

2424
const meta: Meta<typeof SignUpPage> = {
2525
title: 'Pages/SignUpPage',

src/stories/sign-up.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ const VALID_NAME = '홍길동';
88
const VALID_EMAIL = 'test@example.com';
99
const VALID_CODE = '123456';
1010

11-
async function completeEmailVerification(
11+
const completeEmailVerification = async (
1212
canvas: ReturnType<typeof within>,
1313
email = VALID_EMAIL
14-
) {
14+
) => {
1515
await userEvent.type(canvas.getByLabelText('이메일'), email);
1616
await userEvent.click(canvas.getByRole('button', { name: '인증 코드 발송' }));
1717
const codeInput = await canvas.findByLabelText('인증 코드');
@@ -20,7 +20,7 @@ async function completeEmailVerification(
2020
await expect(
2121
canvas.findByText('이메일 인증이 완료되었습니다.')
2222
).resolves.toBeInTheDocument();
23-
}
23+
};
2424

2525
const meta: Meta<typeof SignUpForm> = {
2626
title: 'Auth/SignUpForm',

src/widgets/auth/ui/password-input.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ type PasswordInputProps = {
1313
className?: string;
1414
};
1515

16-
export function PasswordInput({
16+
export const PasswordInput = ({
1717
id,
1818
value,
1919
onChange,
2020
placeholder,
2121
'aria-invalid': ariaInvalid,
2222
autoComplete,
2323
className,
24-
}: PasswordInputProps) {
24+
}: PasswordInputProps) => {
2525
const [show, setShow] = useState(false);
2626

2727
return (
@@ -46,4 +46,4 @@ export function PasswordInput({
4646
</button>
4747
</div>
4848
);
49-
}
49+
};

src/widgets/auth/ui/sign-in-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { Input } from '@/widgets/common/ui/input';
1717
import { Label } from '@/widgets/common/ui/label';
1818
import { Tabs, TabsList, TabsTrigger } from '@/widgets/common/ui/tabs';
1919

20-
export function SignInForm() {
20+
export const SignInForm = () => {
2121
const [role, setRole] = useState<UserRole>('REVIEWER');
2222
const [submitted, setSubmitted] = useState(false);
2323
const [responseMessage, setResponseMessage] = useState('');
@@ -125,4 +125,4 @@ export function SignInForm() {
125125
</CardContent>
126126
</Card>
127127
);
128-
}
128+
};

src/widgets/auth/ui/sign-up-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { Input } from '@/widgets/common/ui/input';
2323
import { Label } from '@/widgets/common/ui/label';
2424
import { Tabs, TabsList, TabsTrigger } from '@/widgets/common/ui/tabs';
2525

26-
export function SignUpForm() {
26+
export const SignUpForm = () => {
2727
const { toSignIn } = useRouteNavigation();
2828
const [role, setRole] = useState<UserRole>('REVIEWER');
2929
const [submitted, setSubmitted] = useState(false);
@@ -361,7 +361,7 @@ export function SignUpForm() {
361361
/>
362362
</>
363363
);
364-
}
364+
};
365365

366366
const RequirementItem = ({ label, met }: { label: string; met: boolean }) => {
367367
return (

src/widgets/common/ui/re-sign-in-modal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createPortal } from 'react-dom';
22
import { useRouteNavigation } from '@/feature/shared/routes/use-route-navigation';
33
import { Button } from './button';
44

5-
export function ReSignInModal() {
5+
export const ReSignInModal = () => {
66
const { toSignIn } = useRouteNavigation();
77

88
return createPortal(
@@ -26,4 +26,4 @@ export function ReSignInModal() {
2626
</div>,
2727
document.body
2828
);
29-
}
29+
};

0 commit comments

Comments
 (0)