-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ward-pagination' into mother
- Loading branch information
Showing
62 changed files
with
901 additions
and
590 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
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
10 changes: 6 additions & 4 deletions
10
packages/esm-appointments-app/src/calendar/monthly/days-of-week.component.tsx
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
49 changes: 49 additions & 0 deletions
49
packages/esm-appointments-app/src/calendar/monthly/monthly-header.component.tsx
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,49 @@ | ||
import React, { useCallback, useContext } from 'react'; | ||
import dayjs from 'dayjs'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Button } from '@carbon/react'; | ||
import { formatDate } from '@openmrs/esm-framework'; | ||
import { omrsDateFormat } from '../../constants'; | ||
import DaysOfWeekCard from './days-of-week.component'; | ||
import SelectedDateContext from '../../hooks/selectedDateContext'; | ||
import styles from './monthly-header.scss'; | ||
|
||
const DAYS_IN_WEEK = ['SUN', 'MON', 'TUE', 'WED', 'THUR', 'FRI', 'SAT']; | ||
|
||
const MonthlyHeader: React.FC = () => { | ||
const { t } = useTranslation(); | ||
const { selectedDate, setSelectedDate } = useContext(SelectedDateContext); | ||
|
||
const handleSelectPrevMonth = useCallback(() => { | ||
setSelectedDate(dayjs(selectedDate).subtract(1, 'month').format(omrsDateFormat)); | ||
}, [selectedDate, setSelectedDate]); | ||
|
||
const handleSelectNextMonth = useCallback(() => { | ||
setSelectedDate(dayjs(selectedDate).add(1, 'month').format(omrsDateFormat)); | ||
}, [selectedDate, setSelectedDate]); | ||
|
||
return ( | ||
<> | ||
<div className={styles.container}> | ||
<Button | ||
aria-label={t('previousMonth', 'Previous month')} | ||
kind="tertiary" | ||
onClick={handleSelectPrevMonth} | ||
size="sm"> | ||
{t('prev', 'Prev')} | ||
</Button> | ||
<span>{formatDate(new Date(selectedDate), { day: false, time: false, noToday: true })}</span> | ||
<Button aria-label={t('nextMonth', 'Next month')} kind="tertiary" onClick={handleSelectNextMonth} size="sm"> | ||
{t('next', 'Next')} | ||
</Button> | ||
</div> | ||
<div className={styles.workLoadCard}> | ||
{DAYS_IN_WEEK.map((day) => ( | ||
<DaysOfWeekCard key={day} dayOfWeek={day} /> | ||
))} | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default MonthlyHeader; |
40 changes: 0 additions & 40 deletions
40
packages/esm-appointments-app/src/calendar/monthly/monthly-header.module.tsx
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
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
Oops, something went wrong.