-
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 branch 'dev' of https://github.com/CoolPeace-yanolza/frontend i…
…nto feature/#62
- Loading branch information
Showing
56 changed files
with
1,167 additions
and
209 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { FallbackProps } from 'react-error-boundary'; | ||
import styled from '@emotion/styled'; | ||
|
||
const ErrorFallback = ({ resetErrorBoundary }: FallbackProps) => { | ||
return ( | ||
<Container> | ||
<span>App 전체 에러 발생</span> | ||
<button onClick={resetErrorBoundary}>다시 시도</button> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default ErrorFallback; | ||
|
||
const Container = styled.div` | ||
width: 100vw; | ||
min-width: 100vw; | ||
height: 100vh; | ||
max-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 10px; | ||
`; |
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,112 @@ | ||
import styled from '@emotion/styled'; | ||
import Skeleton from 'react-loading-skeleton'; | ||
import 'react-loading-skeleton/dist/skeleton.css'; | ||
|
||
import theme from '@styles/theme'; | ||
|
||
const Loading = () => { | ||
return ( | ||
<Container> | ||
<Sidebar /> | ||
<Section> | ||
<Header /> | ||
<OutletLayout /> | ||
</Section> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default Loading; | ||
|
||
const BaseSkeleton = styled(Skeleton)` | ||
width: 100%; | ||
border-radius: 16px; | ||
background-color: #f2f4f5; | ||
`; | ||
|
||
const Container = styled.div` | ||
position: relative; | ||
width: 100vw; | ||
min-width: 100vw; | ||
height: 100vh; | ||
max-height: 100vh; | ||
display: flex; | ||
background-color: white; | ||
overflow: hidden; | ||
`; | ||
|
||
const Sidebar = styled(BaseSkeleton)` | ||
position: fixed; | ||
width: 100px; | ||
min-height: 100%; | ||
overflow: hidden; | ||
${theme.response.tablet} { | ||
display: none; | ||
} | ||
`; | ||
|
||
const Section = styled.div` | ||
--sidebar-width: 100px; | ||
width: 100%; | ||
min-width: calc(100vh - var(--sidebar-width)); | ||
height: 100vh; | ||
margin-left: var(--sidebar-width); | ||
padding: 0 22px; | ||
display: flex; | ||
flex-direction: column; | ||
${theme.response.tablet} { | ||
min-width: 0; | ||
margin-left: 0; | ||
padding: 0 15px; | ||
} | ||
`; | ||
|
||
const Header = styled(BaseSkeleton)` | ||
position: sticky; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 85px; | ||
border-radius: 20px; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
${theme.response.tablet} { | ||
height: 65px; | ||
border-radius: 10px; | ||
} | ||
`; | ||
|
||
const OutletLayout = styled(BaseSkeleton)` | ||
width: 100%; | ||
height: 85vh; | ||
max-height: 85vh; | ||
margin-top: 16px; | ||
border-radius: 20px; | ||
${theme.response.tablet} { | ||
margin-top: 15px; | ||
margin-top: 0; | ||
border-radius: 10px; | ||
} | ||
`; |
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
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,16 @@ | ||
import { AxiosResponse } from 'axios'; | ||
|
||
import { instance } from '..'; | ||
import { HeaderAccommodationResult } from '@/types/layout'; | ||
import { | ||
HeaderAccommodationData, | ||
HeaderAccommodationResult | ||
} from '@/types/layout'; | ||
|
||
const getHeaderAccommodation = async (): Promise<HeaderAccommodationResult> => { | ||
const getHeaderAccommodation = async (): Promise<HeaderAccommodationData> => { | ||
const response: AxiosResponse<HeaderAccommodationResult, Error> = | ||
await instance.get(`/v1/accommodation`); | ||
|
||
return response.data; | ||
return response.data.accommodation_responses; | ||
}; | ||
|
||
export default getHeaderAccommodation; |
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,14 +1,13 @@ | ||
import { instance } from '..'; | ||
import { LocalCouponUsageResult } from '@/types/dashboard'; | ||
|
||
const getLocalCouponUsage = async (id: number) => { | ||
try { | ||
const response = await instance.get( | ||
`v1/dashboards/${id}/coupons/local/count` | ||
); | ||
return response.data; | ||
} catch (err) { | ||
console.error(err); | ||
} | ||
const getLocalCouponUsage = async ( | ||
id: number | ||
): Promise<LocalCouponUsageResult> => { | ||
const response = await instance.get( | ||
`v1/dashboards/${id}/coupons/local/count` | ||
); | ||
return response.data; | ||
}; | ||
|
||
export default getLocalCouponUsage; |
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,12 +1,10 @@ | ||
import { instance } from '..'; | ||
|
||
const getMonthReports = async (id: number) => { | ||
try { | ||
const response = await instance.get(`v1/dashboards/${id}/reports/month`); | ||
return response.data; | ||
} catch (err) { | ||
console.error(err); | ||
} | ||
import { MonthReportsResults } from '@/types/dashboard'; | ||
|
||
const getMonthReports = async (id: number): Promise<MonthReportsResults[]> => { | ||
const response = await instance.get(`v1/dashboards/${id}/reports/month`); | ||
return response.data.monthly_data_responses; | ||
}; | ||
|
||
export default getMonthReports; |
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
Oops, something went wrong.