refactor: more TS code
This commit is contained in:
@@ -17,8 +17,8 @@ import { getUnreadCount } from "../utils";
|
||||
import { useAppSelector } from "../../../app/store";
|
||||
interface IProps {
|
||||
id: number;
|
||||
setFiles: () => void;
|
||||
toggleRemoveConfirm: () => void;
|
||||
setFiles: (files: File[]) => void;
|
||||
toggleRemoveConfirm: (id: number) => void;
|
||||
}
|
||||
const NavItem: FC<IProps> = ({ id, setFiles, toggleRemoveConfirm }) => {
|
||||
const { pathname } = useLocation();
|
||||
|
||||
@@ -3,13 +3,13 @@ import DeleteConfirmModal from "../../settingChannel/DeleteConfirmModal";
|
||||
import NavItem from "./NavItem";
|
||||
import { useAppSelector } from "../../../app/store";
|
||||
|
||||
export default function ChannelList({ setDropFiles }) {
|
||||
const [currId, setCurrId] = useState(null);
|
||||
export default function ChannelList({ setDropFiles }: { setDropFiles: (files: File[]) => void }) {
|
||||
const [currId, setCurrId] = useState<number>();
|
||||
const { channelIds } = useAppSelector((store) => {
|
||||
return { channelIds: store.channels.ids };
|
||||
});
|
||||
|
||||
const setRemoveChannel = (cid = undefined) => {
|
||||
const setRemoveChannel = (cid?: number) => {
|
||||
setCurrId(cid);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user