Skip to content
Snippets Groups Projects
Commit cd07881a authored by Aggarwal Himanshu's avatar Aggarwal Himanshu
Browse files

Move function to utils

parent 76ce0557
No related branches found
No related tags found
2 merge requests!27Merge develop branch into main,!19Add Suggested Search
......@@ -3,15 +3,7 @@ import classNames from "classnames";
import { ChevronDownIcon } from "@heroicons/react/outline";
import { useOnClickOutside } from "../../hooks";
import DropdownItem from "./DropdownItem";
function getCoin(list, id) {
for (let i = 0; i < list.length; i++) {
if (list[i].id == id) {
return list[i];
}
}
return null;
}
import { getCoin } from "../../utils";
function Dropdown({ list, value, setValue, disabled }) {
const [open, setOpen] = useState(false);
......
......@@ -17,3 +17,12 @@ export function equals_string(a, b) {
export function contains_string(a, b) {
return a.toLowerCase().includes(b.toLowerCase());
}
export function getCoin(list, id) {
for (let i = 0; i < list.length; i++) {
if (list[i].id == id) {
return list[i];
}
}
return null;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment