From b18376b489188120b8b70ebcdf95d83e0ed6b23d Mon Sep 17 00:00:00 2001 From: sean Date: Mon, 15 Jul 2024 23:54:34 +0900 Subject: [PATCH 1/2] refactor/#28/Convention Refactor --- src/app/login/LoginPage.tsx | 2 +- src/component/common/appBar/{index.tsx => AppBar.tsx} | 0 src/component/common/appBar/index.ts | 1 + src/component/common/typography/{index.tsx => Typography.tsx} | 0 src/component/common/typography/index.ts | 1 + .../login/{loginSpriteSvg/index.tsx => LoginSpriteSvg.tsx} | 0 .../{socialLoginButton/index.tsx => SocialLoginButton.tsx} | 3 ++- src/component/login/index.ts | 1 + 8 files changed, 6 insertions(+), 2 deletions(-) rename src/component/common/appBar/{index.tsx => AppBar.tsx} (100%) create mode 100644 src/component/common/appBar/index.ts rename src/component/common/typography/{index.tsx => Typography.tsx} (100%) create mode 100644 src/component/common/typography/index.ts rename src/component/login/{loginSpriteSvg/index.tsx => LoginSpriteSvg.tsx} (100%) rename src/component/login/{socialLoginButton/index.tsx => SocialLoginButton.tsx} (92%) create mode 100644 src/component/login/index.ts diff --git a/src/app/login/LoginPage.tsx b/src/app/login/LoginPage.tsx index 62b24ee4..520d7882 100644 --- a/src/app/login/LoginPage.tsx +++ b/src/app/login/LoginPage.tsx @@ -1,4 +1,4 @@ -import { SocialLoginButton } from "@/component/login/socialLoginButton"; +import { SocialLoginButton } from "@/component/login"; import { DefaultLayout } from "@/layout/DefaultLayout"; export function LoginPage() { diff --git a/src/component/common/appBar/index.tsx b/src/component/common/appBar/AppBar.tsx similarity index 100% rename from src/component/common/appBar/index.tsx rename to src/component/common/appBar/AppBar.tsx diff --git a/src/component/common/appBar/index.ts b/src/component/common/appBar/index.ts new file mode 100644 index 00000000..c3bbf372 --- /dev/null +++ b/src/component/common/appBar/index.ts @@ -0,0 +1 @@ +export { AppBar } from "./AppBar"; diff --git a/src/component/common/typography/index.tsx b/src/component/common/typography/Typography.tsx similarity index 100% rename from src/component/common/typography/index.tsx rename to src/component/common/typography/Typography.tsx diff --git a/src/component/common/typography/index.ts b/src/component/common/typography/index.ts new file mode 100644 index 00000000..7c1e31a8 --- /dev/null +++ b/src/component/common/typography/index.ts @@ -0,0 +1 @@ +export { Typography } from "./Typography"; diff --git a/src/component/login/loginSpriteSvg/index.tsx b/src/component/login/LoginSpriteSvg.tsx similarity index 100% rename from src/component/login/loginSpriteSvg/index.tsx rename to src/component/login/LoginSpriteSvg.tsx diff --git a/src/component/login/socialLoginButton/index.tsx b/src/component/login/SocialLoginButton.tsx similarity index 92% rename from src/component/login/socialLoginButton/index.tsx rename to src/component/login/SocialLoginButton.tsx index 36058a80..3df78251 100644 --- a/src/component/login/socialLoginButton/index.tsx +++ b/src/component/login/SocialLoginButton.tsx @@ -1,6 +1,7 @@ import { css } from "@emotion/react"; -import { LoginSpriteSvg } from "@/component/login/loginSpriteSvg"; +import { LoginSpriteSvg } from "./LoginSpriteSvg"; + import { loginTypeProvider, loginBtnProps, backgroundColors } from "@/types/loginType"; export function SocialLoginButton({ type, handler }: loginBtnProps) { diff --git a/src/component/login/index.ts b/src/component/login/index.ts new file mode 100644 index 00000000..b8e7ae22 --- /dev/null +++ b/src/component/login/index.ts @@ -0,0 +1 @@ +export { SocialLoginButton } from "./SocialLoginButton"; From 485e7d505708c7c8b6c15a73040e1e8b56d503cd Mon Sep 17 00:00:00 2001 From: sean Date: Tue, 16 Jul 2024 00:08:36 +0900 Subject: [PATCH 2/2] refactor/#28/Convention Refactor --- src/component/common/appBar/index.ts | 1 + src/layout/DefaultLayout.tsx | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/component/common/appBar/index.ts b/src/component/common/appBar/index.ts index c3bbf372..9ac924ce 100644 --- a/src/component/common/appBar/index.ts +++ b/src/component/common/appBar/index.ts @@ -1 +1,2 @@ export { AppBar } from "./AppBar"; +export type { AppBarProps } from "./AppBar"; diff --git a/src/layout/DefaultLayout.tsx b/src/layout/DefaultLayout.tsx index 70f16906..fd183be9 100644 --- a/src/layout/DefaultLayout.tsx +++ b/src/layout/DefaultLayout.tsx @@ -1,9 +1,10 @@ import { css } from "@emotion/react"; -import { Fragment, PropsWithChildren } from "react"; +import { Fragment, ReactNode } from "react"; import { AppBar, AppBarProps } from "@/component/common/appBar"; -type DefaultLayoutProps = PropsWithChildren & { +type DefaultLayoutProps = AppBarProps & { appBarVisible?: boolean; + children: ReactNode; }; export function DefaultLayout({ children, title, appBarVisible = true, LeftComp, RightComp }: DefaultLayoutProps) {