mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 21:48:48 +08:00
fix: replace react-i18n with affine/i18n
This commit is contained in:
@@ -4,7 +4,7 @@ import { Button } from '@/ui/button';
|
||||
import { useState } from 'react';
|
||||
import Input from '@/ui/input';
|
||||
import { KeyboardEvent } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import { useWorkspaceHelper } from '@/hooks/use-workspace-helper';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import Slide from '@mui/material/Slide';
|
||||
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
|
||||
import { useAppState } from '@/providers/app-state-provider';
|
||||
import useHistoryUpdated from '@/hooks/use-history-update';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
|
||||
const useToolbarList1 = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Button } from '@/ui/button';
|
||||
import { FC, useRef, ChangeEvent, ReactElement } from 'react';
|
||||
import { styled } from '@/styles';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
interface Props {
|
||||
uploadType?: string;
|
||||
children?: ReactElement;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useAppState } from '@/providers/app-state-provider';
|
||||
import { useConfirm } from '@/providers/ConfirmProvider';
|
||||
import { useRouter } from 'next/router';
|
||||
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
|
||||
export const TrashButtonGroup = () => {
|
||||
const { permanentlyDeletePage } = usePageHelper();
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { LOCALES } from '@/libs/i18n/resources/index';
|
||||
import { LOCALES } from '@affine/i18n';
|
||||
import UnfoldMoreIcon from '@mui/icons-material/UnfoldMore';
|
||||
import type { TooltipProps } from '@mui/material';
|
||||
import { styled } from '@/styles';
|
||||
import { Button, Tooltip } from '@mui/material';
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
|
||||
export const LanguageMenu = () => {
|
||||
const { i18n } = useTranslation();
|
||||
|
||||
@@ -33,7 +33,7 @@ import useLocalStorage from '@/hooks/use-local-storage';
|
||||
import usePageMetaList from '@/hooks/use-page-meta-list';
|
||||
import { usePageHelper } from '@/hooks/use-page-helper';
|
||||
// import { WorkspaceSetting } from '@/components/workspace-setting';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import { WorkspaceSelector } from './WorkspaceSelector/WorkspaceSelector';
|
||||
|
||||
const FavoriteList = ({ showList }: { showList: boolean }) => {
|
||||
@@ -156,7 +156,7 @@ export const WorkSpaceSliderBar = () => {
|
||||
<StyledListItem active={router.asPath === paths.setting}>
|
||||
<StyledLink href={{ pathname: paths.setting }}>
|
||||
<SettingsIcon />
|
||||
{t('Setting')}
|
||||
Settings
|
||||
</StyledLink>
|
||||
</StyledListItem>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ export const useWorkspaceHelper = () => {
|
||||
workspace: Workspace
|
||||
) => {
|
||||
if (name) {
|
||||
dataCenter.resetWorkspaceMeta({ name }, workspace);
|
||||
dataCenter.updateWorkspaceMeta({ name }, workspace);
|
||||
}
|
||||
// if (avatar) {
|
||||
// dataCenter.resetWorkspaceMeta({ avatar }, workspace);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataCenter, User, Workspace } from '@affine/datacenter';
|
||||
import { DataCenter, User, WorkspaceInfo } from '@affine/datacenter';
|
||||
import type { EditorContainer } from '@blocksuite/editor';
|
||||
|
||||
import type {
|
||||
@@ -18,9 +18,9 @@ export interface PageMeta extends StorePageMeta {
|
||||
export type AppStateValue = {
|
||||
dataCenter: DataCenter;
|
||||
user: User | null;
|
||||
workspaceList: Workspace[];
|
||||
workspaceList: WorkspaceInfo[];
|
||||
currentWorkspace: StoreWorkspace;
|
||||
currentMetaWorkSpace: Workspace | null;
|
||||
currentMetaWorkSpace: WorkspaceInfo | null;
|
||||
currentWorkspaceId: string;
|
||||
pageList: PageMeta[];
|
||||
currentPage: StorePage | null;
|
||||
|
||||
Reference in New Issue
Block a user