Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
chore: type some functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirved64 committed Sep 27, 2023
1 parent ed858a3 commit 267f546
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
8 changes: 4 additions & 4 deletions landing/fragments/landing-faq/src/faq.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const Faq = () => {
const { isMobile } = useWindowWidth()

const [open, setOpen] = useState<boolean>(false)
const handleModalOpen = () => setOpen(false)
const handleModalState = () => setOpen(!open)

const questions = Array.from({ length: 6 }, () => Question).map((el, index) => ({
...el,
Expand Down Expand Up @@ -59,7 +59,7 @@ export const Faq = () => {
heightIcon={48}
backgroundIcon='background.white'
radiiIcon='normal'
onClick={() => setOpen(true)}
onClick={handleModalState}
>
<Text color='text.white' fontSize='small' lineHeight='normal'>
<FormattedMessage id='faq.button' />
Expand Down Expand Up @@ -103,7 +103,7 @@ export const Faq = () => {
heightIcon={32}
backgroundIcon='background.white'
radiiIcon='tiny'
onClick={() => setOpen(true)}
onClick={handleModalState}
>
<Text color='text.white' fontSize='small' lineHeight='small'>
<FormattedMessage id='faq.button' />
Expand All @@ -117,7 +117,7 @@ export const Faq = () => {

<Layout flexBasis={[20, 80]} flexShrink='0' />
</Row>
<QuestionModal open={open} setOpen={handleModalOpen} />
<QuestionModal open={open} setOpen={handleModalState} />
</>
)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { MouseEventHandler } from 'react'

export interface QuestionModalProps {
open: boolean
setOpen: () => void
setOpen: MouseEventHandler<HTMLDivElement>
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { MouseEventHandler } from 'react'

export interface DrawerProps {
active: boolean
onClose: () => void
onClose: MouseEventHandler<HTMLButtonElement>
children?: JSX.Element
}
6 changes: 3 additions & 3 deletions ui/form/src/form.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const Form: FC<FormProps> = ({ name, send, setSend, onClose, onChange })
setPhoneNumber('')
}

const handleClose = () => {
onClose()
const handleClose = (e) => {
onClose(e)
setSend(false)
onChange('')
}
Expand All @@ -62,7 +62,7 @@ export const Form: FC<FormProps> = ({ name, send, setSend, onClose, onChange })
maxLength={500}
/>

<Condition match={!!display}>
<Condition match={display}>
<Layout flexBasis={12} />

<Input
Expand Down
8 changes: 6 additions & 2 deletions ui/form/src/form.interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { Dispatch } from 'react'
import { MouseEventHandler } from 'react'
import { SetStateAction } from 'react'

export interface FormProps {
name: string
send: boolean
setSend: React.Dispatch<React.SetStateAction<boolean>>
onClose: () => void
setSend: Dispatch<SetStateAction<boolean>>
onClose: MouseEventHandler<HTMLDivElement>
onChange: (userName: string) => void
}
6 changes: 4 additions & 2 deletions ui/modal/src/modal.interfaces.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { MouseEventHandler } from 'react'

export interface ModalProps {
open?: boolean
onClose?: () => void
open: boolean
onClose: MouseEventHandler<HTMLDivElement>
}

0 comments on commit 267f546

Please sign in to comment.