Skip to content

Commit

Permalink
chore: add type for theme variable
Browse files Browse the repository at this point in the history
  • Loading branch information
uigywnkiub committed Jul 28, 2024
1 parent df4b214 commit 858c448
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/ui/categories/custom-emoji-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import EmojiPicker, {
Theme,
} from 'emoji-picker-react'

import { TTheme } from '@/app/lib/types'

type TProps = {
showEmojiPicker: boolean
onEmojiClick: (emojiData: EmojiClickData) => void
Expand All @@ -24,7 +26,7 @@ function CustomEmojiPicker({ showEmojiPicker, onEmojiClick }: TProps) {
searchPlaceHolder='Search emoji...'
// width={300}
// height={400}
theme={theme === 'system' ? Theme.AUTO : (theme as Theme)}
theme={(theme as TTheme) === 'system' ? Theme.AUTO : (theme as Theme)}
suggestedEmojisMode={SuggestionMode.RECENT}
skinTonePickerLocation={SkinTonePickerLocation.PREVIEW}
className='my-2'
Expand Down
4 changes: 2 additions & 2 deletions app/ui/transaction-form-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { DEFAULT_CURRENCY_SIGN } from '@/config/constants/main'
import { ROUTE } from '@/config/constants/routes'

import { editTransactionById } from '../lib/actions'
import type { TTransaction } from '../lib/types'
import type { TTheme, TTransaction } from '../lib/types'
import {
capitalizeFirstLetter,
getCategoryWithEmoji,
Expand Down Expand Up @@ -257,7 +257,7 @@ function TransactionFormEdit({ transaction }: TProps) {
isDisabled={
!amount || amount === '0' || isLoading || !isCategorySelect
}
className={`${isCategorySelect && isTransactionWithChangedCategory ? `animate-blink-${theme === 'system' ? 'light' : theme}-once` : ''} cursor-pointer bg-background px-0`}
className={`${isCategorySelect && isTransactionWithChangedCategory ? `animate-blink-${(theme as TTheme) === 'system' ? 'light' : theme}-once` : ''} cursor-pointer bg-background px-0`}
size='sm'
>
<Kbd keys={['enter']}>Enter</Kbd>
Expand Down

0 comments on commit 858c448

Please sign in to comment.