refactor: more TS code

This commit is contained in:
Tristan Yang
2022-07-08 10:18:23 +08:00
parent be6822e568
commit 678b8515ca
36 changed files with 210 additions and 220 deletions
+9 -6
View File
@@ -1,7 +1,6 @@
// import React from 'react'
import Tippy from "@tippyjs/react";
import Tippy, { TippyProps } from "@tippyjs/react";
import styled from "styled-components";
import { Placement } from "tippy.js";
import { FC, ReactElement } from "react";
const StyledTip = styled.div`
@@ -40,14 +39,18 @@ const StyledTip = styled.div`
}
`;
interface Props {
interface IProps extends TippyProps {
tip: string;
placement?: Placement;
delay?: number | [number | null, number | null];
children: ReactElement;
}
const Tooltip: FC<Props> = ({ tip = "", placement = "right", delay = null, children, ...rest }) => {
const Tooltip: FC<IProps> = ({
tip = "",
placement = "right",
delay = null,
children,
...rest
}) => {
const defaultDuration: [number, number] = [300, 250];
return (
+3 -3
View File
@@ -6,7 +6,7 @@ import BASE_URL from "../../../app/config";
import { setReady } from "../../../app/slices/ui";
import { useRenewMutation } from "../../../app/services/auth";
import {
fullfillChannels,
fillChannels,
addChannel,
removeChannel,
updateChannel,
@@ -208,8 +208,8 @@ export default function useStreaming() {
}
break;
case "related_groups":
console.log("fullfill channels from streaming", data);
dispatch(fullfillChannels(data.groups));
console.log("fill channels from streaming", data);
dispatch(fillChannels(data.groups));
break;
case "joined_group":
console.log("joined group", data.group);