-
Notifications
You must be signed in to change notification settings - Fork 2
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 #99 from SOPT-all/develop
merge to main
- Loading branch information
Showing
172 changed files
with
4,994 additions
and
235 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 |
---|---|---|
|
@@ -22,3 +22,4 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
.env |
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,13 +1,19 @@ | ||
import { Global, ThemeProvider } from '@emotion/react'; | ||
|
||
import Route from '@route/Route'; | ||
import GLOBALSTYLE from '@styles/global'; | ||
import Theme from '@styles/theme'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
const App = () => ( | ||
<ThemeProvider theme={Theme}> | ||
<Global styles={GLOBALSTYLE} /> | ||
<Route /> | ||
</ThemeProvider> | ||
<QueryClientProvider client={queryClient}> | ||
<ThemeProvider theme={Theme}> | ||
<Global styles={GLOBALSTYLE} /> | ||
<Route /> | ||
</ThemeProvider> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import axios from 'axios'; | ||
|
||
const instance = axios.create({ | ||
baseURL: import.meta.env.VITE_APP_BASE_URL, | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}); | ||
|
||
export default instance; |
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,29 @@ | ||
import instance from '@apis/instance'; | ||
|
||
interface ProductResponse { | ||
productId: number; | ||
productImage: string; | ||
detail: string; | ||
priceOriginal: number; | ||
percent: number; | ||
priceDiscount: number; | ||
isCoupon: boolean; | ||
categoryName: string; | ||
reviewCount: number; | ||
rating: number; | ||
} | ||
|
||
interface RelatedProductsResponse { | ||
success: boolean; | ||
data: { | ||
products: ProductResponse[]; | ||
}; | ||
error: string | null; | ||
} | ||
|
||
const fetchRelatedProducts = async (productId: number): Promise<ProductResponse[]> => { | ||
const response = await instance.get<RelatedProductsResponse>(`/api/products/${productId}/related`); | ||
return response.data.data.products; | ||
}; | ||
|
||
export default fetchRelatedProducts; |
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,12 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import fetchRelatedProducts from './getProduct'; | ||
|
||
const useRelatedProducts = (productId: number) => { | ||
return useQuery({ | ||
queryKey: ['relatedProducts', productId], | ||
queryFn: () => fetchRelatedProducts(productId), | ||
initialData: [], | ||
}); | ||
}; | ||
|
||
export default useRelatedProducts; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions
2
.../icons/ic_deliverstatus_1_complete_56.svg → ...s/icons/card_deliverstatus_1_complete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions
2
.../icons/ic_deliverstatus_2_complete_56.svg → ...s/icons/card_deliverstatus_2_complete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions
6
.../icons/ic_deliverstatus_3_complete_56.svg → ...s/icons/card_deliverstatus_3_complete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.