Linting improvements

This commit is contained in:
Jackson Harper 2023-03-06 16:21:20 +08:00
parent 9122463222
commit 96ddc100b5
7 changed files with 10 additions and 92 deletions

View file

@ -1,62 +0,0 @@
import { ReactNode, useMemo, useRef, useState } from 'react'
import { StyledText } from '../../elements/StyledText'
import { Box, HStack, SpanBox, VStack } from '../../elements/LayoutPrimitives'
import { Dropdown, DropdownOption } from '../../elements/DropdownElements'
import { Button, IconButton } from '../../elements/Button'
import {
CaretRight,
Circle,
DotsThree,
MagnifyingGlass,
Plus,
X,
} from 'phosphor-react'
import { useGetSubscriptionsQuery } from '../../../lib/networking/queries/useGetSubscriptionsQuery'
import { useGetLabelsQuery } from '../../../lib/networking/queries/useGetLabelsQuery'
import { Label } from '../../../lib/networking/fragments/labelFragment'
import {
ModalContent,
ModalOverlay,
ModalRoot,
} from '../../elements/ModalPrimitives'
import { theme } from '../../tokens/stitches.config'
import { FormInput } from '../../elements/FormElements'
import { SearchBox } from '../../templates/homeFeed/LibraryHeader'
type SearchModalProps = {
searchTerm: string | undefined
applySearchQuery: (searchTerm: string) => void
onOpenChange: (open: boolean) => void
}
export function SearchModal(props: SearchModalProps): JSX.Element {
return (
<ModalRoot defaultOpen onOpenChange={props.onOpenChange} css={{}}>
<ModalOverlay onClick={(e) => e.preventDefault()} />
<ModalContent
css={{
bg: '$grayBg',
width: '100%',
p: '10px',
height: '120px',
top: '70px',
}}
onInteractOutside={() => {
// remove focus from modal
;(document.activeElement as HTMLElement).blur()
}}
>
<VStack distribution="start" css={{ p: '0px' }}>
<Box css={{ width: '100%' }}>
<SearchBox
{...props}
compact={true}
onClose={() => props.onOpenChange(false)}
/>
</Box>
</VStack>
</ModalContent>
</ModalRoot>
)
}

View file

@ -1,14 +1,9 @@
import { ReactNode, useMemo, useState } from 'react'
import { HStack, VStack } from './../elements/LayoutPrimitives'
import { ReactNode } from 'react'
import {
Dropdown,
DropdownOption,
DropdownSeparator,
} from '../elements/DropdownElements'
import { StyledText } from '../elements/StyledText'
import { Button } from '../elements/Button'
import { currentThemeName } from '../../lib/themeUpdater'
import { Check } from 'phosphor-react'
type DropdownMenuProps = {
triggerElement: ReactNode

View file

@ -71,7 +71,7 @@ const RecommendationComments = (
</StyledText>
</HStack>
{props.recommendationsWithNotes.map((item, idx) => (
{props.recommendationsWithNotes.map((item) => (
<VStack
key={item.id}
alignment="start"

View file

@ -1,14 +1,11 @@
import { HStack, VStack, SpanBox, Box } from '../../elements/LayoutPrimitives'
import { HStack, VStack, SpanBox } from '../../elements/LayoutPrimitives'
import { Button } from '../../elements/Button'
import { StyledText } from '../../elements/StyledText'
import { styled, theme, ThemeId } from '../../tokens/stitches.config'
import { ArrowsHorizontal, ArrowsInLineHorizontal, Check } from 'phosphor-react'
import { TickedRangeSlider } from '../../elements/TickedRangeSlider'
import { showSuccessToast } from '../../../lib/toastHelpers'
import {
ReaderSettings,
useReaderSettings,
} from '../../../lib/hooks/useReaderSettings'
import { ReaderSettings } from '../../../lib/hooks/useReaderSettings'
import { useCallback, useMemo, useState } from 'react'
import { currentThemeName, updateTheme } from '../../../lib/themeUpdater'
import { LineHeightIncreaseIcon } from '../../elements/images/LineHeightIncreaseIconProps'

View file

@ -1,7 +1,5 @@
import { Separator } from '@radix-ui/react-separator'
import {
ArchiveBox,
DotsThree,
DotsThreeOutline,
HighlighterCircle,
Info,
@ -12,15 +10,9 @@ import {
} from 'phosphor-react'
import { ArticleAttributes } from '../../../lib/networking/queries/useGetArticleQuery'
import { Button } from '../../elements/Button'
import { Box, HStack, SpanBox } from '../../elements/LayoutPrimitives'
import { HStack } from '../../elements/LayoutPrimitives'
import { TooltipWrapped } from '../../elements/Tooltip'
import { styled, theme } from '../../tokens/stitches.config'
import { useReaderSettings } from '../../../lib/hooks/useReaderSettings'
import { useRef } from 'react'
import { setLabelsMutation } from '../../../lib/networking/mutations/setLabelsMutation'
import { Label } from '../../../lib/networking/fragments/labelFragment'
import { SetLabelsModal } from './SetLabelsModal'
import { DropdownMenu } from '../../patterns/DropdownMenu'
import { theme } from '../../tokens/stitches.config'
import { ReaderDropdownMenu } from '../../patterns/ReaderDropdownMenu'
export type ArticleActionsMenuLayout = 'top' | 'side'

View file

@ -14,7 +14,6 @@ import { StyledTextArea } from '../../elements/StyledTextArea'
import { updatePageMutation } from '../../../lib/networking/mutations/updatePageMutation'
import { showErrorToast, showSuccessToast } from '../../../lib/toastHelpers'
import dayjs, { Dayjs } from 'dayjs'
import { X } from 'phosphor-react'
import { ArticleAttributes } from '../../../lib/networking/queries/useGetArticleQuery'
import { CloseButton } from '../../elements/CloseButton'
@ -72,7 +71,7 @@ export function EditLibraryItemModal(
}
})()
},
[]
[props]
)
return (
@ -147,7 +146,7 @@ export function EditArticleModal(props: EditArticleModalProps): JSX.Element {
}
})()
},
[]
[props]
)
return (

View file

@ -1,4 +1,4 @@
import { Box, HStack, SpanBox, VStack } from './../../elements/LayoutPrimitives'
import { Box, HStack, VStack } from './../../elements/LayoutPrimitives'
import Dropzone from 'react-dropzone'
import * as Progress from '@radix-ui/react-progress'
import type {
@ -21,10 +21,7 @@ import { AddLinkModal } from './AddLinkModal'
import { styled, theme } from '../../tokens/stitches.config'
import { ListLayoutIcon } from '../../elements/images/ListLayoutIcon'
import { GridLayoutIcon } from '../../elements/images/GridLayoutIcon'
import {
libraryListCommands,
searchBarCommands,
} from '../../../lib/keyboardShortcuts/navigationShortcuts'
import { libraryListCommands } from '../../../lib/keyboardShortcuts/navigationShortcuts'
import { useKeyboardShortcuts } from '../../../lib/keyboardShortcuts/useKeyboardShortcuts'
import { Toaster } from 'react-hot-toast'
import { useFetchMore } from '../../../lib/hooks/useFetchMoreScroll'