diff --git a/packages/plexus/src/zoom/MiniMap.tsx b/packages/plexus/src/zoom/MiniMap.tsx index 4bc76104fe..11b5f3978b 100644 --- a/packages/plexus/src/zoom/MiniMap.tsx +++ b/packages/plexus/src/zoom/MiniMap.tsx @@ -69,11 +69,10 @@ function getViewTransform(props: TProps, displaySize: { width: number; height: n }; } -function getClassNames(props: TProps) { - const { className, classNamePrefix } = props; - const base = `${classNamePrefix || 'plexus'}-MiniMap`; +function getClassNames(className: string, classNamePrefix: string) { + const base = `${classNamePrefix}-MiniMap`; return { - root: `${base} ${className || ''}`, + root: `${base} ${className}`, item: `${base}--item`, map: `${base}--map`, mapActive: `${base}--mapActive`, @@ -81,8 +80,8 @@ function getClassNames(props: TProps) { }; } -export function MiniMap(props: TProps) { - const css = getClassNames(props); +export function MiniMap({ className = '', classNamePrefix = 'plexus', ...props }: TProps) { + const css = getClassNames(className, classNamePrefix); const mapSize = getMapSize(props); const activeXform = getViewTransform(props, mapSize); return ( @@ -103,9 +102,4 @@ export function MiniMap(props: TProps) { ); } -MiniMap.defaultProps = { - className: '', - classNamePrefix: 'plexus', -}; - export default React.memo(MiniMap);