Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Sep 1, 2024
1 parent cf34175 commit ac23fb6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/components/QuestCard/MinimalQuestCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Card, Elevation, Text, Tooltip } from '@blueprintjs/core'
import React, { forwardRef } from 'react'
import type { StyledComponentProps } from 'styled-components'
import React, { ComponentPropsWithoutRef, forwardRef } from 'react'
import { guessQuestCategory, QUEST_STATUS } from '../../questHelper'
import type { QuestCardProps } from './index'
import { CardBody, CardTail, CatIndicator, FlexCard } from './styles'
Expand All @@ -11,8 +10,7 @@ import { questStatusMap } from './utils'
*/
export const MinimalQuestCard = forwardRef<
Card,
// eslint-disable-next-line @typescript-eslint/ban-types
QuestCardProps & StyledComponentProps<typeof Card, any, {}, never>
QuestCardProps & ComponentPropsWithoutRef<typeof FlexCard>
>(({ code, name, desc, tip, status = QUEST_STATUS.DEFAULT, ...props }, ref) => {
const indicatorColor = guessQuestCategory(code).color
const TailIcon = questStatusMap[status]
Expand Down
5 changes: 2 additions & 3 deletions src/components/QuestCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import {
Popover,
} from '@blueprintjs/core'
import { IconNames } from '@blueprintjs/icons'
import React, { forwardRef } from 'react'
import React, { ComponentPropsWithoutRef, forwardRef } from 'react'
// https://github.com/bvaughn/react-highlight-words
import Highlighter from 'react-highlight-words'
import type { StyledComponentProps } from 'styled-components'
import { usePluginTranslation } from '../../poi/hooks'
import {
QUEST_STATUS,
Expand Down Expand Up @@ -80,7 +79,7 @@ const CardAction = ({ gameId }: { gameId: number }) => {

export const QuestCard = forwardRef<
Card,
QuestCardProps & StyledComponentProps<typeof Card, any, object, never>
QuestCardProps & ComponentPropsWithoutRef<typeof FlexCard>
>(({ gameId, code, name, desc, tip, tip2, ...props }, ref) => {
const status = useQuestStatus(gameId)
const headIcon = questIconMap[guessQuestCategory(code).type]
Expand Down
2 changes: 1 addition & 1 deletion src/components/QuestList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const QuestList = ({ quests }: { quests: UnionQuest[] }) => {
return (
<QuestListWrapper>
<AutoSizer>
{({ height, width }) => (
{({ height, width }: { height: number; width: number }) => (
<ListWrapper
ref={listRef}
height={height}
Expand Down

0 comments on commit ac23fb6

Please sign in to comment.