Skip to content

Commit feeead4

Browse files
Move display names to exported components
1 parent 70a5c2b commit feeead4

File tree

73 files changed

+145
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+145
-68
lines changed

src/components/content-presentation/details/Details.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ const ExpanderGroup: FC<HTMLProps<HTMLDivElement>> = ({ className, ...rest }) =>
3232
<div className={classNames('nhsuk-expander-group', className)} {...rest} />
3333
);
3434

35+
DetailsComponent.displayName = 'Details';
36+
DetailsSummary.displayName = 'Details.Summary';
37+
DetailsText.displayName = 'Details.Text';
38+
ExpanderGroup.displayName = 'Details.ExpanderGroup';
39+
3540
DetailsComponent.Summary = DetailsSummary;
3641
DetailsComponent.Text = DetailsText;
3742
DetailsComponent.ExpanderGroup = ExpanderGroup;

src/components/content-presentation/do-and-dont-list/DoAndDontList.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ const DoAndDontItem: FC<DoAndDontItemProps> = ({ prefixText, listItemType, child
7171
);
7272
};
7373

74+
DoAndDontListComponent.displayName = 'DoAndDontList';
75+
DoAndDontItem.displayName = 'DoAndDontList.Item';
76+
7477
DoAndDontListComponent.Item = DoAndDontItem;
7578

7679
export default DoAndDontListComponent;

src/components/content-presentation/hero/Hero.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ const HeroComponent: HeroComponent = ({ className, children, imageSrc, ...rest }
7575
</section>
7676
);
7777

78+
HeroComponent.displayName = 'Hero';
79+
HeroHeading.displayName = 'Hero.Heading';
80+
HeroText.displayName = 'Hero.Text';
81+
7882
HeroComponent.Heading = HeroHeading;
7983
HeroComponent.Text = HeroText;
8084

src/components/content-presentation/images/Images.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ const ImagesComponent: FC<ImageProps> = ({ className, caption, ...rest }) => (
1616
</figure>
1717
);
1818

19+
ImagesComponent.displayName = 'Images';
20+
1921
export default ImagesComponent;

src/components/content-presentation/inset-text/InsetText.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ const InsetTextComponent: FC<HTMLProps<HTMLDivElement>> = ({ className, children
88
</div>
99
);
1010

11+
InsetTextComponent.displayName = 'InsetText';
12+
1113
export default InsetTextComponent;

src/components/content-presentation/summary-list/SummaryList.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ const SummaryListComponent: SummaryListComponent = ({ className, noBorder, ...re
3939
/>
4040
);
4141

42+
SummaryListComponent.displayName = 'SummaryList';
43+
SummaryListRow.displayName = 'SummaryList.Row';
44+
SummaryListKey.displayName = 'SummaryList.Key';
45+
SummaryListValue.displayName = 'SummaryList.Value';
46+
SummaryListActions.displayName = 'SummaryList.Actions';
47+
4248
SummaryListComponent.Row = SummaryListRow;
4349
SummaryListComponent.Key = SummaryListKey;
4450
SummaryListComponent.Value = SummaryListValue;

src/components/content-presentation/table/Table.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ const TableComponent = ({
5959
);
6060
};
6161

62-
TableComponent.Body = TableBody;
63-
TableComponent.Cell = TableCell;
62+
TableComponent.displayName = 'Table';
63+
6464
TableComponent.Container = TableContainer;
65-
TableComponent.Head = TableHead;
6665
TableComponent.Panel = TablePanel;
66+
TableComponent.Head = TableHead;
67+
TableComponent.Body = TableBody;
6768
TableComponent.Row = TableRow;
69+
TableComponent.Cell = TableCell;
6870

6971
export default TableComponent;

src/components/content-presentation/table/components/TablePanel.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ const TablePanel: FC<TablePanelProps> = ({
2828
</div>
2929
);
3030

31+
TablePanel.displayName = 'Table.Panel';
32+
3133
export default TablePanel;

src/components/content-presentation/tabs/Tabs.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ const TabsComponent: TabsComponent = ({ className, children, ...rest }) => {
7777
);
7878
};
7979

80+
TabsComponent.displayName = 'Tabs';
81+
TabTitle.displayName = 'Tabs.Title';
82+
TabList.displayName = 'Tabs.List';
83+
TabListItem.displayName = 'Tabs.ListItem';
84+
TabContents.displayName = 'Tabs.Contents';
85+
8086
TabsComponent.Title = TabTitle;
8187
TabsComponent.List = TabList;
8288
TabsComponent.ListItem = TabListItem;

src/components/content-presentation/tag/Tag.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ const TagComponent: FC<TagProps> = ({ className, color, modifier = color, ...res
2727
/>
2828
);
2929

30+
TagComponent.displayName = 'Tag';
31+
3032
export default TagComponent;

0 commit comments

Comments
 (0)