refactor: more TS code

This commit is contained in:
Tristan Yang
2022-07-14 22:22:05 +08:00
parent c2797a132c
commit 65049677e4
12 changed files with 54 additions and 33 deletions
@@ -36,7 +36,6 @@ const StyledPicker = styled.div`
`;
export default function ReactionPicker({ mid, hidePicker }) {
// const wrapperRef = useRef(null);
const [reactMessage, { isLoading }] = useReactMessageMutation();
const { reactionData, currUid } = useAppSelector((store) => {
return {
@@ -44,8 +43,7 @@ export default function ReactionPicker({ mid, hidePicker }) {
currUid: store.authData.user?.uid
};
});
// useOutsideClick(wrapperRef, hidePicker);
const handleReact = (emoji) => {
const handleReact = (emoji: string) => {
console.log("react", emoji);
reactMessage({ mid, action: emoji });
hidePicker();
@@ -100,7 +100,7 @@ interface Props {
closeModal: () => void;
title?: string;
navs: Nav[];
dangers: Danger[];
dangers: [Danger | boolean];
nav: { title: string; name?: string; component?: ReactNode };
children: ReactNode;
}
+1 -1
View File
@@ -11,7 +11,7 @@ interface IProps {
id: number;
}
const useUploadFile = (props: IProps) => {
const { context, id } = props;
const { context, id } = props ? props : { context: "channel", id: 0 };
const dispatch = useAppDispatch();
const { stageFiles, replying } = useAppSelector((store) => {
return {