Skip to content

Commit

Permalink
fix: bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dream2023 committed Dec 7, 2023
1 parent 79dd2e9 commit 448b7ad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@utopia/prettier-config-base": "^0.0.9",
"cross-env": "^7.0.3",
"dumi": "2.2.14",
"father": "^4.2.1",
"father": "^4.3.7",
"father-plugin-dumi-theme": "^1.0.0-rc.1",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useLocaleValue.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useLocale, useSiteData } from 'dumi';
import type { IAllThemeConfig } from '../types';
import type { IAdditionalThemeConfig } from '../types';

export default function useLocaleValue(key: string) {
const { themeConfig } = useSiteData();
const locale = useLocale();

const additionalThemeConfig: IAllThemeConfig = themeConfig;
const additionalThemeConfig: IAdditionalThemeConfig = themeConfig;
const value = additionalThemeConfig[key];
return typeof value === 'string' ? value : value?.[locale.id];
}
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type IThemeConfig } from 'dumi/dist/client/theme-api/types';

export type ISidebarGroupModePathItem = string | RegExp;

export interface ILocaleEnhance {
interface ILocaleEnhance {
/** 同 themeConfig 中 locales 项中的 id */
id: string;
/** 当多语言只有两项时用于展示切换的前缀 */
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5502,7 +5502,7 @@ father-plugin-dumi-theme@^1.0.0-rc.1:
resolved "https://registry.npmmirror.com/father-plugin-dumi-theme/-/father-plugin-dumi-theme-1.0.0-rc.1.tgz#bc6c0890ab3894c51425d0c9ed0785cb02eeacac"
integrity sha512-Cjbr0VbuGYTb6k6/uGHQVuCGss9/eh1/BV48e0PVQM6cCDMBKNSWCe+Vl69I0bVj+AUFaOIaU7cTYFQ0KcyV0Q==

father@^4.2.1:
father@^4.3.7:
version "4.3.7"
resolved "https://registry.npmmirror.com/father/-/father-4.3.7.tgz#f5a45a5d26b6a49a24399c523d13759a0195a3a8"
integrity sha512-Jr+mUYqvjrTfss9ZFxDB280FdUoj6IUVH12U5ocQKEISzPWewzpGrrassf7gi4ugmJNDP8I/Rzje8uZ90C4OpA==
Expand Down

0 comments on commit 448b7ad

Please sign in to comment.