Renamed list to collection.

This commit is contained in:
Daniel
2022-06-23 16:24:08 +04:30
parent 27ddf1c54e
commit ceeb44901b
11 changed files with 88 additions and 65 deletions
+17 -10
View File
@@ -2,17 +2,24 @@ import { useState } from "react";
import "../styles/SendItem.css";
import TagSelection from "./TagSelection";
import addItem from "../modules/send";
import ListSelection from "./ListSelection";
import CollectionSelection from "./CollectionSelection";
const AddItem = ({ onExit, reFetch, tags, lists, SetLoader, lightMode }) => {
const AddItem = ({
onExit,
reFetch,
tags,
collections,
SetLoader,
lightMode,
}) => {
const [name, setName] = useState(""),
[link, setLink] = useState(""),
[tag, setTag] = useState([]),
[list, setList] = useState([]);
[collection, setCollection] = useState("Unsorted");
function newItem() {
SetLoader(true);
addItem(name, link, tag, list, reFetch, onExit, SetLoader, "POST");
addItem(name, link, tag, collection, reFetch, onExit, SetLoader, "POST");
}
function SetName(e) {
@@ -27,8 +34,8 @@ const AddItem = ({ onExit, reFetch, tags, lists, SetLoader, lightMode }) => {
setTag(value.map((e) => e.value.toLowerCase()));
}
function SetList(value) {
setList(value.value);
function SetCollection(value) {
setCollection(value.value);
}
function abort(e) {
@@ -67,11 +74,11 @@ const AddItem = ({ onExit, reFetch, tags, lists, SetLoader, lightMode }) => {
</h3>
<TagSelection setTags={SetTags} tags={tags} lightMode={lightMode} />
<h3>
List: <span className="optional">(Optional)</span>
Collections: <span className="optional">(Optional)</span>
</h3>
<ListSelection
setList={SetList}
lists={lists}
<CollectionSelection
setCollection={SetCollection}
collections={collections}
lightMode={lightMode}
/>
<button onClick={newItem} className="send-btn">