From 987ae7fb8e6cb76603a430bd16d9defe3b22772f Mon Sep 17 00:00:00 2001 From: Lukas Heiligenbrunner Date: Tue, 4 Aug 2020 18:53:11 +0200 Subject: [PATCH] correct theming of settings page fix saving of themestyle to db --- api/Settings.php | 12 ++++-------- src/pages/SettingsPage/SettingsPage.js | 4 ++-- src/pages/SettingsPage/SettingsPage.module.css | 3 +-- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/api/Settings.php b/api/Settings.php index 4acbb4b..cd3c522 100644 --- a/api/Settings.php +++ b/api/Settings.php @@ -18,7 +18,7 @@ if (isset($_POST['action'])) { $r = mysqli_fetch_assoc($result); // booleans need to be set manually - $r['passwordEnabled'] = $r['password'] != "-1"; + $r['passwordEnabled'] = $r['password'] != "-1"; $r['TMDB_grabbing'] = ($r['TMDB_grabbing'] != '0'); echo json_encode($r); @@ -55,14 +55,10 @@ if (isset($_POST['action'])) { } $r = mysqli_fetch_assoc($result); - if ($r['password'] != "-1") { - $r['passwordEnabled'] = true; - } else { - $r['passwordEnabled'] = false; - } - unset($r['password']); - $r['DarkMode'] = ($r['DarkMode'] != '0'); + $r['passwordEnabled'] = $r['password'] != "-1"; + unset($r['password']); + $r['DarkMode'] = (bool)($r['DarkMode'] != '0'); echo json_encode($r); break; } diff --git a/src/pages/SettingsPage/SettingsPage.js b/src/pages/SettingsPage/SettingsPage.js index 064c38d..10ff8be 100644 --- a/src/pages/SettingsPage/SettingsPage.js +++ b/src/pages/SettingsPage/SettingsPage.js @@ -31,8 +31,8 @@ class SettingsPage extends React.Component { const themestyle = StaticInfos.getThemeStyle(); return (
-
{/* todo: test style */} -
Settings
+
+
Settings
this.setState({currentpage: "general"})} className={style.SettingSidebarElement}>General
diff --git a/src/pages/SettingsPage/SettingsPage.module.css b/src/pages/SettingsPage/SettingsPage.module.css index 8807796..e4f9eda 100644 --- a/src/pages/SettingsPage/SettingsPage.module.css +++ b/src/pages/SettingsPage/SettingsPage.module.css @@ -2,7 +2,6 @@ padding-top: 20px; float: left; width: 10%; - background-color: #d3dcef; min-height: calc(100vh - 62px); min-width: 110px; @@ -28,7 +27,7 @@ .SettingSidebarElement { margin: 10px 5px 5px; padding: 5px; - background-color: #a8b2de; + background-color: #919fd9; text-align: center; font-weight: bold; border-radius: 7px;