Skip to content

Commit 6a51a6f

Browse files
fix: resolve remaining SonarCloud maintainability issues
- Add explicit type annotations to useState calls in ChevronIcon - Make function parameters readonly in DropdownChevron components - Addresses final 4 SonarCloud code smells from TypeScript conversion Co-Authored-By: [email protected] <[email protected]>
1 parent fef591f commit 6a51a6f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/core_modules/capture-ui/Icons/ChevronIcon.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ const styles: Readonly<any> = {
4747
};
4848

4949
const ChevronIconPlain = ({ open, onOpen, onClose, dataTest, disabled, classes }: ChevronIconProps & WithStyles<typeof styles>) => {
50-
const [postEffectOpen, setPostEffectOpen] = useState(open);
51-
const [animationsReady, setAnimationsReady] = useState(false);
50+
const [postEffectOpen, setPostEffectOpen] = useState<boolean>(open);
51+
const [animationsReady, setAnimationsReady] = useState<boolean>(false);
5252

5353
const handleClick = () => {
5454
if (disabled) {

src/core_modules/capture-ui/Icons/DropdownChevron.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type Props = Readonly<{
44
className?: string;
55
}>;
66

7-
export function ChevronDown({ className }: Props) {
7+
export function ChevronDown({ className }: Readonly<Props>) {
88
return (
99
<svg
1010
xmlns="http://www.w3.org/2000/svg"
@@ -17,7 +17,7 @@ export function ChevronDown({ className }: Props) {
1717
);
1818
}
1919

20-
export function ChevronUp({ className }: Props) {
20+
export function ChevronUp({ className }: Readonly<Props>) {
2121
return (
2222
<svg
2323
xmlns="http://www.w3.org/2000/svg"

0 commit comments

Comments
 (0)