frontend: add functions to remove searches and theme

This commit is contained in:
Kentai Radiquum 2024-04-27 23:55:19 +05:00
parent 3fdf67c860
commit 21da78f0f2
Signed by: Radiquum
GPG key ID: 858E8EE696525EED

View file

@ -1,3 +1,14 @@
"use client";
function deleteAllSettings() {
localStorage.removeItem("mode");
localStorage.removeItem("theme");
}
function deleteSearchHistory() {
localStorage.removeItem("searches");
}
export default function Settings() { export default function Settings() {
return ( return (
<> <>
@ -7,21 +18,21 @@ export default function Settings() {
> >
<h5>Настройки</h5> <h5>Настройки</h5>
<nav className="wrap"> <nav className="wrap">
<div class="max"> <div className="max">
<h6 className="small">сохранение в истории просмотров</h6> <h6 className="small">сохранение в истории просмотров</h6>
</div> </div>
<label class="switch"> <label className="switch">
<input type="checkbox" /> <input type="checkbox" />
<span></span> <span></span>
</label> </label>
</nav> </nav>
<li className="small-divider"></li> <li className="small-divider"></li>
<nav className="wrap small-space"> <nav className="wrap small-space">
<button className="red"> <button className="red" onClick={() => deleteAllSettings()}>
<i>delete_forever</i> <i>delete_forever</i>
<span>Удалить все настройки</span> <span>Удалить все настройки</span>
</button> </button>
<button className="red"> <button className="red" onClick={() => deleteSearchHistory()}>
<i>delete_history</i> <i>delete_history</i>
<span>Удалить историю поиска</span> <span>Удалить историю поиска</span>
</button> </button>