mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-09-13 12:11:30 +08:00
Darkmode for survey pages. Fixes for eslint.
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
<<<<<<< HEAD
|
||||
import { ArrowDownIcon, ArrowUpIcon } from "@heroicons/react/20/solid";
|
||||
=======
|
||||
>>>>>>> main
|
||||
import { Button } from "@chakra-ui/react";
|
||||
import { useSortable } from "@dnd-kit/sortable";
|
||||
import { CSS } from "@dnd-kit/utilities";
|
||||
import { RxDragHandleDots2 } from "react-icons/rx";
|
||||
import { PropsWithChildren } from "react";
|
||||
import { useColorMode } from "@chakra-ui/react";
|
||||
|
||||
export const SortableItem = ({ children, id }: PropsWithChildren<{ id: number }>) => {
|
||||
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id });
|
||||
@@ -17,9 +14,15 @@ export const SortableItem = ({ children, id }: PropsWithChildren<{ id: number }>
|
||||
touchAction: "none",
|
||||
};
|
||||
|
||||
const { colorMode } = useColorMode();
|
||||
const themedClasses =
|
||||
colorMode === "light"
|
||||
? "bg-slate-600 hover:bg-slate-500 text-white"
|
||||
: "bg-black hover:bg-slate-900 text-white ring-1 ring-white/30 ring-inset hover:ring-slate-200/50";
|
||||
|
||||
return (
|
||||
<li
|
||||
className="grid grid-cols-[min-content_1fr] items-center rounded-lg shadow-md gap-x-2 p-2 bg-white hover:bg-slate-50"
|
||||
className={`grid grid-cols-[min-content_1fr] items-center rounded-lg shadow-md gap-x-2 p-2 ${themedClasses}`}
|
||||
ref={setNodeRef}
|
||||
style={style}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user