refactor: more TS code
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user