|
1 | 1 | import React from 'react'; |
2 | | -import { makeStyles } from '@material-ui/styles'; |
| 2 | +import { makeStyles, withStyles } from '@material-ui/styles'; |
3 | 3 | import Tabs from '@material-ui/core/Tabs'; |
4 | 4 | import Tab from '@material-ui/core/Tab'; |
5 | 5 | import Typography from '@material-ui/core/Typography'; |
6 | 6 |
|
| 7 | +const StyledTabs = withStyles({ |
| 8 | + indicator: { |
| 9 | + display: 'flex', |
| 10 | + justifyContent: 'center', |
| 11 | + backgroundColor: 'transparent', |
| 12 | + '& > div': { |
| 13 | + maxWidth: 40, |
| 14 | + width: '100%', |
| 15 | + backgroundColor: '#635ee7', |
| 16 | + }, |
| 17 | + }, |
| 18 | +})(props => <Tabs {...props} TabIndicatorProps={{ children: <div /> }} />); |
| 19 | + |
| 20 | +const StyledTab = withStyles(theme => ({ |
| 21 | + root: { |
| 22 | + textTransform: 'initial', |
| 23 | + color: '#fff', |
| 24 | + fontWeight: theme.typography.fontWeightRegular, |
| 25 | + fontSize: theme.typography.pxToRem(15), |
| 26 | + marginRight: theme.spacing(1), |
| 27 | + }, |
| 28 | +}))(props => <Tab disableRipple {...props} />); |
| 29 | + |
7 | 30 | const useStyles = makeStyles(theme => ({ |
8 | 31 | root: { |
9 | 32 | flexGrow: 1, |
@@ -48,6 +71,9 @@ const useStyles = makeStyles(theme => ({ |
48 | 71 | typography: { |
49 | 72 | padding: theme.spacing(3), |
50 | 73 | }, |
| 74 | + demo2: { |
| 75 | + backgroundColor: '#2e1534', |
| 76 | + }, |
51 | 77 | })); |
52 | 78 |
|
53 | 79 | function CustomizedTabs() { |
@@ -82,6 +108,14 @@ function CustomizedTabs() { |
82 | 108 | /> |
83 | 109 | </Tabs> |
84 | 110 | <Typography className={classes.typography}>Ant Design UI powered by Material-UI</Typography> |
| 111 | + <div className={classes.demo2}> |
| 112 | + <StyledTabs value={value} onChange={handleChange}> |
| 113 | + <StyledTab label="Workflows" /> |
| 114 | + <StyledTab label="Datasets" /> |
| 115 | + <StyledTab label="Connections" /> |
| 116 | + </StyledTabs> |
| 117 | + <Typography className={classes.typography} /> |
| 118 | + </div> |
85 | 119 | </div> |
86 | 120 | ); |
87 | 121 | } |
|
0 commit comments