Skip to content

Commit 49d0526

Browse files
lint named component
1 parent 6e4f8b9 commit 49d0526

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

app/src/app/components/sidebar/charts/HorizontalBarChart.tsx

+12-9
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,16 @@ export const HorizontalBar = () => {
154154
};
155155

156156

157-
const getRenderCustomBarLabel: (lockPaintedAreas: MapStore['mapOptions']['lockPaintedAreas']) => React.FC<any> = (lockPaintedAreas) => ({ y, height, index, value }) => {
158-
const entryIsLocked = Array.isArray(lockPaintedAreas) && lockPaintedAreas.indexOf(index+1) !== -1
159-
160-
if (!entryIsLocked || !value) {
161-
return null
157+
const getRenderCustomBarLabel: (lockPaintedAreas: MapStore['mapOptions']['lockPaintedAreas']) => React.FC<any> = (lockPaintedAreas) => {
158+
const InnerComponent: React.FC<any> = ({ y, height, index, value }) => {
159+
const entryIsLocked = Array.isArray(lockPaintedAreas) && lockPaintedAreas.indexOf(index+1) !== -1
160+
161+
if (!entryIsLocked || !value) {
162+
return null
163+
}
164+
return <g transform={`translate(${10}, ${y+height/2-9}), scale(1.25)`}>
165+
<path d="M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path>
166+
</g>;
162167
}
163-
return <g transform={`translate(${10}, ${y+height/2-9}), scale(1.25)`}>
164-
<path d="M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path>
165-
</g>;
166-
};
168+
return InnerComponent
169+
}

0 commit comments

Comments
 (0)