Web: TabsContainer: Added support for adding a border.

This commit is contained in:
Tatiana Lopaeva 2023-12-07 17:09:44 +03:00
parent 8cb87da1d5
commit 83e1180c37
5 changed files with 15 additions and 3 deletions

View File

@ -181,7 +181,8 @@ class TabContainer extends Component {
render() { render() {
//console.log("Tabs container render"); //console.log("Tabs container render");
const { isDisabled, elements, withBodyScroll, multiple } = this.props; const { isDisabled, elements, withBodyScroll, multiple, withBorder } =
this.props;
const { activeTab, onScrollHide } = this.state; const { activeTab, onScrollHide } = this.state;
const content = ( const content = (
@ -204,6 +205,7 @@ class TabContainer extends Component {
selected={isSelected} selected={isSelected}
isDisabled={isDisabled} isDisabled={isDisabled}
multiple={multiple} multiple={multiple}
withBorder={withBorder}
> >
<Text fontWeight={600} className="title_style" fontSize="13px"> <Text fontWeight={600} className="title_style" fontSize="13px">
{item.title} {item.title}
@ -247,12 +249,15 @@ TabContainer.propTypes = {
withBodyScroll: PropTypes.bool, withBodyScroll: PropTypes.bool,
/** Enables multiple select */ /** Enables multiple select */
multiple: PropTypes.bool, multiple: PropTypes.bool,
/** Indicates that component contain border */
withBorder: PropTypes.bool,
}; };
TabContainer.defaultProps = { TabContainer.defaultProps = {
selectedItem: 0, selectedItem: 0,
withBodyScroll: true, withBodyScroll: true,
multiple: false, multiple: false,
withBorder: false,
}; };
export default TabContainer; export default TabContainer;

View File

@ -27,6 +27,11 @@ NavItem.defaultProps = { theme: Base };
const Label = styled.div` const Label = styled.div`
height: ${(props) => props.theme.tabsContainer.label.height}; height: ${(props) => props.theme.tabsContainer.label.height};
border-radius: ${(props) => props.theme.tabsContainer.label.borderRadius}; border-radius: ${(props) => props.theme.tabsContainer.label.borderRadius};
${(props) =>
props.withBorder &&
css`
border: ${props.theme.tabsContainer.label.border};
`}
min-width: ${(props) => props.theme.tabsContainer.label.minWidth}; min-width: ${(props) => props.theme.tabsContainer.label.minWidth};
width: ${(props) => props.theme.tabsContainer.label.width}; width: ${(props) => props.theme.tabsContainer.label.width};

View File

@ -976,6 +976,7 @@ const Base = {
backgroundColor: blueLightMid, backgroundColor: blueLightMid,
hoverBackgroundColor: grayLight, hoverBackgroundColor: grayLight,
disableBackgroundColor: grayLightMid, disableBackgroundColor: grayLightMid,
border: `1px solid ${grayLightMid}`,
title: { title: {
margin: "7px 15px 7px 15px", margin: "7px 15px 7px 15px",

View File

@ -48,7 +48,7 @@ const {
strongBlue, strongBlue,
lightGrayishStrongBlue, lightGrayishStrongBlue,
darkRed, darkRed,
darkDividersColor,
darkErrorStatus, darkErrorStatus,
} = globalColors; } = globalColors;
@ -966,7 +966,7 @@ const Dark = {
backgroundColor: "#d6d6d6", backgroundColor: "#d6d6d6",
hoverBackgroundColor: "#3D3D3D", hoverBackgroundColor: "#3D3D3D",
disableBackgroundColor: "#292929", disableBackgroundColor: "#292929",
border: `1px solid ${darkDividersColor}`,
title: { title: {
margin: "7px 15px 7px 15px", margin: "7px 15px 7px 15px",
overflow: "hidden", overflow: "hidden",

View File

@ -6,6 +6,7 @@ const globalColors = {
grayLight: "#F8F9F9", grayLight: "#F8F9F9",
grayMaxLight: "#eeeeee", grayMaxLight: "#eeeeee",
grayLightMid: "#ECEEF1", grayLightMid: "#ECEEF1",
darkDividersColor: "#242424",
graySilver: "#D8D8D8", graySilver: "#D8D8D8",
grayMid: "#D0D5DA", grayMid: "#D0D5DA",
gray: "#A3A9AE", gray: "#A3A9AE",