-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from EveryUniv/fix/95(백수연)
fix: ID, 비밀번호 찾기 이슈 및 Suspense 추가
- Loading branch information
Showing
69 changed files
with
1,427 additions
and
1,223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,45 @@ | ||
import ErrorBoundary from '@components/common/errorBoundary'; | ||
import Error from '@components/errorFallback'; | ||
import ModalProvider from '@components/ui/modal/modal-provider'; | ||
import { Spinner } from '@components/ui/spinner/indext'; | ||
import { Toaster } from '@components/ui/toast/toaster'; | ||
import { useResetError } from '@hooks/useResetErrorBoundary'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
import React from 'react'; | ||
import React, { Suspense, lazy } from 'react'; | ||
import { BrowserRouter } from 'react-router-dom'; | ||
|
||
import Router from './Router'; | ||
import Router from '@/Router'; | ||
const DefaultLayout = lazy(() => import('@components/layouts/DefaultLayout')); | ||
|
||
|
||
const queryClient = new QueryClient({ | ||
defaultOptions: { | ||
queries: { | ||
retry: 0, | ||
refetchOnWindowFocus: false, | ||
throwOnError: true, | ||
throwOnError: true, | ||
}, | ||
}, | ||
}); | ||
|
||
export default function App() { | ||
const App = () => { | ||
const { handleErrorReset } = useResetError(); | ||
return ( | ||
<QueryClientProvider client={queryClient}> | ||
<ModalProvider> | ||
<Toaster /> | ||
<BrowserRouter> | ||
<Router /> | ||
<ErrorBoundary onReset={handleErrorReset} Fallback={Error}> | ||
<Suspense fallback={<Spinner />}> | ||
<DefaultLayout> | ||
<Router /> | ||
</DefaultLayout> | ||
</Suspense> | ||
</ErrorBoundary> | ||
</BrowserRouter> | ||
</ModalProvider> | ||
</QueryClientProvider> | ||
); | ||
} | ||
}; | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import Board from '@components/ui/board'; | ||
import IntersectionBox from '@components/ui/box/intersectionBox'; | ||
import ItemList from '@components/ui/item-list'; | ||
import { Spinner } from '@components/ui/spinner/indext'; | ||
import { ROUTES } from '@constants/route'; | ||
import { CoalitionContentResponse, useGetCoalitionList } from '@hooks/api/coalition/useGetCoalitionList'; | ||
import { useInfiniteScroll } from '@hooks/useInfiniteScroll'; | ||
import React, { useEffect } from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { CoalitionType } from '@/types/coalition'; | ||
|
||
export default function BusinessList({categoryType}: {categoryType: string}) { | ||
const navigate = useNavigate(); | ||
|
||
const { | ||
data: coalition, | ||
refetch, | ||
fetchNextPage, | ||
isFetchingNextPage, | ||
} = useGetCoalitionList(categoryType as CoalitionType); | ||
const intersectionRef = useInfiniteScroll(fetchNextPage); | ||
|
||
useEffect(() => { | ||
refetch(); | ||
}, [categoryType, refetch]); | ||
|
||
|
||
const goToBusinessDetail = (item: CoalitionContentResponse) => { | ||
navigate(ROUTES.BUSINESS.DETAIL(categoryType.toLowerCase() as string, item.id.toString()), { | ||
state: item, | ||
}); | ||
}; | ||
|
||
return ( | ||
<Board> | ||
{coalition?.pages.map((page) => | ||
page.content.map((item) => ( | ||
<Board.Cell key={item.id} onClick={() => goToBusinessDetail(item)}> | ||
<ItemList content={item} /> | ||
</Board.Cell> | ||
)), | ||
)} | ||
<IntersectionBox ref={intersectionRef} /> | ||
{isFetchingNextPage && <Spinner />} | ||
</Board> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
import Selector, { TOption } from '@components/ui/selector'; | ||
import React from 'react'; | ||
|
||
interface GnhProps { | ||
headingText: string; | ||
subHeadingText?: string; | ||
subHeadingStyle: string; | ||
headingStyle: string; | ||
dropDown?: TOption[]; | ||
} | ||
const GnhTitle = ({ children, className }: React.ComponentProps<'h1'>) => { | ||
return ( | ||
<h1 className={`${className ?? ''} text-2xl font-extrabold text-white`}>{children}</h1> | ||
); | ||
}; | ||
|
||
const GnhSubtitle = ({ children, className }: React.ComponentProps<'h2'>) => { | ||
return ( | ||
<h2 className={`${className ?? ''} text-white`}>{children}</h2> | ||
); | ||
}; | ||
|
||
|
||
export { GnhTitle, GnhSubtitle }; | ||
|
||
const Gnh = ({ headingText, subHeadingText, headingStyle, subHeadingStyle, dropDown }: GnhProps) => ( | ||
<React.Fragment> | ||
{headingText && <h1 className={`${headingStyle} text-2xl font-extrabold text-white`}>{headingText}</h1>} | ||
{dropDown !== undefined && dropDown.length > 0 && subHeadingText ? ( | ||
<Selector list={dropDown} subHeadingText={subHeadingText} /> | ||
) : ( | ||
<h2 className={`${subHeadingStyle} text-white`}>{subHeadingText}</h2> | ||
)} | ||
</React.Fragment> | ||
); | ||
export default Gnh; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Board from '@components/ui/board'; | ||
import IntersectionBox from '@components/ui/box/intersectionBox'; | ||
import { Spinner } from '@components/ui/spinner/indext'; | ||
import { Date } from '@components/ui/text/board'; | ||
import { useGetConference } from '@hooks/api/conference/useGetConference'; | ||
import { ConferenceContentResponse } from '@hooks/api/conference/useGetConference'; | ||
import { useInfiniteScroll } from '@hooks/useInfiniteScroll'; | ||
import React from 'react'; | ||
|
||
export default function ConferenceList() { | ||
const { data: conference, fetchNextPage, isFetchingNextPage } = useGetConference(); | ||
const intersectionRef = useInfiniteScroll(fetchNextPage); | ||
|
||
const openFile = (item: ConferenceContentResponse) => { | ||
window.open(item.files[0].url); | ||
}; | ||
return ( | ||
<Board> | ||
{conference?.pages.map((page) => | ||
page.content.map((item) => ( | ||
<Board.Cell key={item.id} onClick={() => openFile(item)}> | ||
<div className='flex gap-2 p-3'> | ||
<p className='grow text-center truncate'>{item.title}</p> | ||
<Date date={item.createdAt} /> | ||
</div> | ||
</Board.Cell> | ||
)), | ||
)} | ||
<IntersectionBox ref={intersectionRef} /> | ||
{isFetchingNextPage && <Spinner />} | ||
</Board> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Nav from '@components/common/nav'; | ||
import { AnimatePresence } from 'framer-motion'; | ||
import React from 'react'; | ||
|
||
interface ContentSectionProps extends React.ComponentProps<'div'> { | ||
showNav?: boolean; | ||
} | ||
|
||
const ContentSection = ({ children, className, showNav, ...props }: ContentSectionProps) => { | ||
return ( | ||
<div className={`rounded-t-3xl pt-4 flex flex-col bg-white ${className ?? ''} | ||
${showNav ? 'mb-20' : ''}`} {...props}> | ||
{children} | ||
{showNav && ( | ||
<AnimatePresence> | ||
<Nav /> | ||
</AnimatePresence> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ContentSection; |
Oops, something went wrong.