Skip to content

Commit

Permalink
[docs] Add Tidelift banner
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jul 9, 2018
1 parent 8e4b252 commit bbbc1f0
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
57 changes: 57 additions & 0 deletions docs/src/modules/components/Tidelift.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import Link from 'docs/src/modules/components/Link';

const styles = theme => ({
root: {
padding: `${theme.spacing.unit}px ${theme.spacing.unit * 2}px`,
right: 0,
left: 0,
display: 'flex',
backgroundColor: '#626980',
position: 'relative',
top: 56,
[theme.breakpoints.up('sm')]: {
top: 80,
left: 'auto',
position: 'absolute',
borderBottomLeftRadius: 100,
borderTopLeftRadius: 100,
},
},
logo: {
background: 'url(/static/images/tidelift.svg) no-repeat 50%',
content: "''",
width: 20,
height: 20,
margin: `0 ${theme.spacing.unit}px 0 0`,
},
label: {
color: theme.palette.common.white,
fontSize: 15,
},
});

function Tidelift(props) {
const { classes } = props;

return (
<Link
variant="button"
href="https://tidelift.com/subscription/npm/material-ui?hs_preview=vIkVTmHq-5919053988"
target="_blank"
className={classes.root}
>
<span className={classes.logo} />
<Typography className={classes.label}>Get Professionally Supported Material-UI</Typography>
</Link>
);
}

Tidelift.propTypes = {
classes: PropTypes.object.isRequired,
};

export default withStyles(styles)(Tidelift);
2 changes: 2 additions & 0 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Typography from '@material-ui/core/Typography';
import Button from '@material-ui/core/Button';
import withRoot from 'docs/src/modules/components/withRoot';
import HomeSteps from 'docs/src/modules/components/HomeSteps';
import Tidelift from 'docs/src/modules/components/Tidelift';
import HomeBackers from 'docs/src/modules/components/HomeBackers';
import HomeFooter from 'docs/src/modules/components/HomeFooter';
import Link from 'docs/src/modules/components/Link';
Expand Down Expand Up @@ -106,6 +107,7 @@ class HomePage extends React.Component {
}}
/>
<Head />
<Tidelift />
<div className={classes.hero}>
<div className={classes.content}>
<img
Expand Down
1 change: 1 addition & 0 deletions static/images/tidelift.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bbbc1f0

Please sign in to comment.