1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Added dark/light mode toggle to profile dropdown menu

- Also fixed some remaining areas which needed dark mode support.
This commit is contained in:
Dan Brown
2020-04-11 20:37:51 +01:00
parent d4b0e4acad
commit 573c848d51
7 changed files with 31 additions and 7 deletions

View File

@ -312,6 +312,16 @@ class UserController extends Controller
return $this->changeListSort($id, $request, $type);
}
/**
* Toggle dark mode for the current user.
*/
public function toggleDarkMode()
{
$enabled = setting()->getForCurrentUser('dark-mode-enabled', false);
setting()->putUser(user(), 'dark-mode-enabled', $enabled ? 'false' : 'true');
return redirect()->back();
}
/**
* Update the stored section expansion preference for the given user.
*/