Skip to content

Commit

Permalink
chore: change component functions to arrow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandar-r committed Mar 22, 2024
1 parent 2f8214a commit 996c965
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/core/Accordion/component.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useState, Node, JSX, FC } from "react";
import React, { useState, ReactNode, JSX, FC } from "react";
import Icon from "../Icon/component.jsx";

export type AccordionData = {
name: string;
content: Node;
content: ReactNode;
};

export type AccordionRowProps = {
Expand All @@ -13,7 +13,7 @@ export type AccordionRowProps = {
last: boolean;
name: string;
index: number;
children: Node;
children: ReactNode;
arrowIcon: boolean;
activeIndex: number;
setActiveIndex: (index: number) => void;
Expand All @@ -27,7 +27,7 @@ export type AccordionProps = {
accordionInPageId: string;
};

function AccordionRow({
const AccordionRow: FC<AccordionRowProps> = ({
name,

Check failure on line 31 in src/core/Accordion/component.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/core/Accordion/component.tsx#L31

'name' is missing in props validation (react/prop-types)
children,

Check failure on line 32 in src/core/Accordion/component.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/core/Accordion/component.tsx#L32

'children' is missing in props validation (react/prop-types)
index,

Check failure on line 33 in src/core/Accordion/component.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/core/Accordion/component.tsx#L33

'index' is missing in props validation (react/prop-types)
Expand All @@ -37,7 +37,7 @@ function AccordionRow({
bottomBorder,

Check failure on line 37 in src/core/Accordion/component.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/core/Accordion/component.tsx#L37

'bottomBorder' is missing in props validation (react/prop-types)
last,

Check failure on line 38 in src/core/Accordion/component.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/core/Accordion/component.tsx#L38

'last' is missing in props validation (react/prop-types)
arrowIcon,

Check failure on line 39 in src/core/Accordion/component.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/core/Accordion/component.tsx#L39

'arrowIcon' is missing in props validation (react/prop-types)
}: FC<AccordionRowProps>) {
}) => {
let iconActive: JSX.Element, iconInactive: JSX.Element;
const handleSetIndex = () => {
if (active) {
Expand Down Expand Up @@ -101,15 +101,15 @@ function AccordionRow({
</section>
</div>
);
}
};

function Accordion({
const Accordion: FC<AccordionProps> = ({
data,

Check failure on line 107 in src/core/Accordion/component.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/core/Accordion/component.tsx#L107

'data' is missing in props validation (react/prop-types)
accordionInPageId = "id-accordion",

Check failure on line 108 in src/core/Accordion/component.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/core/Accordion/component.tsx#L108

'accordionInPageId' is missing in props validation (react/prop-types)
topBorder,

Check failure on line 109 in src/core/Accordion/component.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/core/Accordion/component.tsx#L109

'topBorder' is missing in props validation (react/prop-types)
bottomBorder,

Check failure on line 110 in src/core/Accordion/component.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/core/Accordion/component.tsx#L110

'bottomBorder' is missing in props validation (react/prop-types)
arrowIcon,

Check failure on line 111 in src/core/Accordion/component.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/core/Accordion/component.tsx#L111

'arrowIcon' is missing in props validation (react/prop-types)
}: AccordionProps) {
}) => {
const [activeIndex, setActiveIndex] = useState(null);

return (
Expand Down Expand Up @@ -138,6 +138,6 @@ function Accordion({
})}
</div>
);
}
};

export default Accordion;

0 comments on commit 996c965

Please sign in to comment.