correct theming of settings page

fix saving of themestyle to db
This commit is contained in:
Lukas Heiligenbrunner 2020-08-04 18:53:11 +02:00
parent 747f3005c8
commit 987ae7fb8e
3 changed files with 7 additions and 12 deletions

View File

@ -18,7 +18,7 @@ if (isset($_POST['action'])) {
$r = mysqli_fetch_assoc($result); $r = mysqli_fetch_assoc($result);
// booleans need to be set manually // booleans need to be set manually
$r['passwordEnabled'] = $r['password'] != "-1"; $r['passwordEnabled'] = $r['password'] != "-1";
$r['TMDB_grabbing'] = ($r['TMDB_grabbing'] != '0'); $r['TMDB_grabbing'] = ($r['TMDB_grabbing'] != '0');
echo json_encode($r); echo json_encode($r);
@ -55,14 +55,10 @@ if (isset($_POST['action'])) {
} }
$r = mysqli_fetch_assoc($result); $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); echo json_encode($r);
break; break;
} }

View File

@ -31,8 +31,8 @@ class SettingsPage extends React.Component {
const themestyle = StaticInfos.getThemeStyle(); const themestyle = StaticInfos.getThemeStyle();
return ( return (
<div> <div>
<div className={style.SettingsSidebar + ' ' + themestyle.secbackground}> {/* todo: test style */} <div className={style.SettingsSidebar + ' ' + themestyle.secbackground}>
<div className={style.SettingsSidebarTitle}>Settings</div> <div className={style.SettingsSidebarTitle + ' ' + themestyle.lighttextcolor}>Settings</div>
<div onClick={() => this.setState({currentpage: "general"})} <div onClick={() => this.setState({currentpage: "general"})}
className={style.SettingSidebarElement}>General className={style.SettingSidebarElement}>General
</div> </div>

View File

@ -2,7 +2,6 @@
padding-top: 20px; padding-top: 20px;
float: left; float: left;
width: 10%; width: 10%;
background-color: #d3dcef;
min-height: calc(100vh - 62px); min-height: calc(100vh - 62px);
min-width: 110px; min-width: 110px;
@ -28,7 +27,7 @@
.SettingSidebarElement { .SettingSidebarElement {
margin: 10px 5px 5px; margin: 10px 5px 5px;
padding: 5px; padding: 5px;
background-color: #a8b2de; background-color: #919fd9;
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
border-radius: 7px; border-radius: 7px;