File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed
apps/pyconkr/src/debug/page/shop_component
packages/shop/src/components Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ const ShopProductItem: React.FC<{
160160 < Stack spacing = { 2 } >
161161 { product . option_groups . map ( ( group ) => (
162162 < Shop . Components . OptionGroupInput
163+ key = { group . id }
163164 optionGroup = { group }
164165 options = { group . options }
165166 defaultValue = { group ?. options [ 0 ] ?. id || "" }
Original file line number Diff line number Diff line change 11import * as React from "react" ;
22
3- import { Typography } from "@mui/material" ;
3+ import { CircularProgress , Typography } from "@mui/material" ;
4+ import { ErrorBoundary , Suspense } from "@suspensive/react" ;
45
56import ShopHooks from "../hooks" ;
67
7- export const ShopSignInGuard : React . FC < {
8+ type ShopSignInGuardProps = {
89 children : React . ReactNode ;
910 fallback ?: React . ReactNode ;
10- } > = ( { children, fallback } ) => {
11+ } ;
12+
13+ const InnerShopSignInGuard : React . FC < ShopSignInGuardProps > = ( { children, fallback } ) => {
1114 const { data } = ShopHooks . useUserStatus ( ) ;
12- const renderedFallback = fallback || (
13- < Typography variant = "h6" gutterBottom >
14- 로그인 후 이용해주세요.
15- </ Typography >
16- ) ;
17- return data && data . meta . is_authenticated === true
18- ? children
19- : renderedFallback ;
15+ const renderedFallback = fallback || < Typography variant = "h6" gutterBottom > 로그인 후 이용해주세요.</ Typography > ;
16+ return data ?. meta ?. is_authenticated === true ? children : renderedFallback ;
17+ } ;
18+
19+ export const ShopSignInGuard : React . FC < ShopSignInGuardProps > = ( { children, fallback } ) => {
20+ return < ErrorBoundary fallback = { < > 로그인 정보를 불러오는 중 문제가 발생했습니다.</ > } >
21+ < Suspense fallback = { < CircularProgress /> } >
22+ < InnerShopSignInGuard fallback = { fallback } > { children } </ InnerShopSignInGuard >
23+ </ Suspense >
24+ </ ErrorBoundary >
2025} ;
You can’t perform that action at this time.
0 commit comments