Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon-docs/ArgsTable: Fix sort parameter propagation #14422

Merged
merged 1 commit into from Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions addons/docs/src/blocks/ArgsTable.tsx
Expand Up @@ -132,7 +132,7 @@ export const StoryTable: FC<
parameters: { argTypes },
storyStore,
} = context;
const { story, component, subcomponents, showComponent, include, exclude } = props;
const { story, component, subcomponents, showComponent, include, exclude, sort } = props;
let storyArgTypes;
try {
let storyId;
Expand Down Expand Up @@ -187,7 +187,7 @@ export const StoryTable: FC<
}
tabs = addComponentTabs(tabs, subcomponents, context, include, exclude);
}
return <TabbedArgsTable tabs={tabs} />;
return <TabbedArgsTable tabs={tabs} sort={sort} />;
} catch (err) {
return <PureArgsTable error={err.message} />;
}
Expand Down
3 changes: 2 additions & 1 deletion lib/components/src/blocks/ArgsTable/TabbedArgsTable.tsx
@@ -1,9 +1,10 @@
import React, { FC } from 'react';
import { ArgsTable, ArgsTableProps } from './ArgsTable';
import { ArgsTable, ArgsTableProps, SortType } from './ArgsTable';
import { TabsState } from '../../tabs/tabs';

export interface TabbedArgsTableProps {
tabs: Record<string, ArgsTableProps>;
sort?: SortType;
}

export const TabbedArgsTable: FC<TabbedArgsTableProps> = ({ tabs, ...props }) => {
Expand Down