Skip to content

Commit

Permalink
[docs] Add Tidelift banner (mui#12099)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored and Joe Shelby committed Jul 14, 2018
1 parent e1f44f0 commit 9250420
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
58 changes: 58 additions & 0 deletions docs/src/modules/components/Tidelift.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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}px ${theme.spacing.unit}px ${theme
.spacing.unit * 2}px`,
right: 0,
left: 0,
display: 'flex',
backgroundColor: '#626980', // Tidelift color.
position: 'relative',
top: 56,
[theme.breakpoints.up('sm')]: {
top: 64 + 36 / 2,
left: 'auto',
position: 'absolute',
borderBottomLeftRadius: 36 / 2,
borderTopLeftRadius: 36 / 2,
},
},
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,
},
});

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

return (
<Link
className={classes.root}
variant="button"
href="https://tidelift.com/subscription/npm/material-ui?utm_source=material_ui&utm_medium=referral&utm_campaign=homepage"
target="_blank"
rel="noopener"
>
<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 9250420

Please sign in to comment.