diff --git a/src/components/atoms/NoteDetailNavigatorItem.tsx b/src/components/atoms/NoteDetailNavigatorItem.tsx new file mode 100644 index 0000000000..da57f34cd3 --- /dev/null +++ b/src/components/atoms/NoteDetailNavigatorItem.tsx @@ -0,0 +1,24 @@ +import styled from '../../lib/styled' + +const NoteDetailNavigatorItem = styled.button` + background-color: transparent; + border: none; + white-space: nowrap; + cursor: pointer; + max-width: 100px; + overflow: hidden; + text-overflow: ellipsis; + transition: color 200ms ease-in-out; + color: ${({ theme }) => theme.navItemColor}; + user-select: none; + &:hover { + color: ${({ theme }) => theme.navButtonHoverColor}; + } + + &:active, + &.active { + color: ${({ theme }) => theme.navButtonActiveColor}; + } +` + +export default NoteDetailNavigatorItem diff --git a/src/components/atoms/TagNavigatorListItem.tsx b/src/components/atoms/TagNavigatorListItem.tsx index b036afe72a..2e950161d9 100644 --- a/src/components/atoms/TagNavigatorListItem.tsx +++ b/src/components/atoms/TagNavigatorListItem.tsx @@ -4,6 +4,7 @@ import styled from '../../lib/styled' import { mdiClose } from '@mdi/js' import { flexCenter } from '../../lib/styled/styleFunctions' import { useRouter } from '../../lib/router' +import { useTranslation } from 'react-i18next' const TagItem = styled.li` margin-right: 5px; @@ -65,10 +66,13 @@ const TagNavigatorListItem = ({ currentTagName, removeTagByName, }: TagNavigatorListItemProps) => { + const { t } = useTranslation() const { push } = useRouter() + return ( { push(`/app/storages/${storageId}/tags/${tag}/${noteId}`) }} @@ -77,6 +81,7 @@ const TagNavigatorListItem = ({ {tag} { removeTagByName(tag) }} diff --git a/src/components/atoms/ToolbarIconButton.tsx b/src/components/atoms/ToolbarIconButton.tsx index af3f423c0f..23db096a9c 100644 --- a/src/components/atoms/ToolbarIconButton.tsx +++ b/src/components/atoms/ToolbarIconButton.tsx @@ -30,16 +30,18 @@ const ToolbarButtonContainer = styled.button` interface ToolbarButtonProps { iconPath: string - active?: boolean + active?: boolean, + title?: string, onClick: React.MouseEventHandler } const ToolbarButton = React.forwardRef( - ({ iconPath, onClick, active = false }: ToolbarButtonProps, ref) => ( + ({ iconPath, onClick, active = false, title }: ToolbarButtonProps, ref) => ( diff --git a/src/components/molecules/NoteDetailFolderNavigator.tsx b/src/components/molecules/NoteDetailNavigator.tsx similarity index 58% rename from src/components/molecules/NoteDetailFolderNavigator.tsx rename to src/components/molecules/NoteDetailNavigator.tsx index 3d64642175..d6e8ecac0d 100644 --- a/src/components/molecules/NoteDetailFolderNavigator.tsx +++ b/src/components/molecules/NoteDetailNavigator.tsx @@ -4,6 +4,8 @@ import { mdiBookOpen, mdiSlashForward } from '@mdi/js' import Icon from '../atoms/Icon' import { useRouter, useRouteParams } from '../../lib/router' import { flexCenter } from '../../lib/styled/styleFunctions' +import { useTranslation } from 'react-i18next' +import NoteDetailNavigatorItem from '../atoms/NoteDetailNavigatorItem' const Container = styled.div` display: flex; @@ -21,27 +23,6 @@ const IconContainer = styled.div` color: ${({ theme }) => theme.navButtonColor}; ` -const FolderNavItem = styled.button` - background-color: transparent; - border: none; - white-space: nowrap; - cursor: pointer; - max-width: 100px; - overflow: hidden; - text-overflow: ellipsis; - transition: color 200ms ease-in-out; - color: ${({ theme }) => theme.navItemColor}; - user-select: none; - &:hover { - color: ${({ theme }) => theme.navButtonHoverColor}; - } - - &:active, - &.active { - color: ${({ theme }) => theme.navButtonActiveColor}; - } -` - interface NoteDetailFolderNavigatorProps { storageId: string storageName: string @@ -54,6 +35,39 @@ interface FolderData { pathname: string } +interface FolderNavItemProps { + active: boolean + storageId: string + storageName: string + folderName: string + folderPathname: string + noteId: string +} + +const NavigatorFolderItem: React.FC = ({ + active, + storageId, + storageName, + folderName, + folderPathname, + noteId, +}: FolderNavItemProps) => { + const { push } = useRouter() + + return ( + ) => { + event.preventDefault() + push(`/app/storages/${storageId}/notes${folderPathname}/${noteId}`) + }} + className={active ? 'active' : ''} + > + {folderName} + + ) +} + const NoteDetailFolderNavigator = ({ storageId, storageName, @@ -63,13 +77,6 @@ const NoteDetailFolderNavigator = ({ const { push } = useRouter() const routeParams = useRouteParams() - const currentFolderPathname = useMemo(() => { - if (routeParams.name !== 'storages.notes') { - return null - } - return routeParams.folderPathname - }, [routeParams]) - const folderDataList = useMemo(() => { if (noteFolderPathname === '/') { return [] @@ -87,13 +94,20 @@ const NoteDetailFolderNavigator = ({ return folderDataList }, [noteFolderPathname]) + const currentFolderPathname = useMemo(() => { + if (routeParams.name !== 'storages.notes') { + return null + } + return routeParams.folderPathname + }, [routeParams]) + return ( - ) => { event.preventDefault() push(`/app/storages/${storageId}/notes/${noteId}`) @@ -101,24 +115,23 @@ const NoteDetailFolderNavigator = ({ className={currentFolderPathname === '/' ? 'active' : ''} > {storageName} - - {folderDataList.map((folderData) => ( - - - { - push( - `/app/storages/${storageId}/notes${folderData.pathname}/${noteId}` - ) - }} - className={ - currentFolderPathname === folderData.pathname ? 'active' : '' - } - > - {folderData.name} - - - ))} + + + {folderDataList.map((folderData) => { + return ( + + + + + ) + })} ) } diff --git a/src/components/molecules/NoteDetailTagNavigator.tsx b/src/components/molecules/NoteDetailTagNavigator.tsx index 6021a31074..3d8d53e4da 100644 --- a/src/components/molecules/NoteDetailTagNavigator.tsx +++ b/src/components/molecules/NoteDetailTagNavigator.tsx @@ -7,6 +7,7 @@ import { useRouteParams } from '../../lib/router' import ToolbarButton from '../atoms/ToolbarIconButton' import TagNavigatorListItem from '../atoms/TagNavigatorListItem' import TagNavigatorNewTagPopup from '../atoms/TagNavigatorNewTagPopup' +import { useTranslation } from 'react-i18next' const Container = styled.div` display: flex; @@ -48,6 +49,8 @@ const NoteDetailTagNavigator = ({ appendTagByName, removeTagByName, }: NoteDetailTagNavigatorProps) => { + const { t } = useTranslation() + const routeParams = useRouteParams() const currentTagName = useMemo(() => { @@ -94,7 +97,7 @@ const NoteDetailTagNavigator = ({ return ( <> - + {' '} @@ -112,6 +115,7 @@ const NoteDetailTagNavigator = ({ })} { + const { t } = useTranslation() + const storageTags = useMemo(() => { if (storage == null) return [] return values(storage.tagMap).map((tag) => tag.name) @@ -117,7 +120,7 @@ const NoteDetailToolbar = ({ return ( - {note.trashed ? ( <> - - + + ) : ( - + )} diff --git a/src/components/molecules/TagListFragment.tsx b/src/components/molecules/TagListFragment.tsx index a0aef4698a..06b1e4b7f5 100644 --- a/src/components/molecules/TagListFragment.tsx +++ b/src/components/molecules/TagListFragment.tsx @@ -88,7 +88,7 @@ const TagListFragment = ({ storage }: TagListFragmentProps) => { 0 ? tagListIsFolded : undefined} onFoldButtonClick={() => { toggleSideNavOpenedItem(tagListNavItemId) diff --git a/src/locales/de.ts b/src/locales/de.ts index 201877e136..186f0d8cda 100644 --- a/src/locales/de.ts +++ b/src/locales/de.ts @@ -5,7 +5,7 @@ export default { 'general.cancel': 'Abbrechen', 'general.attachments': 'Anhänge', 'general.trash': 'Papierkorb', - 'general.allnote': 'Alle Notizen', + 'general.allNotes': 'Alle Notizen', 'general.signin': 'Anmelden', 'general.signOut': 'Abmelden', 'general.save': 'Speichern', @@ -43,7 +43,7 @@ export default { 'folder.removeMessage': 'Alle Notizen und Unterordner werden gelöscht.', //Tag - 'tag.tag': 'Tag', + 'tag.tags': 'Tag', 'tag.remove': 'Tag löschen', 'tag.removeMessage': 'Das Tag wird von allen Notizen entfernt.', diff --git a/src/locales/enUS.ts b/src/locales/enUS.ts index 50c097b8b0..34c985d100 100644 --- a/src/locales/enUS.ts +++ b/src/locales/enUS.ts @@ -5,7 +5,7 @@ export default { 'general.cancel': 'Cancel', 'general.attachments': 'Attachments', 'general.trash': 'Trash', - 'general.allnote': 'All Notes', + 'general.allNotes': 'All Notes', 'general.signin': 'Sign In', 'general.signOut': 'Sign Out', 'general.save': 'Save', @@ -13,6 +13,7 @@ export default { 'general.networkError': 'Network Error', // Storage + 'storage.storage': 'Storage', 'storage.name': 'Storage Name', 'storage.noStorage': 'No storages', 'storage.create': 'Create Storage', @@ -34,6 +35,7 @@ export default { 'storage.syncDate': 'Last synced at', //Folder + 'folder.folder': 'Folder', 'folder.create': 'New Folder', 'folder.rename': 'Rename Folder', 'folder.renameMessage': @@ -43,8 +45,10 @@ export default { 'folder.removeMessage': 'All notes and subfolders will be deleted.', //Tag - 'tag.tag': 'Tags', + 'tag.tags': 'Tags', + 'tag.add': 'Add Tag', 'tag.remove': 'Remove Tag', + 'tag.removeX': 'Remove #{{tag}}', 'tag.removeMessage': 'The tag will be untagged from all notes.', //Note @@ -67,6 +71,11 @@ export default { 'note.createkeymessage2': 'Select a storage', 'note.createkeymessage3': 'to create a new note', 'note.restore': 'Restore', + 'note.edit': 'Edit', + 'note.splitView': 'Split View', + 'note.preview': 'Preview', + 'note.trash': 'Trash', + 'note.export': 'Export', //Bookmark 'bookmark.remove': 'Remove Bookmark', diff --git a/src/locales/esES.ts b/src/locales/esES.ts index be2673b844..e9246aecd8 100644 --- a/src/locales/esES.ts +++ b/src/locales/esES.ts @@ -5,7 +5,7 @@ export default { 'general.cancel': 'Cancelar', 'general.attachments': 'Archivos adjuntos', 'general.trash': 'Basura', - 'general.allnote': 'Todas las notas', + 'general.allNotess': 'Todas las notas', 'general.signin': 'Iniciar sesión', 'general.signOut': 'Cerrar sesión', 'general.save': 'Guardar', @@ -45,7 +45,7 @@ export default { 'Todas las notas y subcarpetas van a ser eliminadas.', //Tag - 'tag.tag': 'Etiqueta', + 'tag.tags': 'Etiqueta', 'tag.remove': 'Eliminar etiqueta', 'tag.removeMessage': 'Vas a quitar esta etiqueta de todas las notas.', diff --git a/src/locales/frFR.ts b/src/locales/frFR.ts index 779c071486..6322d4efb7 100644 --- a/src/locales/frFR.ts +++ b/src/locales/frFR.ts @@ -5,7 +5,7 @@ export default { 'general.cancel': 'Annuler', 'general.attachments': 'Pièces jointes', 'general.trash': 'Corbeille', - 'general.allnote': 'Toutes les notes', + 'general.allNotess': 'Toutes les notes', 'general.signin': 'Se connecter', 'general.signOut': 'Se déconnecter', 'general.save': 'Sauvegarder', @@ -45,7 +45,7 @@ export default { 'Toutes les notes et sous-dossiers seront supprimés.', //Tag - 'tag.tag': 'Tags', + 'tag.tags': 'Tags', 'tag.remove': 'Supprimer Tag', 'tag.removeMessage': 'Le tag sera retiré de toutes les notes.', diff --git a/src/locales/itIT.ts b/src/locales/itIT.ts index 984472bc03..28feb536bd 100644 --- a/src/locales/itIT.ts +++ b/src/locales/itIT.ts @@ -5,7 +5,7 @@ export default { 'general.cancel': 'Annulla', 'general.attachments': 'Allegati', 'general.trash': 'Cestino', - 'general.allnote': 'Tutte le note', + 'general.allNotess': 'Tutte le note', 'general.signin': 'Accedi', 'general.signOut': 'Disconnetti', 'general.save': 'Salva', @@ -43,7 +43,7 @@ export default { 'folder.removeMessage': 'Tutte le note e sottocartelle sarnno eliminate.', //Tag - 'tag.tag': 'Tags', + 'tag.tags': 'Tags', 'tag.remove': 'Rimuovi Tag', 'tag.removeMessage': 'Il tag verrà rimosso da tutte le note', diff --git a/src/locales/ja.ts b/src/locales/ja.ts index 16219bec22..4fe577e017 100644 --- a/src/locales/ja.ts +++ b/src/locales/ja.ts @@ -5,7 +5,7 @@ export default { 'general.cancel': 'キャンセル', 'general.attachments': '画像', 'general.trash': 'ゴミ箱', - 'general.allnote': '全てのノート', + 'general.allNotess': '全てのノート', 'general.signin': 'サインイン', 'general.signOut': 'サインアウト', 'general.save': '保存', @@ -42,7 +42,7 @@ export default { 'folder.removeMessage': 'フォルダを削除すると全てのノートも削除されます', //Tag - 'tag.tag': 'タグ', + 'tag.tags': 'タグ', 'tag.remove': 'タグを削除する', 'tag.removeMessage': '全てのノートからタグが削除されます', diff --git a/src/locales/ko.ts b/src/locales/ko.ts index 264917f2ae..aed8061d88 100644 --- a/src/locales/ko.ts +++ b/src/locales/ko.ts @@ -5,7 +5,7 @@ export default { 'general.cancel': '취소', 'general.attachments': '첨부파일', 'general.trash': '휴지통', - 'general.allnote': '전체 노트', + 'general.allNotes': '전체 노트', 'general.signin': '로그인', 'general.signOut': '로그아웃', 'general.save': '저장', @@ -41,7 +41,7 @@ export default { 'folder.removeMessage': '모든 폴더와 하위폴더가 삭제됩니다.', //Tag - 'tag.tag': '태그', + 'tag.tags': '태그', 'tag.remove': '태그 제거', 'tag.removeMessage': '해당 태그가 모든 노트에서 제거됩니다.', diff --git a/src/locales/ptBR.ts b/src/locales/ptBR.ts index 1fee1aed8e..1df3b0f858 100644 --- a/src/locales/ptBR.ts +++ b/src/locales/ptBR.ts @@ -5,7 +5,7 @@ 'general.cancel': 'Cancelar', 'general.attachments': 'Anexos', 'general.trash': 'Lixo', - 'general.allnote': 'All Notes', + 'general.allNotes': 'All Notes', 'general.signin': 'Logar', 'general.signOut': 'Sair', 'general.save': 'Salvar', @@ -44,7 +44,7 @@ 'folder.removeMessage': 'Todas as notas e sub-pastas serão deletadas.', //Tag - 'tag.tag': 'Tags', + 'tag.tags': 'Tags', 'tag.remove': 'Remover Tag', 'tag.removeMessage': 'A Tag será removida de todas as notas.', diff --git a/src/locales/ukUA.ts b/src/locales/ukUA.ts index 11c04ba6b3..37d8758fbb 100644 --- a/src/locales/ukUA.ts +++ b/src/locales/ukUA.ts @@ -5,7 +5,7 @@ export default { 'general.cancel': 'Скасувати', 'general.attachments': 'Вкладення', 'general.trash': 'Сміття', - 'general.allnote': 'Усі примітки', + 'general.allNotes': 'Усі примітки', 'general.signin': 'Увійти', 'general.signOut': 'Вийти', 'general.save': 'Зберегти', @@ -42,7 +42,7 @@ export default { 'folder.removeMessage': 'Усі нотатки та папки будуть видалені.', // Tag - 'tag.tag': 'Теги', + 'tag.tags': 'Теги', 'tag.remove': 'Видалити тег', 'tag.removeMessage': 'Тег буде відмічений від усіх нотаток.', diff --git a/src/locales/zhCN.ts b/src/locales/zhCN.ts index 89cebf5ad2..94ecbe8a11 100644 --- a/src/locales/zhCN.ts +++ b/src/locales/zhCN.ts @@ -5,7 +5,7 @@ export default { 'general.cancel': '取消', 'general.attachments': '附件', 'general.trash': '回收站', - 'general.allnote': '所有笔记', + 'general.allNotes': '所有笔记', 'general.signin': '登录', 'general.signOut': '登出', 'general.save': '保存', @@ -41,7 +41,7 @@ export default { 'folder.removeMessage': '所有笔记和子文件夹将被删除.', //Tag - 'tag.tag': '标签', + 'tag.tags': '标签', 'tag.remove': '移除标签', 'tag.removeMessage': '这个标签将从所有笔记中被移除.', diff --git a/src/locales/zhHK.ts b/src/locales/zhHK.ts index 54acc3b56a..7e2060038b 100644 --- a/src/locales/zhHK.ts +++ b/src/locales/zhHK.ts @@ -5,7 +5,7 @@ export default { 'general.cancel': '取消', 'general.attachments': '附件', 'general.trash': '垃圾筒', - 'general.allnote': '所有筆記', + 'general.allNotes': '所有筆記', 'general.signin': '登入', 'general.signOut': '登出', 'general.save': '儲存', @@ -41,7 +41,7 @@ export default { 'folder.removeMessage': '所有筆記和子資料夾將被刪除.', //Tag - 'tag.tag': '標籤', + 'tag.tags': '標籤', 'tag.remove': '移除標籤', 'tag.removeMessage': '這個標籤將從所有筆記中被移除.', diff --git a/src/locales/zhTW.ts b/src/locales/zhTW.ts index af9bb6e644..25544d8940 100644 --- a/src/locales/zhTW.ts +++ b/src/locales/zhTW.ts @@ -5,7 +5,7 @@ export default { 'general.cancel': '取消', 'general.attachments': '附加檔案', 'general.trash': '資源回收桶', - 'general.allnote': '所有筆記', + 'general.allNotes': '所有筆記', 'general.signin': '登入', 'general.signOut': '登出', 'general.save': '存檔', @@ -41,7 +41,7 @@ export default { 'folder.removeMessage': '所有筆記和子資料夾將會被刪除。', //Tag - 'tag.tag': '標籤', + 'tag.tags': '標籤', 'tag.remove': '移除標籤', 'tag.removeMessage': '此標籤將從所有筆記中被移除。', diff --git a/src/mobile/components/molecules/TagListFragment.tsx b/src/mobile/components/molecules/TagListFragment.tsx index 05ebe7d212..6bb3ce6e65 100644 --- a/src/mobile/components/molecules/TagListFragment.tsx +++ b/src/mobile/components/molecules/TagListFragment.tsx @@ -92,7 +92,7 @@ const TagListFragment = ({ storage }: TagListFragmentProps) => { 0 ? tagListIsFolded : undefined} onFoldButtonClick={() => { toggleSideNavOpenedItem(tagListNavItemId)