diff --git a/changelogs/.history b/changelogs/.history index 8170ca3..5054717 100644 --- a/changelogs/.history +++ b/changelogs/.history @@ -1,3 +1,4 @@ +2.0.3 2.0.2 2.0.1 1.0.2 diff --git a/changelogs/CHANGELOG.en.md b/changelogs/CHANGELOG.en.md index 52a2b30..78e5661 100644 --- a/changelogs/CHANGELOG.en.md +++ b/changelogs/CHANGELOG.en.md @@ -1,3 +1,7 @@ +## 🎉 2.0.3 `2024-06-20` +### 🐛 Fix +- Remove useless variables and introduce ([#d78774a](https://github.com/kwooshung/React-Themes/commit/d78774a92f3df22ff48a69ebdb02ba1f01611f82)) + ## 🎉 2.0.2 `2024-06-20` ### ✨ Feature - Increase cookie settings ([#1b058ea](https://github.com/kwooshung/React-Themes/commit/1b058ea0ccc2416512a0348da7a444654fd45636)) diff --git a/changelogs/CHANGELOG.ja.md b/changelogs/CHANGELOG.ja.md index 4c37fa3..19d586e 100644 --- a/changelogs/CHANGELOG.ja.md +++ b/changelogs/CHANGELOG.ja.md @@ -1,3 +1,7 @@ +## 🎉 2.0.3 `2024-06-20` +### 🐛 Fix +- 役に立たない変数を削除して紹介します ([#d78774a](https://github.com/kwooshung/React-Themes/commit/d78774a92f3df22ff48a69ebdb02ba1f01611f82)) + ## 🎉 2.0.2 `2024-06-20` ### ✨ Feature - Cookie設定を増やします ([#1b058ea](https://github.com/kwooshung/React-Themes/commit/1b058ea0ccc2416512a0348da7a444654fd45636)) diff --git a/changelogs/CHANGELOG.ko.md b/changelogs/CHANGELOG.ko.md index 1ec3365..2e714cc 100644 --- a/changelogs/CHANGELOG.ko.md +++ b/changelogs/CHANGELOG.ko.md @@ -1,3 +1,7 @@ +## 🎉 2.0.3 `2024-06-20` +### 🐛 Fix +- 쓸모없는 변수를 제거하고 소개합니다 ([#d78774a](https://github.com/kwooshung/React-Themes/commit/d78774a92f3df22ff48a69ebdb02ba1f01611f82)) + ## 🎉 2.0.2 `2024-06-20` ### ✨ Feature - 쿠키 설정을 늘리십시오 ([#1b058ea](https://github.com/kwooshung/React-Themes/commit/1b058ea0ccc2416512a0348da7a444654fd45636)) diff --git a/changelogs/CHANGELOG.ru.md b/changelogs/CHANGELOG.ru.md index 3c349d4..732c132 100644 --- a/changelogs/CHANGELOG.ru.md +++ b/changelogs/CHANGELOG.ru.md @@ -1,3 +1,7 @@ +## 🎉 2.0.3 `2024-06-20` +### 🐛 Fix +- Удалить бесполезные переменные и ввести ([#d78774a](https://github.com/kwooshung/React-Themes/commit/d78774a92f3df22ff48a69ebdb02ba1f01611f82)) + ## 🎉 2.0.2 `2024-06-20` ### ✨ Feature - Увеличьте настройки cookie ([#1b058ea](https://github.com/kwooshung/React-Themes/commit/1b058ea0ccc2416512a0348da7a444654fd45636)) diff --git a/changelogs/CHANGELOG.zh-cn.md b/changelogs/CHANGELOG.zh-cn.md index ecb8db5..77a30dd 100644 --- a/changelogs/CHANGELOG.zh-cn.md +++ b/changelogs/CHANGELOG.zh-cn.md @@ -1,3 +1,7 @@ +## 🎉 2.0.3 `2024-06-20` +### 🐛 Fix +- 删除无用的变量并介绍 ([#d78774a](https://github.com/kwooshung/React-Themes/commit/d78774a92f3df22ff48a69ebdb02ba1f01611f82)) + ## 🎉 2.0.2 `2024-06-20` ### ✨ Feature - 增加饼干设置 ([#1b058ea](https://github.com/kwooshung/React-Themes/commit/1b058ea0ccc2416512a0348da7a444654fd45636)) diff --git a/changelogs/CHANGELOG.zh-tw.md b/changelogs/CHANGELOG.zh-tw.md index cbab484..aa3b570 100644 --- a/changelogs/CHANGELOG.zh-tw.md +++ b/changelogs/CHANGELOG.zh-tw.md @@ -1,3 +1,7 @@ +## 🎉 2.0.3 `2024-06-20` +### 🐛 Fix +- 刪除無用的變量並介紹 ([#d78774a](https://github.com/kwooshung/React-Themes/commit/d78774a92f3df22ff48a69ebdb02ba1f01611f82)) + ## 🎉 2.0.2 `2024-06-20` ### ✨ Feature - 增加餅乾設置 ([#1b058ea](https://github.com/kwooshung/React-Themes/commit/1b058ea0ccc2416512a0348da7a444654fd45636)) diff --git a/package.json b/package.json index 38acb0d..025034f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kwooshung/react-themes", - "version": "2.0.2", + "version": "2.0.3", "title": "react-themes", "description": "It is more convenient to use svg as React theme, which has strong operability and high degree of freedom.", "private": false, diff --git a/src/themes/themesProvider.test.tsx b/src/themes/themesProvider.test.tsx index 5408007..6ae3e6b 100644 --- a/src/themes/themesProvider.test.tsx +++ b/src/themes/themesProvider.test.tsx @@ -75,7 +75,7 @@ describe('ThemesProvider', () => { }); it('调用 setCookie 时传递正确参数', () => { - const mockSetTheme = vi.fn((value, name) => { + const mockSetTheme = vi.fn((_value, name) => { document.cookie = `theme=${name}; path=/;`; }); diff --git a/src/themes/themesProvider.tsx b/src/themes/themesProvider.tsx index 60e5430..f4b2eab 100644 --- a/src/themes/themesProvider.tsx +++ b/src/themes/themesProvider.tsx @@ -1,4 +1,4 @@ -import React, { FC, ReactNode, useEffect } from 'react'; +import { FC, ReactNode } from 'react'; import { useThemes } from 'lomind-react'; import ThemesContext from './themesContext'; import { IThemesProviderProps } from './interfaces'; @@ -24,7 +24,7 @@ const setCookie = (name: string, value: string, seconds: number) => { * @return {ReactNode} React节点 */ const ThemesProvider: FC = ({ def, list, saveKey, saveExpired, children }: IThemesProviderProps): ReactNode => { - const [value, name, { setTheme, addThemes, getThemeValue, getThemeName, getThemesAvailable }] = useThemes(def, list, (value: string, name: string) => { + const [value, name, { setTheme, addThemes, getThemeValue, getThemeName, getThemesAvailable }] = useThemes(def, list, (_value: string, name: string) => { saveKey && setCookie(saveKey, name, saveExpired || 365 * 24 * 60 * 60); });