fix
This commit is contained in:
parent
6eb27d12c3
commit
121680cbaa
|
@ -7,7 +7,7 @@ import { USAState } from './usa-state'
|
||||||
export type ClickHandler<E = SVGPathElement | SVGCircleElement, R = any> = (
|
export type ClickHandler<E = SVGPathElement | SVGCircleElement, R = any> = (
|
||||||
e: React.MouseEvent<E, MouseEvent>
|
e: React.MouseEvent<E, MouseEvent>
|
||||||
) => R
|
) => R
|
||||||
export type GetClickHandler = (stateKey: string) => ClickHandler
|
export type GetClickHandler = (stateKey: string) => ClickHandler | undefined
|
||||||
export type CustomizeObj = {
|
export type CustomizeObj = {
|
||||||
fill?: string
|
fill?: string
|
||||||
clickHandler?: ClickHandler
|
clickHandler?: ClickHandler
|
||||||
|
@ -62,9 +62,7 @@ export const USAMap = ({
|
||||||
const fillStateColor = (state: string) =>
|
const fillStateColor = (state: string) =>
|
||||||
customize?.[state]?.fill ? (customize[state].fill as string) : defaultFill
|
customize?.[state]?.fill ? (customize[state].fill as string) : defaultFill
|
||||||
|
|
||||||
const stateClickHandler = (state: string) =>
|
const stateClickHandler = (state: string) => customize?.[state]?.clickHandler
|
||||||
customize?.[state]?.clickHandler
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
|
|
Loading…
Reference in New Issue
Block a user