Skip to content

Commit 3e98f26

Browse files
committed
lint fixes
1 parent 67e96ff commit 3e98f26

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

src-ts/declarations.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ declare module '*.md' {
3030
export default value
3131
}
3232

33-
declare module "*.txt" {
34-
const value: string;
35-
export default value;
33+
declare module '*.txt' {
34+
const value: string
35+
export default value
3636
}

src-ts/lib/modals/base-modal/BaseModal.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import classNames from 'classnames'
22
import { FC, ReactNode } from 'react'
33
import Modal, { ModalProps } from 'react-responsive-modal'
4-
import { LoadingSpinner } from '../../loading-spinner'
54

5+
import { LoadingSpinner } from '../../loading-spinner'
66
import { IconOutline } from '../../svgs'
77

88
import styles from './BaseModal.module.scss'
9-
import { useFetchModalContent } from './use-fetch-modal-content'
9+
import { ModalContentResponse, useFetchModalContent } from './use-fetch-modal-content'
1010

1111
export interface BaseModalProps extends ModalProps {
12+
contentClassName?: string
13+
contentUrl?: string
1214
size?: 'lg' | 'md'
1315
title: string
14-
contentUrl?: string
15-
contentClassName?: string
1616
}
1717

1818
const BaseModal: FC<BaseModalProps> = ({
@@ -23,7 +23,7 @@ const BaseModal: FC<BaseModalProps> = ({
2323
...props
2424
}: BaseModalProps) => {
2525

26-
const { content } = useFetchModalContent(contentUrl, props.open)
26+
const { content }: ModalContentResponse = useFetchModalContent(contentUrl, props.open)
2727

2828
const renterContent: () => ReactNode = () => {
2929
if (children || !contentUrl) {

src-ts/lib/modals/base-modal/use-fetch-modal-content.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
import {Dispatch, SetStateAction, useEffect, useState} from 'react';
2-
import { xhrGetAsync } from '../../functions';
1+
import {Dispatch, SetStateAction, useEffect, useState} from 'react'
32

4-
export function useFetchModalContent(contentUrl?: string, enabled?: boolean) {
3+
import { xhrGetAsync } from '../../functions'
4+
5+
export interface ModalContentResponse {
6+
content: string | undefined
7+
}
8+
9+
export function useFetchModalContent(contentUrl?: string, enabled?: boolean): ModalContentResponse {
510
const [content, setContent]: [string|undefined, Dispatch<SetStateAction<string|undefined>>] = useState()
611

712
useEffect(() => {
@@ -14,5 +19,5 @@ export function useFetchModalContent(contentUrl?: string, enabled?: boolean) {
1419
}
1520
}, [contentUrl, content, enabled])
1621

17-
return {content}
22+
return { content }
1823
}

src-ts/lib/modals/privacy-policy-modal/PrivacyPolicyModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Dispatch, FC, MouseEvent, MutableRefObject, SetStateAction, useEffect, useState, useRef } from 'react'
1+
import { Dispatch, FC, SetStateAction, useEffect, useState } from 'react'
22

33
import { ProfileProvider } from '../../profile-provider'
44
import { BaseModal } from '../base-modal'
@@ -21,9 +21,9 @@ const PrivacyPolicyModal: FC<PrivacyPolicyModalProps> = ({ isOpen, onClose }: Pr
2121
}
2222

2323
useEffect(() => {
24-
document.addEventListener('open:support', openSupportModal);
25-
return () => document.removeEventListener('open:support', openSupportModal);
26-
}, []);
24+
document.addEventListener('open:support', openSupportModal)
25+
return () => document.removeEventListener('open:support', openSupportModal)
26+
}, [])
2727

2828
return (
2929
<>

src-ts/lib/modals/terms-modal/TermsModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { FC } from 'react'
22

33
import { BaseModal } from '../base-modal'
44

5-
import styles from './TermsModal.module.scss'
65
import contentUrl from './terms.content.txt'
6+
import styles from './TermsModal.module.scss'
77

88
interface TermsModalProps {
99
isOpen: boolean

0 commit comments

Comments
 (0)