Skip to content

Commit

Permalink
Merge branch 'staging' of https://github.com/dothq/scalar into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
ejaz4 committed Jul 20, 2023
2 parents dc5273b + 86ffb66 commit de37114
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/components/ui/Tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Button, { ButtonProps } from "../Button";
export interface Tab {
value: string;
label: string;
disabled?: boolean;
children?: any;
}

Expand Down Expand Up @@ -38,6 +39,7 @@ export const Tabs = ({
colour={rest.colour}
fullwidth
htmlFor={`tab__${tab.value}`}
disabled={tab.disabled || false}
as={"label"}
style={{
"--no-js-pos": "absolute",
Expand All @@ -52,7 +54,9 @@ export const Tabs = ({
{tab.label}
</Button>
<div hidden style={{ paddingTop: "45px" }}>
{tab.children()}
{typeof tab.children == "function"
? tab.children()
: tab.children}
</div>
</>
))}
Expand Down
5 changes: 5 additions & 0 deletions ui/foundation/components/button/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,8 @@
:root.no-js .fdn-button.no-js + .fdn-button:not(.no-js) {
display: none;
}

.fdn-button[disabled] {
opacity: 0.5;
pointer-events: none;
}
4 changes: 4 additions & 0 deletions ui/foundation/components/tabs/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
.fdn-tab:hover {
--tab-border-bottom: 2px solid var(--fdn-colours-gray);
}

.fdn-tab[disabled] {
background-color: var(--fdn-colours-black-secondary);
}
}

:root:not(.no-js) .fdn-tabs {
Expand Down

0 comments on commit de37114

Please sign in to comment.