Skip to content

Commit

Permalink
Remove defaultProps from MiniMap.tsx (#2615)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Part of #2596 

## Description of the changes
- 

## How was this change tested?
- 

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: cs-308-2023 <[email protected]>
  • Loading branch information
ADI-ROXX authored Jan 27, 2025
1 parent 4e668e9 commit dc642b0
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions packages/plexus/src/zoom/MiniMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,19 @@ 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`,
button: `${base}--button`,
};
}

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 (
Expand All @@ -103,9 +102,4 @@ export function MiniMap(props: TProps) {
);
}

MiniMap.defaultProps = {
className: '',
classNamePrefix: 'plexus',
};

export default React.memo(MiniMap);

0 comments on commit dc642b0

Please sign in to comment.