fix(dashboard-v2): improve Tabs to fill available height
This commit is contained in:
parent
97240d128b
commit
901d2b4ba8
|
@ -3,17 +3,17 @@ import PropTypes from "prop-types";
|
|||
/**
|
||||
* Besides documented props, it accepts all HMTL attributes a `<div>` element does.
|
||||
*/
|
||||
export const TabPanel = ({ children, active, tabId, ...props }) => {
|
||||
if (!active) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div role="tabpanel" id={`tabpanel-${tabId}`} aria-labelledby={`tab-${tabId}`} {...props}>
|
||||
export const TabPanel = ({ children, active, tabId, ...props }) => (
|
||||
<div
|
||||
role="tabpanel"
|
||||
id={`tabpanel-${tabId}`}
|
||||
aria-labelledby={`tab-${tabId}`}
|
||||
{...props}
|
||||
style={{ display: active ? "block" : "none" }}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
);
|
||||
|
||||
TabPanel.propTypes = {
|
||||
/**
|
||||
|
|
|
@ -6,11 +6,11 @@ import { ActiveTabIndicator } from "./ActiveTabIndicator";
|
|||
import { usePrefixedTabIds, useTabsChildren } from "./hooks";
|
||||
|
||||
const Container = styled.div.attrs({
|
||||
className: "tabs-container",
|
||||
className: "tabs-container flex flex-col h-full",
|
||||
})``;
|
||||
|
||||
const Header = styled.div.attrs({
|
||||
className: "relative flex justify-start overflow-hidden",
|
||||
className: "relative flex justify-start overflow-hidden grow-0 shrink-0",
|
||||
})``;
|
||||
|
||||
const TabList = styled.div.attrs(({ variant }) => ({
|
||||
|
@ -26,7 +26,7 @@ const Divider = styled.div.attrs({
|
|||
right: calc(-100vw - 2px);
|
||||
`;
|
||||
|
||||
const Body = styled.div``;
|
||||
const Body = styled.div.attrs({ className: "grow min-h-0" })``;
|
||||
|
||||
/**
|
||||
* Besides documented props, it accepts all HMTL attributes a `<div>` element does.
|
||||
|
|
Reference in New Issue