-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: bug fix and add date notation (#255)
- Loading branch information
Showing
17 changed files
with
218 additions
and
22 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,5 +1,5 @@ | ||
{ | ||
"version": "0.4.80", | ||
"version": "0.4.81", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
|
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,12 @@ | ||
import { Icon } from 'konsta/react'; | ||
import { IoMdTime } from 'react-icons/io'; | ||
|
||
interface TimeIconProps { | ||
size?: number; | ||
} | ||
|
||
const TimeIcon = ({ size }: TimeIconProps) => { | ||
return <Icon ios={<IoMdTime size={size} />} />; | ||
}; | ||
|
||
export default TimeIcon; |
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
20 changes: 20 additions & 0 deletions
20
web/src/pages/convert/components/add-photo-error.dialog.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,20 @@ | ||
import { Dialog, DialogButton } from 'konsta/react'; | ||
import { useStore } from '../../../store'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
const AddPhotoErrorDialog = () => { | ||
const { t } = useTranslation(); | ||
const { openedAddPhotoErrorDialog, setOpenedAddPhotoErrorDialog } = useStore(); | ||
|
||
return ( | ||
<Dialog | ||
opened={openedAddPhotoErrorDialog} | ||
onBackdropClick={() => setOpenedAddPhotoErrorDialog(false)} | ||
title={t('fail-to-load-photos')} | ||
content={t('please-check-your-photo-extension')} | ||
buttons={<DialogButton onClick={() => setOpenedAddPhotoErrorDialog(false)}>{t('close')}</DialogButton>} | ||
/> | ||
); | ||
}; | ||
|
||
export default AddPhotoErrorDialog; |
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
17 changes: 17 additions & 0 deletions
17
web/src/pages/setting/components/date-notation.list-item.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,17 @@ | ||
import { ListItem } from 'konsta/react'; | ||
import { useStore } from '../../../store'; | ||
import { useTranslation } from 'react-i18next'; | ||
import TimeIcon from '../../../icons/time.icon'; | ||
|
||
const DateNotationListItem = () => { | ||
const { t } = useTranslation(); | ||
const { dateNotation, setDateNotationPopover } = useStore(); | ||
|
||
return ( | ||
<> | ||
<ListItem title={t('root.settings.date-notation')} media={<TimeIcon size={26} />} after={<div className="date-notation">{dateNotation}</div>} onClick={() => setDateNotationPopover(true)} link /> | ||
</> | ||
); | ||
}; | ||
|
||
export default DateNotationListItem; |
38 changes: 38 additions & 0 deletions
38
web/src/pages/setting/components/date-notation.popover.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,38 @@ | ||
import { List, ListItem, Popover } from 'konsta/react'; | ||
import { useStore } from '../../../store'; | ||
|
||
const DateNotationPopover = () => { | ||
const { dateNotationPopover, setDateNotationPopover, setDateNotation } = useStore(); | ||
|
||
return ( | ||
<Popover opened={dateNotationPopover} target={'.date-notation'} onBackdropClick={() => setDateNotationPopover(false)}> | ||
<List nested> | ||
{[ | ||
'empty', | ||
'Jan 1, 2001', | ||
'2001/01/01 01:01:01', | ||
'2001-01-01 01:01:01', | ||
'2001年01月01日 01時01分', | ||
'2001년 01월 01일 01시 01분', | ||
'2001/01/01', | ||
'2001-01-01', | ||
'2001年01月01日', | ||
'2001년 01월 01일', | ||
].map((ratio) => ( | ||
<ListItem | ||
key={ratio} | ||
title={ratio} | ||
link | ||
chevronIos={false} | ||
onClick={() => { | ||
setDateNotation(ratio as never); | ||
setDateNotationPopover(false); | ||
}} | ||
/> | ||
))} | ||
</List> | ||
</Popover> | ||
); | ||
}; | ||
|
||
export default DateNotationPopover; |
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.