Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/components/NotePage/NoteList/NoteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ type NoteListProps = {
lastCreatedNoteId: string
}

const { t } = useTranslation()

const NoteList = ({
notes,
createNote,
Expand All @@ -127,6 +125,7 @@ const NoteList = ({
navigateUp,
lastCreatedNoteId
}: NoteListProps) => {
const { t } = useTranslation()
const updateSearchInput: ChangeEventHandler<HTMLInputElement> = useCallback(
event => {
setSearchInput(event.target.value)
Expand Down
3 changes: 2 additions & 1 deletion src/components/PreferencesModal/AboutTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ interface PrimaryLinkProps {
href: string
children: string
}
const { t } = useTranslation()

const PrimaryLink = ({ href, children }: PrimaryLinkProps) => {
const handleClick = useCallback(
Expand All @@ -99,6 +98,8 @@ const PrimaryLink = ({ href, children }: PrimaryLinkProps) => {
}

const AboutTab = () => {
const { t } = useTranslation()

return (
<div>
<Section>
Expand Down
3 changes: 1 addition & 2 deletions src/components/PreferencesModal/ImportTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ const StyledRemove = styled.span`
color: ${({ theme }) => theme.primaryColor};
`

const { t } = useTranslation()

export default () => {
const { t } = useTranslation()
const { pushMessage } = useToast()
const { storageMap, createNote } = useDb()
const storageEntries = useMemo(() => entries(storageMap), [storageMap])
Expand Down
22 changes: 12 additions & 10 deletions src/components/PreferencesModal/UserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ const Container = styled.div`
margin-bottom: 8px;
`

const { t } = useTranslation()
export default ({ user, signout }: UserProps) => {
const { t } = useTranslation()

export default ({ user, signout }: UserProps) => (
<Container>
<MdiIcon path={mdiAccount} size='80px' />
<p>{user.name}</p>
<SectionPrimaryButton onClick={() => signout(user)}>
{t('general.signOut')}
</SectionPrimaryButton>
</Container>
)
return (
<Container>
<MdiIcon path={mdiAccount} size='80px' />
<p>{user.name}</p>
<SectionPrimaryButton onClick={() => signout(user)}>
{t('general.signOut')}
</SectionPrimaryButton>
</Container>
)
}
4 changes: 2 additions & 2 deletions src/components/SideNavigator/FolderListFragment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ interface FolderListFragmentProps {
showPromptToRenameFolder: (folderPathname: string) => void
}

const { t } = useTranslation()

const FolderListFragment = ({
storage,
showPromptToCreateFolder,
Expand All @@ -34,6 +32,8 @@ const FolderListFragment = ({
const { push } = useRouter()
const { messageBox } = useDialog()
const { popup } = useContextMenu()
const { t } = useTranslation()

const { folderMap, id: storageId } = storage

const { toggleSideNavOpenedItem, sideNavOpenedItemSet } = useGeneralStatus()
Expand Down
14 changes: 11 additions & 3 deletions src/components/SideNavigator/TagListFragment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ interface TagListFragmentProps {
storage: NoteStorage
}

const { t } = useTranslation()

const TagListFragment = ({ storage }: TagListFragmentProps) => {
const { toggleSideNavOpenedItem, sideNavOpenedItemSet } = useGeneralStatus()
const { id: storageId, tagMap } = storage
const { push } = useRouter()
const { popup } = useContextMenu()
const { messageBox } = useDialog()
const { removeTag } = useDb()
const { t } = useTranslation()
const currentPathname = usePathnameWithoutNoteId()

const tagListNavItemId = getTagListItemId(storage.id)
Expand Down Expand Up @@ -69,7 +68,16 @@ const TagListFragment = ({ storage }: TagListFragmentProps) => {
/>
)
})
}, [storageId, tagMap, push, currentPathname, popup, messageBox, removeTag])
}, [
storageId,
tagMap,
push,
currentPathname,
popup,
messageBox,
removeTag,
t
])

return (
<>
Expand Down