Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
salimkanoun committed Oct 8, 2024
1 parent 41b1171 commit c1c53d6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 52 deletions.
13 changes: 2 additions & 11 deletions src/delete/DeleteQueues.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useSelector } from "react-redux";
import { getExistingDeleteQueues, deleteDeleteQueue } from "../services/queues";
import { useCustomQuery, useCustomMutation } from "../utils";
import { getExistingDeleteQueues } from "../services/queues";
import { useCustomQuery } from "../utils";
import { RootState } from "../store";
import { Spinner } from "../ui";
import ProgressQueue from "./ProgressQueue";
Expand All @@ -13,14 +13,6 @@ const DeleteQueues = () => {
() => getExistingDeleteQueues(currentUserId)
);

const { mutate: mutateDeleteQueue } = useCustomMutation(
(uuid: string) => deleteDeleteQueue(uuid),
{
onSuccess: () => {
},
}
);

if (isPending) return <Spinner />;

return (
Expand All @@ -30,7 +22,6 @@ const DeleteQueues = () => {
<div key={uuid} >
<ProgressQueue
uuid={uuid}
onStop={() => mutateDeleteQueue(uuid)}
/>
</div>
))}
Expand Down
66 changes: 33 additions & 33 deletions src/delete/DeleteRoot.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useState } from "react";
import { useSelector, useDispatch } from "react-redux";

import { RootState } from "../store";
import DeleteStudyTable from "./DeleteStudyTable";
import { flushDeleteList } from "../reducers/DeleteSlice";
import { Button, Card, CardHeader, CardBody, CardFooter } from "../ui";
import { Colors, useCustomMutation } from "../utils";
import { createDeleteQueue } from "../services/queues";
import { useState } from "react";
import DeleteQueues from "./DeleteQueues";
import Empty from "../icons/Empty";
import { Trash } from "../icons";
import { Button, Card, CardHeader, CardBody, CardFooter } from "../ui";
import { Trash, Empty } from "../icons";

const DeleteRoot = () => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -38,37 +38,37 @@ const DeleteRoot = () => {

return (
<Card>
<CardHeader color={Colors.primary}>
<div className="flex items-center w-full">
<div className="w-4/5 text-lg font-bold text-center">
Delete Resources
</div>
<div className="flex justify-end w-1/5 gap-3 p-3">
<Button
onClick={handleClearList}
color={Colors.light}
className="rounded-lg hover:bg-secondary group"
>
<Empty className="text-xl text-bold text-primary group-hover:text-white" />
</Button>
<CardHeader color={Colors.primary}>
<div className="flex items-center w-full">
<div className="w-4/5 text-lg font-bold text-center">
Delete Resources
</div>
<div className="flex justify-end w-1/5 gap-3 p-3">
<Button
onClick={handleClearList}
color={Colors.light}
className="rounded-lg hover:bg-secondary group"
>
<Empty className="text-xl text-bold text-primary group-hover:text-white" />
</Button>
</div>
</div>
</div>
</CardHeader>
<CardBody color={Colors.almond}>
<DeleteStudyTable studies={Object.values(deleteList)} />
</CardBody>
<CardFooter color={Colors.light} className="flex justify-center gap-3">
<Button
onClick={handleDeleteList}
color={Colors.danger}
className="h-10" // Set a fixed height for the button
>
<Trash /> Delete List
</Button>
</CardHeader>
<CardBody color={Colors.almond}>
<DeleteStudyTable studies={Object.values(deleteList)} />
</CardBody>
<CardFooter color={Colors.light} className="flex justify-center gap-3">
<Button
onClick={handleDeleteList}
color={Colors.danger}
className="h-10" // Set a fixed height for the button
>
<Trash /> Delete List
</Button>

<DeleteQueues />
</CardFooter>
</Card>
<DeleteQueues />
</CardFooter>
</Card>
);
};
export default DeleteRoot;
12 changes: 4 additions & 8 deletions src/delete/ProgressQueue.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { deleteDeleteQueue, getDeleteQueue } from "../services/queues";
import { Colors, useCustomMutation, useCustomQuery } from "../utils";
import { useCustomMutation, useCustomQuery } from "../utils";
import { ProgressCircle, Spinner } from "../ui";
import { Cancel, Pause, Trash } from "../icons"; // Import your icon components
import { Cancel, Pause } from "../icons";

type ProgressQueueProps = {
uuid: string;
Expand All @@ -25,19 +25,15 @@ const ProgressQueue = ({ uuid }: ProgressQueueProps) => {
<div className="flex-col items-center justify-center">
<ProgressCircle text={data?.state} progress={data?.progress || 0} size={150}>
<div className="flex justify-center">
{/* Clickable Trash Icon */}

<Pause
className={`text-sm cursor-pointer text- hover:text-yellow-500 mr-2`} // Change color on hover, add margin for spacing
disabled
onClick={() => {/* Implement pause functionality here */ }}
/>
<Cancel
className={`text-sm text-danger cursor-pointer hover:text-danger-hover `} // Change color on hover
onClick={() => mutateDeleteQueue({})}
/>

{/* Clickable Pause Icon */}

/>
</div>
</ProgressCircle>
</div>
Expand Down

0 comments on commit c1c53d6

Please sign in to comment.