Merge branch 'release' of https://github.com/appsmithorg/appsmith into release

This commit is contained in:
Automated Github Action 2020-08-06 09:04:55 +00:00
commit 409c2c09c4
3 changed files with 23 additions and 16 deletions

View File

@ -9,6 +9,7 @@ interface TabsComponentProps extends ComponentProps {
children?: ReactNode;
shouldScrollContents?: boolean;
selectedTabId: string;
shouldShowTabs: boolean;
onTabChange: (tabId: string) => void;
tabs: Array<{
id: string;
@ -112,22 +113,26 @@ const TabsComponent = (props: TabsComponentProps) => {
}, [props.shouldScrollContents]);
return (
<TabsContainerWrapper ref={tabContainerRef}>
<TabsContainer>
{props.tabs &&
props.tabs.map((tab, index) => (
<StyledText
onClick={(event: React.MouseEvent<HTMLDivElement>) => {
props.onTabChange(tab.id);
event.stopPropagation();
}}
selected={props.selectedTabId === tab.id}
key={index}
>
{tab.label}
</StyledText>
))}
<StyledTab></StyledTab>
</TabsContainer>
{props.shouldShowTabs ? (
<TabsContainer>
{props.tabs &&
props.tabs.map((tab, index) => (
<StyledText
onClick={(event: React.MouseEvent<HTMLDivElement>) => {
props.onTabChange(tab.id);
event.stopPropagation();
}}
selected={props.selectedTabId === tab.id}
key={index}
>
{tab.label}
</StyledText>
))}
<StyledTab></StyledTab>
</TabsContainer>
) : (
undefined
)}
<ChildrenWrapper>
<ScrollableCanvasWrapper
{...props}

View File

@ -180,6 +180,7 @@ const WidgetConfigResponse: WidgetConfigReducerState = {
{ label: "Tab 1", id: "tab1" },
{ label: "Tab 2", id: "tab2" },
],
shouldShowTabs: true,
selectedTab: "Tab 1",
blueprint: {
view: [

View File

@ -163,6 +163,7 @@ export interface TabsWidgetProps<T extends TabContainerWidgetProps>
id: string;
label: string;
}>;
shouldShowTabs: boolean;
children: T[];
snapColumns?: number;
snapRows?: number;