UI improvements.
This commit is contained in:
@@ -49,7 +49,7 @@ const AddItem = ({
|
||||
<div className="add-overlay" onClick={abort}></div>
|
||||
<div className="send-box">
|
||||
<div className="box">
|
||||
<h2>New bookmark</h2>
|
||||
<h2>New Link</h2>
|
||||
<div className="AddItem-content">
|
||||
<h3>
|
||||
<span style={{ color: "red" }}>* </span>Link:
|
||||
|
||||
@@ -66,7 +66,7 @@ const EditItem = ({
|
||||
<div className="send-box">
|
||||
<div className="box">
|
||||
<div className="title-delete-group">
|
||||
<h2 className="edit-title">Edit bookmark</h2>
|
||||
<h2 className="edit-title">Edit Link</h2>
|
||||
<button className="delete" onClick={deleteItem}>
|
||||

|
||||
</button>
|
||||
|
||||
@@ -33,11 +33,11 @@ const Filters = ({
|
||||
<div className="filter-overlay" onClick={abort}></div>
|
||||
<div className="filter-box">
|
||||
<div className="filter">
|
||||
<h2>Filter search</h2>
|
||||
<h2>Filter Results</h2>
|
||||
|
||||
<div className="filter-groups">
|
||||
<div className="section">
|
||||
<h3>Sort by</h3>
|
||||
<h3>Sort By</h3>
|
||||
<label>
|
||||
<input
|
||||
name="sort"
|
||||
|
||||
+16
-6
@@ -6,11 +6,16 @@ import { useState, useEffect } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import NoResults from "./NoResults";
|
||||
|
||||
const List = ({ data, tags, collections, reFetch, SetLoader, lightMode }) => {
|
||||
const List = ({ SetPath, data, tags, collections, reFetch, SetLoader, lightMode }) => {
|
||||
const [editBox, setEditBox] = useState(false),
|
||||
[editIndex, setEditIndex] = useState(0),
|
||||
[numberOfResults, setNumberOfResults] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
const currentURL = new URL(window.location.href);
|
||||
SetPath(currentURL.pathname);
|
||||
})
|
||||
|
||||
function edit(index) {
|
||||
setEditBox(true);
|
||||
setEditIndex(index);
|
||||
@@ -24,10 +29,15 @@ const List = ({ data, tags, collections, reFetch, SetLoader, lightMode }) => {
|
||||
setNumberOfResults(data.length);
|
||||
}, [data]);
|
||||
|
||||
let currentPATH = new URL(window.location.href).pathname
|
||||
|
||||
return (
|
||||
<div className="list">
|
||||
{numberOfResults > 0 ? (
|
||||
<p className="results">{numberOfResults} Bookmarks found.</p>
|
||||
<p>
|
||||
{currentPATH === "/" ? null : <Link className="btn return-btn" to="/">Return to main page</Link>} {numberOfResults} {numberOfResults === 1 ? "Link " : "Links "}
|
||||
found.
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
{numberOfResults === 0 ? <NoResults /> : null}
|
||||
@@ -43,7 +53,7 @@ const List = ({ data, tags, collections, reFetch, SetLoader, lightMode }) => {
|
||||
item={data[editIndex]}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
|
||||
{/* eslint-disable-next-line */}
|
||||
{data.map((e, i, array) => {
|
||||
try {
|
||||
@@ -74,6 +84,9 @@ const List = ({ data, tags, collections, reFetch, SetLoader, lightMode }) => {
|
||||
{e.collection}
|
||||
</Link>
|
||||
</div>
|
||||
<div className="date">
|
||||
{new Date(e.date).toDateString()}
|
||||
</div>
|
||||
<div className="tags">
|
||||
{e.tag.map((e, i) => {
|
||||
const tagPath = `/tags/${e}`;
|
||||
@@ -84,9 +97,6 @@ const List = ({ data, tags, collections, reFetch, SetLoader, lightMode }) => {
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<div className="date">
|
||||
{new Date(e.date).toDateString()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="etc">
|
||||
|
||||
Reference in New Issue
Block a user