mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 21:38:44 +08:00
refactor: use API from new i18n package
This commit is contained in:
@@ -4,8 +4,8 @@ import {
|
||||
SettingsIcon,
|
||||
} from '@toeverything/components/icons';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import { useTranslation } from '@toeverything/datasource/i18n';
|
||||
import { cloneElement, useCallback, useMemo, type ReactElement } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Comments } from '../Comments';
|
||||
import { useActiveComment } from '../Comments/use-comments';
|
||||
import { LayoutSettings } from '../Layout';
|
||||
|
||||
@@ -6,8 +6,7 @@ import {
|
||||
styled,
|
||||
Switch,
|
||||
} from '@toeverything/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { options } from '../../i18n';
|
||||
import { LOCALES, useTranslation } from '@toeverything/datasource/i18n';
|
||||
import { useSettings } from './use-settings';
|
||||
|
||||
export const SettingsList = () => {
|
||||
@@ -52,7 +51,7 @@ export const SettingsList = () => {
|
||||
defaultValue={i18n.language}
|
||||
onChange={changeLanguage}
|
||||
>
|
||||
{options.map(option => (
|
||||
{LOCALES.map(option => (
|
||||
<Option
|
||||
key={option.value}
|
||||
value={option.value}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { styled, Typography } from '@toeverything/components/ui';
|
||||
import { useTranslation } from '@toeverything/datasource/i18n';
|
||||
import { useUserAndSpaces } from '@toeverything/datasource/state';
|
||||
import format from 'date-fns/format';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { usePageLastUpdated, useWorkspaceAndPageId } from '../util';
|
||||
|
||||
export const LastModified = () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { MoveToIcon } from '@toeverything/components/icons';
|
||||
import { ListItem, styled, Typography } from '@toeverything/components/ui';
|
||||
import { useTranslation } from '@toeverything/datasource/i18n';
|
||||
import { LOGOUT_COOKIES, LOGOUT_LOCAL_STORAGE } from '@toeverything/utils';
|
||||
import { getAuth, signOut } from 'firebase/auth';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const logout = () => {
|
||||
LOGOUT_LOCAL_STORAGE.forEach(name => localStorage.removeItem(name));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { message } from '@toeverything/components/ui';
|
||||
import { useTranslation } from '@toeverything/datasource/i18n';
|
||||
import { copyToClipboard } from '@toeverything/utils';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useSettingFlags, type SettingFlags } from './use-setting-flags';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user