Skip to content

Commit

Permalink
fix(web): ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyao27 committed Aug 9, 2022
1 parent 9d9546a commit 46e6ed4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/web/src/components/editAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ const EditAlert: FC<Props> = ({ alert, onSubmit }) => {
}, [])
const handleAddCondition = useCallback((topic: ConditionOption['topic']) => {
if (topic) {
conditionsAppend({ topic })
conditionsAppend({ topic, name: ConditionOptions.find(v => v.topic === topic)!.name })
}
}, [])
const handleAddFilter = useCallback((topic: FilterOption['topic']) => {
if (topic) {
filtersAppend({ topic })
filtersAppend({ topic, name: FilterOptions.find(v => v.topic === topic)!.name })
}
}, [])

Expand Down
18 changes: 9 additions & 9 deletions packages/web/src/styles/theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Dict } from '@chakra-ui/utils'
import { extendTheme } from '@chakra-ui/react'
import type { StyleFunctionProps } from '@chakra-ui/theme-tools'
import type { GlobalStyleProps } from '@chakra-ui/theme-tools'
import { mode } from '@chakra-ui/theme-tools'
import { colors } from './colors'

Expand All @@ -10,19 +10,19 @@ const theme: Dict = extendTheme({
Button: {
defaultProps: { colorScheme: 'dark' },
variants: {
solid: (props: StyleFunctionProps) => ({
solid: (props: GlobalStyleProps) => ({
bg: mode('dark.500', 'gray.50')(props),
_hover: {
textColor: mode('black', 'white')(props),
bg: mode('gray.100', 'dark.500')(props),
},
}),
ghost: (props: StyleFunctionProps) => ({
ghost: (props: GlobalStyleProps) => ({
textColor: mode('black', 'white')(props),
_hover: { bg: mode('gray.100', 'dark.200')(props) },
_active: { textColor: 'white' },
}),
outline: (props: StyleFunctionProps) => ({
outline: (props: GlobalStyleProps) => ({
textColor: mode('gray.400', 'dark.50')(props),
borderColor: mode('gray.400', 'dark.50')(props),
_hover: {
Expand All @@ -36,7 +36,7 @@ const theme: Dict = extendTheme({
},
Input: {
variants: {
outline: (props: StyleFunctionProps) => ({
outline: (props: GlobalStyleProps) => ({
borderColor: mode('gray.200', 'dark.50')(props),
_hover: { borderColor: mode('black', 'white')(props) },
}),
Expand All @@ -45,7 +45,7 @@ const theme: Dict = extendTheme({
Switch: { defaultProps: { colorScheme: 'gray' } },
Tabs: {
variants: {
'enclosed-colored': (props: StyleFunctionProps) => ({
'enclosed-colored': (props: GlobalStyleProps) => ({
tab: {
borderColor: mode('gray.200', 'dark.50')(props),
_selected: {
Expand All @@ -61,7 +61,7 @@ const theme: Dict = extendTheme({
},
},
Menu: {
baseStyle: (props: StyleFunctionProps) => ({
baseStyle: (props: GlobalStyleProps) => ({
divider: { borderColor: mode('gray.200', 'dark.50')(props) },
list: { zIndex: '1300' },
}),
Expand All @@ -87,7 +87,7 @@ const theme: Dict = extendTheme({
},
},
Accordion: {
baseStyle: (props: StyleFunctionProps) => ({
baseStyle: (props: GlobalStyleProps) => ({
container: { borderColor: mode('gray.200', 'dark.50')(props) },
button: {
py: '4',
Expand All @@ -99,7 +99,7 @@ const theme: Dict = extendTheme({
},
},
styles: {
global: (props: StyleFunctionProps) => ({
global: (props: GlobalStyleProps) => ({
'html, body, #__next': { width: '100%', minHeight: '100vh' },
'body': {
bg: mode('white', 'dark.800')(props),
Expand Down
1 change: 0 additions & 1 deletion packages/web/tsconfig.tsbuildinfo

This file was deleted.

0 comments on commit 46e6ed4

Please sign in to comment.