Skip to content

Commit

Permalink
Merge pull request #8 from kwooshung/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
kwooshung authored Jun 19, 2024
2 parents 0d2c54a + dede21c commit 73d4c93
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelogs/.history
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
2.0.3
2.0.2
2.0.1
1.0.2
Expand Down
4 changes: 4 additions & 0 deletions changelogs/CHANGELOG.en.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
4 changes: 4 additions & 0 deletions changelogs/CHANGELOG.ja.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
4 changes: 4 additions & 0 deletions changelogs/CHANGELOG.ko.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
4 changes: 4 additions & 0 deletions changelogs/CHANGELOG.ru.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
4 changes: 4 additions & 0 deletions changelogs/CHANGELOG.zh-cn.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
4 changes: 4 additions & 0 deletions changelogs/CHANGELOG.zh-tw.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/themes/themesProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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=/;`;
});

Expand Down
4 changes: 2 additions & 2 deletions src/themes/themesProvider.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -24,7 +24,7 @@ const setCookie = (name: string, value: string, seconds: number) => {
* @return {ReactNode} React节点
*/
const ThemesProvider: FC<IThemesProviderProps> = ({ 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);
});

Expand Down

0 comments on commit 73d4c93

Please sign in to comment.