Skip to content

Commit ac7ea38

Browse files
authored
fix(scrollable-table): responsiveness (#1244)
Signed-off-by: David Edler <[email protected]>
1 parent 57ca497 commit ac7ea38

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

src/components/ScrollableTable/ScrollableTable.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
width: 100%;
3636
}
3737

38-
@media screen and (max-width: $breakpoint-large) {
38+
@media screen and (width < $breakpoint-large) {
3939
.p-table--mobile-card {
4040
thead {
4141
display: none;

src/components/ScrollableTable/ScrollableTable.stories.tsx

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ export default meta;
1313

1414
type Story = StoryObj<typeof ScrollableTable>;
1515

16-
const StoryExample = (args: Story["args"]) => {
16+
const StoryExample = (args: Story["args"] & { responsive?: boolean }) => {
1717
const headers = [
1818
{ content: "Fact" },
1919
{ content: "Relevancy score" },
2020
{ content: "Size" },
2121
{ content: "ID" },
22-
{ "aria-label": "Actions", className: "actions" },
2322
];
2423

2524
const facts = [
@@ -57,7 +56,12 @@ const StoryExample = (args: Story["args"]) => {
5756
dependencies={[headers, rows]}
5857
tableId="facts-about-dragons"
5958
>
60-
<MainTable headers={headers} rows={rows} id="facts-about-dragons" />
59+
<MainTable
60+
headers={headers}
61+
rows={rows}
62+
responsive={args["responsive"]}
63+
id="facts-about-dragons"
64+
/>
6165
</ScrollableTable>
6266
<div id="footer">
6367
<h2 className="u-no-margin">Below contents</h2>
@@ -84,3 +88,21 @@ export const Default: Story = {
8488
},
8589
},
8690
};
91+
92+
export const Responsive: Story = {
93+
args: {
94+
belowIds: ["footer"],
95+
},
96+
render: (args) => StoryExample({ ...args, responsive: true }),
97+
parameters: {
98+
docs: {
99+
page: () => (
100+
<>
101+
<Title />
102+
<Subtitle />
103+
<Description />
104+
</>
105+
),
106+
},
107+
},
108+
};

0 commit comments

Comments
 (0)