mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-12-23 09:23:45 +03:00
fix: publish button view and edit icon
This commit is contained in:
parent
70fb2f4c1e
commit
ca9281f226
1 changed files with 22 additions and 18 deletions
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
|
ArchiveBoxArrowDownIcon,
|
||||||
ChevronDoubleLeftIcon,
|
ChevronDoubleLeftIcon,
|
||||||
ChevronDoubleRightIcon,
|
ChevronDoubleRightIcon,
|
||||||
PencilIcon,
|
PencilIcon,
|
||||||
|
@ -82,7 +83,7 @@ function NotePage() {
|
||||||
<ButtonWithIcon
|
<ButtonWithIcon
|
||||||
className="mt-4"
|
className="mt-4"
|
||||||
text={edit ? locals.Save : locals.Edit}
|
text={edit ? locals.Save : locals.Edit}
|
||||||
icon={PencilIcon}
|
icon={edit ? ArchiveBoxArrowDownIcon : PencilIcon}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (edit) {
|
if (edit) {
|
||||||
notes[params.id].name = name;
|
notes[params.id].name = name;
|
||||||
|
@ -94,26 +95,29 @@ function NotePage() {
|
||||||
setEdit(!edit);
|
setEdit(!edit);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ButtonWithIcon
|
|
||||||
className="mt-4"
|
|
||||||
text={locals.Publish}
|
|
||||||
icon={ChevronDoubleRightIcon}
|
|
||||||
href={`/notes/publish?local_id=${params.id}`}
|
|
||||||
/>
|
|
||||||
{!edit && (
|
{!edit && (
|
||||||
<ButtonWithIcon
|
<>
|
||||||
className="mt-4"
|
<ButtonWithIcon
|
||||||
href="/notes"
|
className="mt-4"
|
||||||
text={locals.Delete}
|
text={locals.Publish}
|
||||||
icon={TrashIcon}
|
icon={ChevronDoubleRightIcon}
|
||||||
onClick={() => {
|
href={`/notes/publish?local_id=${params.id}`}
|
||||||
let notesObj = localStorage.getObj("Notes");
|
/>
|
||||||
|
<ButtonWithIcon
|
||||||
|
className="mt-4"
|
||||||
|
href="/notes"
|
||||||
|
text={locals.Delete}
|
||||||
|
icon={TrashIcon}
|
||||||
|
onClick={() => {
|
||||||
|
let notesObj = localStorage.getObj("Notes");
|
||||||
|
|
||||||
delete notesObj[params.id];
|
delete notesObj[params.id];
|
||||||
|
|
||||||
localStorage.setObj("Notes", notesObj);
|
localStorage.setObj("Notes", notesObj);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue