Translations and styling

This commit is contained in:
ajnart
2022-12-20 16:54:22 +09:00
parent c4023ab634
commit 7b147f9bb3
16 changed files with 57 additions and 47 deletions

View File

@@ -1,11 +1,13 @@
import { ActionIcon, Button, Text, Tooltip } from '@mantine/core';
import { IconEdit, IconEditOff } from '@tabler/icons';
import { useTranslation } from 'next-i18next';
import { useScreenLargerThan } from '../../../tools/hooks/useScreenLargerThan';
import { useEditModeStore } from './useEditModeStore';
export const ViewToggleButton = () => {
const screenLargerThanMd = useScreenLargerThan('md');
const { enabled: isEditMode, toggleEditMode } = useEditModeStore();
const { t } = useTranslation('layout/header/actions/toggle-edit-mode');
return (
<Tooltip
@@ -27,7 +29,7 @@ export const ViewToggleButton = () => {
color={isEditMode ? 'red' : undefined}
radius="md"
>
<Text>{isEditMode ? 'Exit Edit Mode' : 'Enter Edit Mode'}</Text>
<Text>{isEditMode ? t('button.enabled') : t('button.disabled')}</Text>
</Button>
) : (
<ActionIcon