Skip to content

Commit 11d4d74

Browse files
committed
change: Use TypeScript for IconDivider
Adapt IconDivider to work with typed withComponentDefault HOC.
1 parent 71b665b commit 11d4d74

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/web/components/layout/Divider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface DividerComponentProps {
1414
$margin: string;
1515
}
1616

17-
interface DividerProps extends LayoutProps {
17+
export interface DividerProps extends LayoutProps {
1818
flex?: string;
1919
margin?: string;
2020
}
@@ -45,7 +45,7 @@ const DividerContainer = styled(Layout)`
4545

4646
DividerContainer.displayName = 'DividerContainer';
4747

48-
const Divider: React.FC<DividerProps> = ({
48+
const Divider = ({
4949
margin = DEFAULT_MARGIN,
5050
grow,
5151
flex,

src/web/components/layout/IconDivider.jsx renamed to src/web/components/layout/IconDivider.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6-
import Divider from 'web/components/layout/Divider';
6+
import Divider, {DividerProps} from 'web/components/layout/Divider';
77
import withComponentDefaults from 'web/utils/withComponentDefaults';
88

9-
const IconDivider = withComponentDefaults({margin: '5px'})(Divider);
9+
const IconDivider = withComponentDefaults<DividerProps>({margin: '5px'})(
10+
Divider,
11+
);
1012

1113
IconDivider.displayName = 'IconDivider';
1214

0 commit comments

Comments
 (0)