Skip to content

Commit

Permalink
Merge branch 'dev' into chore/#142-admin-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jhj2713 committed Aug 13, 2024
2 parents b5e22cb + a717859 commit 6297c03
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 62 deletions.
9 changes: 9 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://hybrid-jgs.shop/" />
<meta property="og:title" content="Hybrid-JGS" />
<meta property="og:description" content="캐스퍼 일렉트릭 출시 기념 이벤트" />
<meta property="og:site_name" content="Hybrid-JGS" />
<meta property="og:image" content="/assets/og-image.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<link rel="icon" href="/assets/favicon.ico" type="image/x-icon" />
<title>Hybrid-JGS</title>
</head>
<body>
Expand Down
108 changes: 54 additions & 54 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
{
"name": "client",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"class-variance-authority": "^0.7.0",
"dom-to-image": "^2.6.0",
"framer-motion": "^11.3.7",
"react": "^18.3.1",
"react-cookie": "^7.2.0",
"react-dom": "^18.3.1",
"react-error-boundary": "^4.0.13",
"react-router-dom": "^6.25.1",
"vite-plugin-svgr": "^4.2.0"
},
"devDependencies": {
"@chromatic-com/storybook": "^1.6.1",
"@storybook/addon-essentials": "^8.2.5",
"@storybook/addon-interactions": "^8.2.5",
"@storybook/addon-links": "^8.2.5",
"@storybook/addon-onboarding": "^8.2.5",
"@storybook/blocks": "^8.2.5",
"@storybook/react": "^8.2.5",
"@storybook/react-vite": "^8.2.5",
"@storybook/test": "^8.2.5",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.34.4",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"eslint-plugin-storybook": "^0.8.0",
"postcss": "^8.4.39",
"prettier": "^3.3.3",
"storybook": "^8.2.5",
"tailwindcss": "^3.4.6",
"typescript": "^5.2.2",
"vite": "^5.3.4"
}
"name": "client",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"class-variance-authority": "^0.7.0",
"dom-to-image": "^2.6.0",
"framer-motion": "^11.3.7",
"react": "^18.3.1",
"react-cookie": "^7.2.0",
"react-dom": "^18.3.1",
"react-error-boundary": "^4.0.13",
"react-router-dom": "^6.25.1",
"vite-plugin-svgr": "^4.2.0"
},
"devDependencies": {
"@chromatic-com/storybook": "^1.6.1",
"@storybook/addon-essentials": "^8.2.5",
"@storybook/addon-interactions": "^8.2.5",
"@storybook/addon-links": "^8.2.5",
"@storybook/addon-onboarding": "^8.2.5",
"@storybook/blocks": "^8.2.5",
"@storybook/react": "^8.2.5",
"@storybook/react-vite": "^8.2.5",
"@storybook/test": "^8.2.5",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.34.4",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"eslint-plugin-storybook": "^0.8.0",
"postcss": "^8.4.39",
"prettier": "^3.3.3",
"storybook": "^8.2.5",
"tailwindcss": "^3.4.6",
"typescript": "^5.2.2",
"vite": "^5.3.4"
}
}
Binary file added client/public/assets/favicon.ico
Binary file not shown.
Binary file added client/public/assets/og-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/src/constants/cookie.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const COOKIE_KEY = {
ACCESS_TOKEN: "token",
INVITE_USER: "referrerId",
INVITE_USER: "referralId",
} as const;
8 changes: 4 additions & 4 deletions client/src/features/CasperCustom/CasperCustomForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export function CasperCustomForm({ navigateNextStep }: CasperCustomFormProps) {
fetchData: postCasper,
} = useFetch<
PostCasperResponse,
{ token: string; referrerId: string; casper: CasperInformationType }
>(({ token, referrerId, casper }) =>
LotteryAPI.postCasper(token, { ...casper, [COOKIE_KEY.INVITE_USER]: referrerId })
{ token: string; referralId: string; casper: CasperInformationType }
>(({ token, referralId, casper }) =>
LotteryAPI.postCasper(token, { ...casper, [COOKIE_KEY.INVITE_USER]: referralId })
);

const { casperName, expectations, selectedCasperIdx } = useCasperCustomStateContext();
Expand Down Expand Up @@ -85,7 +85,7 @@ export function CasperCustomForm({ navigateNextStep }: CasperCustomFormProps) {

await postCasper({
token: cookies[COOKIE_KEY.ACCESS_TOKEN],
referrerId: cookies[COOKIE_KEY.INVITE_USER],
referralId: cookies[COOKIE_KEY.INVITE_USER],
casper,
});
};
Expand Down
3 changes: 3 additions & 0 deletions client/src/hooks/useFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export default function useFetch<T, P = void>(fetch: (params: P) => Promise<T>)
const { showBoundary } = useErrorBoundary();

const fetchData = async (params?: P) => {
setIsError(false);
setIsSuccess(false);

try {
const data = await fetch(params as P);
setData(data);
Expand Down
6 changes: 5 additions & 1 deletion client/src/pages/ErrorElement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ interface ErrorElementProps {
}

export default function ErrorElement({ fallbackUrl = "/" }: ErrorElementProps) {
const handleClickButton = () => {
window.location.href = fallbackUrl;
};

return (
<div className="fixed z-10 h-screen w-full bg-n-neutral-950 flex flex-col justify-center items-center">
<img alt="오류 아이콘" src="/assets/icons/casper-error.svg" />
Expand All @@ -13,7 +17,7 @@ export default function ErrorElement({ fallbackUrl = "/" }: ErrorElementProps) {
문제가 발생했습니다. 잠시 후 다시 시도해 보세요.
</h3>
<div className="mt-12" />
<CTAButton label="돌아가기" url={fallbackUrl} hasArrowIcon />
<CTAButton label="돌아가기" hasArrowIcon onClick={handleClickButton} />
</div>
);
}
20 changes: 18 additions & 2 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5974,7 +5974,16 @@ storybook@^8.2.5:
tiny-invariant "^1.3.1"
ts-dedent "^2.0.0"

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -6053,7 +6062,14 @@ string_decoder@^1.1.1:
dependencies:
safe-buffer "~5.2.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down

0 comments on commit 6297c03

Please sign in to comment.