Skip to content

Commit

Permalink
using react query
Browse files Browse the repository at this point in the history
  • Loading branch information
sasanqc committed Jun 21, 2023
1 parent bb0e7c1 commit 7237f4f
Show file tree
Hide file tree
Showing 21 changed files with 741 additions and 597 deletions.
17 changes: 9 additions & 8 deletions components/BoardsList.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from "react";
import { useSelector, useDispatch } from "react-redux";
import BoardIcon from "@/icons/icon-board.svg";
import BoardListProps from "@/model/BoardListProps";
const BoardsList: React.FC<BoardListProps> = ({
boards,
activeBoard = 0,
onChangedaActiveBoard,
onAddNewBoard,
}) => {

import { selectBoard, setActiveBoard, setActiveModal } from "@/store/uiSlice";
import ModalEnum from "@/model/ModalEnum";
const BoardsList: React.FC<BoardListProps> = ({ boards }) => {
const activeBoard = useSelector(selectBoard);
const dispatch = useDispatch();
return (
<div>
<h4 className="text-gray3 pl-8 mb-5 mt-4">
Expand All @@ -19,7 +20,7 @@ const BoardsList: React.FC<BoardListProps> = ({
className={`flex pl-8 py-4 gap-x-4 mr-6 items-center rounded-r-full cursor-pointer ${
activeBoard === i ? "bg-primary2 text-white" : "text-gray3"
}`}
onClick={() => onChangedaActiveBoard(i)}
onClick={() => dispatch(setActiveBoard(i))}
>
<span>
<BoardIcon />
Expand All @@ -30,7 +31,7 @@ const BoardsList: React.FC<BoardListProps> = ({

<li
className=" flex pl-8 py-4 gap-x-4 mr-6 items-center text-primary2 rounded-r-full cursor-pointer"
onClick={onAddNewBoard}
onClick={() => dispatch(setActiveModal(ModalEnum.CREATE_BOARD))}
>
<span>
<BoardIcon />
Expand Down
1 change: 0 additions & 1 deletion components/UI/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const Modal: React.FC<ModalProps> = ({

const backDropHandler = useCallback((e: MouseEvent) => {
if (!modalRef?.current?.contains(e.target as Node)) {
console.log("on click on backdrop");
onClickBackdrop();
}
}, []);
Expand Down
2 changes: 1 addition & 1 deletion components/UI/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const TextInput = forwardRef<ImperativeInput, TextInputProps>(
setError(message);
},
}));
console.log("render: ", error);

return (
<div className="w-full">
{label && (
Expand Down
Loading

0 comments on commit 7237f4f

Please sign in to comment.