refactor: add typescript support to project

This commit is contained in:
HD
2022-06-21 15:08:35 +08:00
parent 88ec2b742a
commit bd799ebea8
259 changed files with 1042 additions and 458 deletions
@@ -1,8 +1,10 @@
// import React from "react";
import { FC } from "react";
import styled from "styled-components";
import Modal from "../Modal";
import IconClose from "../../../assets/icons/close.svg";
import Button from "../../component/styled/Button";
// import { ReactComponent as IconClose } from "../../../assets/icons/close.svg";
import Button from "../styled/Button";
const Styled = styled.div`
position: relative;
margin-top: 15px;
@@ -11,7 +13,7 @@ const Styled = styled.div`
padding: 16px;
border-radius: 6px;
background: #fff;
box-shadow: 0px 25px 50px rgba(31, 41, 55, 0.25);
box-shadow: 0 25px 50px rgba(31, 41, 55, 0.25);
display: flex;
flex-direction: column;
gap: 12px;
@@ -44,7 +46,13 @@ const Styled = styled.div`
right: 16px;
}
`;
export default function Prompt({ handleInstall, closePrompt }) {
interface Props {
handleInstall?: () => void;
closePrompt?: () => void;
}
const Prompt: FC<Props> = ({ handleInstall, closePrompt }) => {
return (
<Modal mask={false}>
<Styled>
@@ -64,4 +72,6 @@ export default function Prompt({ handleInstall, closePrompt }) {
</Styled>
</Modal>
);
}
};
export default Prompt;
@@ -1,6 +1,4 @@
import { useEffect, useState, useRef } from "react";
// import { useGetServerQuery } from "../../../app/services/server";
// import manifest from "./manifest.json";
import Prompt from "./Prompt";
import usePrompt from "./usePrompt";
@@ -1,5 +1,6 @@
// import React from "react";
import { KEY_PWA_INSTALLED } from "../../../app/config";
export default function usePrompt() {
const resetPrompt = () => {
localStorage.removeItem(KEY_PWA_INSTALLED);