|
@@ -2,12 +2,11 @@ import React, { useCallback } from 'react';
|
|
|
|
|
|
|
|
import { useTranslation } from 'next-i18next';
|
|
import { useTranslation } from 'next-i18next';
|
|
|
|
|
|
|
|
|
|
+import AdminCustomizeContainer from '~/client/services/AdminCustomizeContainer';
|
|
|
|
|
+import { toastSuccess, toastError } from '~/client/util/apiNotification';
|
|
|
import { apiv3Put } from '~/client/util/apiv3-client';
|
|
import { apiv3Put } from '~/client/util/apiv3-client';
|
|
|
-
|
|
|
|
|
import { useGrowiTheme } from '~/stores/context';
|
|
import { useGrowiTheme } from '~/stores/context';
|
|
|
|
|
|
|
|
-import AdminCustomizeContainer from '~/client/services/AdminCustomizeContainer';
|
|
|
|
|
-import { toastSuccess, toastError } from '~/client/util/apiNotification';
|
|
|
|
|
|
|
|
|
|
import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
|
import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
|
|
import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
|
|
@@ -26,11 +25,11 @@ const CustomizeThemeSetting = (props: Props): JSX.Element => {
|
|
|
|
|
|
|
|
const selectedHandler = useCallback((themeName) => {
|
|
const selectedHandler = useCallback((themeName) => {
|
|
|
mutateGrowiTheme(themeName);
|
|
mutateGrowiTheme(themeName);
|
|
|
- }, [adminCustomizeContainer, mutateGrowiTheme]);
|
|
|
|
|
|
|
+ }, [mutateGrowiTheme]);
|
|
|
|
|
|
|
|
const submitHandler = useCallback(async() => {
|
|
const submitHandler = useCallback(async() => {
|
|
|
try {
|
|
try {
|
|
|
- if(currentTheme != null){
|
|
|
|
|
|
|
+ if (currentTheme != null) {
|
|
|
await apiv3Put('/customize-setting/theme', {
|
|
await apiv3Put('/customize-setting/theme', {
|
|
|
themeType: currentTheme,
|
|
themeType: currentTheme,
|
|
|
});
|
|
});
|
|
@@ -41,7 +40,7 @@ const CustomizeThemeSetting = (props: Props): JSX.Element => {
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
toastError(err);
|
|
toastError(err);
|
|
|
}
|
|
}
|
|
|
- }, [t, adminCustomizeContainer]);
|
|
|
|
|
|
|
+ }, [currentTheme, t]);
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<div className="row">
|
|
<div className="row">
|