Skip to content

Commit

Permalink
[docs] Use the InputBase component for the AppBar demo
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 4, 2018
1 parent 23d5d77 commit 98beb52
Show file tree
Hide file tree
Showing 7 changed files with 775 additions and 1,444 deletions.
5 changes: 0 additions & 5 deletions .firebaserc

This file was deleted.

11 changes: 3 additions & 8 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ const bpmr = require('babel-plugin-module-resolver');

function resolvePath(sourcePath, currentFile, opts) {
if (sourcePath === 'markdown') {
let projectRoot = currentFile.indexOf('material-ui') + 12;

// Netlify clones 'material-ui' to 'repo'
if (projectRoot === 11) {
projectRoot = 16;
}

return `${__dirname}/docs/src/${currentFile.slice(projectRoot, -3)}/`;
const base = currentFile.substring(__dirname.length).slice(0, -3);
return `${__dirname}/docs/src/${base}/`;
}

return bpmr.resolvePath(sourcePath, currentFile, opts);
}

Expand Down
5 changes: 2 additions & 3 deletions docs/src/pages/demos/app-bar/PrimarySearchAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import IconButton from '@material-ui/core/IconButton';
import Typography from '@material-ui/core/Typography';
import Input from '@material-ui/core/Input';
import InputBase from '@material-ui/core/InputBase';
import Badge from '@material-ui/core/Badge';
import MenuItem from '@material-ui/core/MenuItem';
import Menu from '@material-ui/core/Menu';
Expand Down Expand Up @@ -176,9 +176,8 @@ class PrimarySearchAppBar extends React.Component {
<div className={classes.searchIcon}>
<SearchIcon />
</div>
<Input
<InputBase
placeholder="Search…"
disableUnderline
classes={{
root: classes.inputRoot,
input: classes.inputInput,
Expand Down
5 changes: 2 additions & 3 deletions docs/src/pages/demos/app-bar/SearchAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import IconButton from '@material-ui/core/IconButton';
import Typography from '@material-ui/core/Typography';
import Input from '@material-ui/core/Input';
import InputBase from '@material-ui/core/InputBase';
import { fade } from '@material-ui/core/styles/colorManipulator';
import { withStyles } from '@material-ui/core/styles';
import MenuIcon from '@material-ui/icons/Menu';
Expand Down Expand Up @@ -87,9 +87,8 @@ function SearchAppBar(props) {
<div className={classes.searchIcon}>
<SearchIcon />
</div>
<Input
<InputBase
placeholder="Search…"
disableUnderline
classes={{
root: classes.inputRoot,
input: classes.inputInput,
Expand Down
12 changes: 6 additions & 6 deletions docs/src/pages/page-layout-examples/page-layout-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

They can be combined with one of the [example applications](https://github.com/mui-org/material-ui/tree/master/examples) to form a complete starter.

Sections of each layout are clearly defined either by comments or use of separate files,
making it simple to extract parts of a page (such as a "hero unit", or footer, for example)
Sections of each layout are clearly defined either by comments or use of separate files,
making it simple to extract parts of a page (such as a "hero unit", or footer, for example)
for reuse in other pages.

For multi-part examples, a table in the README at the linked source code location describes
the purpose of each file.
For multi-part examples, a table in the README at the linked source code location describes
the purpose of each file.

{{"demo": "pages/page-layout-examples/PageLayoutExamples.js", "hideHeader": true}}

If while using these examples you make changes or enhancements that could improve the
If while using these examples you make changes or enhancements that could improve the
developer experience, or you would like to contribute an additional example,
please consider creating a [pull-request on GitHub](https://github.com/mui-org/material-ui/pulls).
please consider creating a [pull-request on GitHub](https://github.com/mui-org/material-ui/pulls).
38 changes: 20 additions & 18 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,6 @@ class HomePage extends React.Component {
return (
<AppFrame>
<div className={classes.root}>
<script
type="application/ld+json"
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: `
{
"@context": "http://schema.org",
"@type": "Organization",
"name": "Material-UI",
"url": "https://material-ui.com",
"logo": "https://material-ui.com/static/brand.png",
"sameAs": [
"https://twitter.com/materialUI"
]
}
`,
}}
/>
<Head />
<Tidelift />
<div className={classes.hero}>
Expand Down Expand Up @@ -159,6 +141,26 @@ class HomePage extends React.Component {
<HomeBackers />
<HomeFooter />
</div>
<script
type="application/ld+json"
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: `
{
"@context": "http://schema.org",
"@type": "Organization",
"name": "Material-UI",
"url": "https://material-ui.com",
"logo": "https://material-ui.com/static/brand.png",
"sameAs": [
"https://twitter.com/materialUI",
"https://github.com/mui-org/material-ui",
"https://opencollective.com/material-ui"
]
}
`,
}}
/>
</AppFrame>
);
}
Expand Down
Loading

0 comments on commit 98beb52

Please sign in to comment.