diff --git a/src/elements/Preview/Preview.module.css b/src/elements/Preview/Preview.module.css
index d8f73f9..a369f71 100644
--- a/src/elements/Preview/Preview.module.css
+++ b/src/elements/Preview/Preview.module.css
@@ -42,7 +42,6 @@
.videopreview:hover {
opacity: 1;
- /*box-shadow: rgba(2, 12, 27, 0.7) 0 0 0 5px;*/
transition: all 300ms;
}
diff --git a/src/elements/SideBar/SideBar.js b/src/elements/SideBar/SideBar.js
index 738391c..1b050a8 100644
--- a/src/elements/SideBar/SideBar.js
+++ b/src/elements/SideBar/SideBar.js
@@ -1,10 +1,10 @@
import React from "react";
import style from "./SideBar.module.css"
-import StaticInfos from "../../GlobalInfos";
+import GlobalInfos from "../../GlobalInfos";
class SideBar extends React.Component {
render() {
- const themeStyle = StaticInfos.getThemeStyle();
+ const themeStyle = GlobalInfos.getThemeStyle();
return (
{this.props.children}
);
@@ -13,7 +13,7 @@ class SideBar extends React.Component {
export class SideBarTitle extends React.Component {
render() {
- const themeStyle = StaticInfos.getThemeStyle();
+ const themeStyle = GlobalInfos.getThemeStyle();
return (
{this.props.children}
);
@@ -22,7 +22,7 @@ export class SideBarTitle extends React.Component {
export class SideBarItem extends React.Component {
render() {
- const themeStyle = StaticInfos.getThemeStyle();
+ const themeStyle = GlobalInfos.getThemeStyle();
return (
{this.props.children}
);
diff --git a/src/pages/SettingsPage/GeneralSettings.js b/src/pages/SettingsPage/GeneralSettings.js
index 75eecbc..39f5a26 100644
--- a/src/pages/SettingsPage/GeneralSettings.js
+++ b/src/pages/SettingsPage/GeneralSettings.js
@@ -1,7 +1,7 @@
import React from "react";
import {Button, Col, Form} from "react-bootstrap";
import style from "./GeneralSettings.module.css"
-import StaticInfos from "../../GlobalInfos";
+import GlobalInfos from "../../GlobalInfos";
class GeneralSettings extends React.Component {
constructor(props) {
@@ -38,7 +38,7 @@ class GeneralSettings extends React.Component {
}
render() {
- const themeStyle = StaticInfos.getThemeStyle();
+ const themeStyle = GlobalInfos.getThemeStyle();
return (
<>
@@ -96,9 +96,9 @@ class GeneralSettings extends React.Component {
id="custom-switch-3"
data-testid='darktheme-switch'
label="Enable Dark-Theme"
- checked={StaticInfos.isDarkTheme()}
+ checked={GlobalInfos.isDarkTheme()}
onChange={() => {
- StaticInfos.enableDarkTheme(!StaticInfos.isDarkTheme());
+ GlobalInfos.enableDarkTheme(!GlobalInfos.isDarkTheme());
this.forceUpdate();
// todo initiate rerender
}}
@@ -128,7 +128,7 @@ class GeneralSettings extends React.Component {
updateRequest.append('tvshowpath', this.state.tvshowpath);
updateRequest.append('mediacentername', this.state.mediacentername);
updateRequest.append("tmdbsupport", this.state.tmdbsupport);
- updateRequest.append("darkmodeenabled", StaticInfos.isDarkTheme());
+ updateRequest.append("darkmodeenabled", GlobalInfos.isDarkTheme());
fetch('/api/Settings.php', {method: 'POST', body: updateRequest})
.then((response) => response.json()
diff --git a/src/pages/SettingsPage/GeneralSettings.test.js b/src/pages/SettingsPage/GeneralSettings.test.js
index 89e63bb..6d8ba59 100644
--- a/src/pages/SettingsPage/GeneralSettings.test.js
+++ b/src/pages/SettingsPage/GeneralSettings.test.js
@@ -1,6 +1,7 @@
import {shallow} from "enzyme";
import React from "react";
import GeneralSettings from "./GeneralSettings";
+import GlobalInfos from "../../GlobalInfos";
function prepareFetchApi(response) {
const mockJsonPromise = Promise.resolve(response);
@@ -25,6 +26,15 @@ describe('
', function () {
expect(wrapper.find("[data-testid='passwordfield']")).toHaveLength(1);
});
+ it('test theme switchbutton', function () {
+ const wrapper = shallow(
);
+
+ GlobalInfos.enableDarkTheme(false);
+ expect(GlobalInfos.isDarkTheme()).toBe(false);
+ wrapper.find("[data-testid='darktheme-switch']").simulate("change");
+ expect(GlobalInfos.isDarkTheme()).toBe(true);
+ });
+
it('test savesettings', done => {
const wrapper = shallow(
);
diff --git a/src/pages/SettingsPage/SettingsPage.js b/src/pages/SettingsPage/SettingsPage.js
index 10ff8be..b663eda 100644
--- a/src/pages/SettingsPage/SettingsPage.js
+++ b/src/pages/SettingsPage/SettingsPage.js
@@ -2,7 +2,7 @@ import React from "react";
import MovieSettings from "./MovieSettings";
import GeneralSettings from "./GeneralSettings";
import style from "./SettingsPage.module.css"
-import StaticInfos from "../../GlobalInfos";
+import GlobalInfos from "../../GlobalInfos";
class SettingsPage extends React.Component {
@@ -28,7 +28,7 @@ class SettingsPage extends React.Component {
}
render() {
- const themestyle = StaticInfos.getThemeStyle();
+ const themestyle = GlobalInfos.getThemeStyle();
return (