-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d6efe5
commit 2580e7b
Showing
22 changed files
with
719 additions
and
212 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,7 +1,16 @@ | ||
import { accessClient } from 'api'; | ||
import { DiningsParams, OriginalDinings } from 'models/dinings'; | ||
import { DiningsParams, OriginalDinings, DiningExcelParams } from 'models/dinings'; | ||
|
||
export const getDinings = async (date: DiningsParams) => { | ||
const { data } = await accessClient.get<DiningsParams>(`/dinings?date=${date}`); | ||
return OriginalDinings.parse(data); | ||
}; | ||
|
||
export const getExcel = async (params: DiningExcelParams) => { | ||
const response = await accessClient.get( | ||
`/coop/dining/excel?startDate=${params.startDate}&endDate=${params.endDate}&isCafeteria=${params.isCafeteria}`, | ||
{ responseType: 'blob' }, | ||
); | ||
|
||
return response; | ||
}; |
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,9 +1,15 @@ | ||
@use "src/assets/styles/mediaQuery" as media; | ||
|
||
.wrapper { | ||
position: relative; | ||
max-width: 480px; | ||
max-width: 100vw; | ||
min-height: 100%; | ||
width: auto; | ||
margin: 0 auto; | ||
background: #f5f5f5; | ||
box-shadow: 0 0 20px #0000000d; | ||
|
||
@include media.media-breakpoint-down(mobile) { | ||
width: 480px; | ||
} | ||
} |
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,11 +1,36 @@ | ||
@use "src/assets/styles/mediaQuery" as media; | ||
|
||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
max-width: 989px; | ||
width: 100%; | ||
margin: 0 auto; | ||
|
||
@include media.media-breakpoint-down(mobile) { | ||
flex-direction: column; | ||
max-width: 480px; // 모바일 뷰에서는 너비 제한 | ||
width: 100%; | ||
} | ||
} | ||
|
||
.diningDownloadWrapper { | ||
display: flex; | ||
margin-left: auto; | ||
} | ||
|
||
.content { | ||
display: flex; | ||
flex-grow: 2; // 2배 공간 | ||
flex-direction: column; | ||
padding: 16px 24px; | ||
gap: 12px; | ||
} | ||
|
||
.calendarWrapper { | ||
flex-grow: 1; // 1:2 비율에서 1배의 공간 | ||
max-width: 989px; | ||
} | ||
|
||
.diningTypeWrapper { | ||
flex-grow: 2; // 1:2 비율에서 2배 공간 | ||
} |
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
27 changes: 27 additions & 0 deletions
27
src/pages/Coop/components/DiningDownload/DiningDownload.module.scss
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,27 @@ | ||
.button-container { | ||
display: flex; | ||
background: #fff; | ||
max-width: 173px; | ||
width: 100%; | ||
padding: 8px 12px; | ||
gap: 8px; | ||
border-radius: 8px; | ||
height: 26px; | ||
} | ||
|
||
.dining-download-button { | ||
display: flex; | ||
background: #fff; | ||
border: none; | ||
color: #171717; | ||
font-size: 14px; | ||
font-weight: 400; | ||
width: 119px; | ||
height: 26px; | ||
text-align: center; | ||
padding: 2px 0 0 4px; | ||
} | ||
|
||
.exel-icon { | ||
padding-top: 3px; | ||
} |
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,32 @@ | ||
import { useState } from 'react'; | ||
|
||
import DownloadIcon from 'assets/svg/common/download.svg?react'; | ||
import ExcelIcon from 'assets/svg/common/excel.svg?react'; | ||
import DownloadModal from 'pages/Coop/components/DownloadModal'; | ||
|
||
import styles from './DiningDownload.module.scss'; | ||
|
||
export default function DiningDownload() { | ||
const [isModalOpen, setIsModalOpen] = useState(false); // 모달 상태 | ||
|
||
const openModal = () => { | ||
setIsModalOpen(true); | ||
}; | ||
|
||
const closeModal = () => { | ||
setIsModalOpen(false); | ||
}; | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<div className={styles['button-container']}> | ||
<ExcelIcon className={styles['exel-icon']} /> | ||
<button type="button" onClick={openModal} className={styles['dining-download-button']}>식단 파일 다운로드</button> | ||
<DownloadIcon className={styles['download-button']} /> | ||
</div> | ||
|
||
{isModalOpen && <DownloadModal closeModal={closeModal} />} | ||
|
||
</div> | ||
); | ||
} |
88 changes: 24 additions & 64 deletions
88
src/pages/Coop/components/DiningTypeSelect/DiningTypeSelect.module.scss
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,73 +1,33 @@ | ||
.container { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
margin-left: 16px; | ||
justify-content: center; | ||
gap: 20px; // 버튼 간의 간격을 조절 | ||
margin-top: 16px; | ||
background-color: #fff; | ||
border-radius: 12px 12px 0 0; | ||
} | ||
|
||
.type-title { | ||
color: #10477a; | ||
.dining-type-button { | ||
max-width: 200px; | ||
width: 100%; | ||
height: 56px; | ||
background: none; | ||
border: none; | ||
color: #666; | ||
font-size: 18px; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 160%; /* 28.8px */ | ||
} | ||
|
||
.dropdown { | ||
position: relative; | ||
|
||
&__trigger { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 6px 16px; | ||
border-radius: 8px; | ||
background: none; | ||
color: #000; | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 160%; /* 25.6px */ | ||
|
||
&:active { | ||
background: #eee; | ||
} | ||
} | ||
} | ||
|
||
.arrow-icon { | ||
transition: all 0.4s ease; | ||
|
||
&__transform { | ||
transform: rotate(-180deg); | ||
font-weight: 600; | ||
cursor: pointer; | ||
padding: 16px 12px 16px 16px; | ||
transition: color 0.3s ease; | ||
gap: 8px; | ||
|
||
&:hover { | ||
color: #10477a; // hover 시 텍스트 색 변경 | ||
} | ||
} | ||
|
||
.dropdown-list { | ||
z-index: 5; | ||
position: absolute; | ||
bottom: -122px; | ||
left: 0; | ||
display: flex; | ||
flex-direction: column; | ||
width: 84px; | ||
border-radius: 8px; | ||
background: #fff; | ||
box-shadow: 0 2px 20px 0 rgba(0 0 0 / 4%), 0 8px 32px 0 rgba(0 0 0 / 8%); | ||
} | ||
|
||
.dropdown-item { | ||
display: flex; | ||
align-items: center; | ||
color: #000; | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 160%; /* 25.6px */ | ||
padding: 6px 16px; | ||
background: none; | ||
|
||
&--selected { | ||
background: #f5f5f5; | ||
} | ||
.dining-type-button--selected { | ||
color: #10477a; | ||
font-weight: 700; // 선택된 버튼의 텍스트를 강조 | ||
border-bottom: 2px solid #10477a; // 선택된 버튼 아래쪽에 강조선 추가 | ||
} |
Oops, something went wrong.