feat: add contact modal

This commit is contained in:
QiShaoXuan
2022-10-19 11:51:01 +08:00
parent 90dba82a59
commit 0a4c262b50
13 changed files with 547 additions and 69 deletions
+32 -36
View File
@@ -1,21 +1,14 @@
import React from 'react';
import { useState } from 'react';
import { StyledFAQ, StyledIconWrapper, StyledFAQWrapper } from './style';
import { ContactIcon, HelpIcon, KeyboardIcon } from './icons';
import Grow from '@mui/material/Grow';
import { Tooltip } from '../tooltip';
import { Modal } from '@/components/modal';
import ContactModal from '@/components/contact-modal';
const Contact = () => {
const [openModal, setOpenModal] = React.useState(false);
const [openModal, setOpenModal] = useState(false);
return (
<>
<Modal
open={openModal}
onClose={() => {
setOpenModal(false);
}}
>
<div>modal content</div>
</Modal>
<ContactModal open={openModal} onClose={() => setOpenModal(false)} />
<Tooltip content="Contact with us" placement="left-end">
<StyledIconWrapper
onClick={() => {
@@ -29,31 +22,34 @@ const Contact = () => {
);
};
export const FAQ = () => {
const [showContent, setShowContent] = React.useState(false);
return (
<StyledFAQ
className=""
onMouseEnter={() => {
setShowContent(true);
}}
onMouseLeave={() => {
setShowContent(false);
}}
>
<Grow in={showContent}>
<StyledFAQWrapper>
<Contact />
<Tooltip content="Keyboard shorts" placement="left-end">
<StyledIconWrapper>
<KeyboardIcon />
</StyledIconWrapper>
</Tooltip>
</StyledFAQWrapper>
</Grow>
const [showContent, setShowContent] = useState(false);
<StyledIconWrapper style={{ margin: '0', cursor: 'inherit' }}>
<HelpIcon />
</StyledIconWrapper>
</StyledFAQ>
return (
<>
<StyledFAQ
className=""
onMouseEnter={() => {
setShowContent(true);
}}
onMouseLeave={() => {
setShowContent(false);
}}
>
<Grow in={showContent}>
<StyledFAQWrapper>
<Contact />
<Tooltip content="Keyboard shorts" placement="left-end">
<StyledIconWrapper>
<KeyboardIcon />
</StyledIconWrapper>
</Tooltip>
</StyledFAQWrapper>
</Grow>
<StyledIconWrapper style={{ margin: '0', cursor: 'inherit' }}>
<HelpIcon />
</StyledIconWrapper>
</StyledFAQ>
</>
);
};