Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

golden test #884

Merged
merged 29 commits into from
Jul 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ac8a855
Release (#793)
prateekbh May 11, 2018
32d44c3
Prettierfix (#797)
prateekbh May 17, 2018
85c3a94
v1.4.5 - Fixed typings for Typography. (#798)
May 21, 2018
d6ff8c9
Fix Tabs within TabBarScroller initialized multiple times (#796)
Dramloc May 28, 2018
39c567a
typo in import (#799)
maasencioh May 28, 2018
a8b760f
chore(package): update webpack-cli to version 3.0.0 (#800)
greenkeeper[bot] Jun 2, 2018
c9712f8
Update @material/rtl to the latest version 🚀 (#801)
greenkeeper[bot] Jun 5, 2018
b2ab3bf
Don't bundle a copy of Preact into dist (#826)
developit Jun 5, 2018
433f8c1
Update index.js
prateekbh Jun 6, 2018
f78a905
Updating deps (#827)
prateekbh Jun 6, 2018
83c4ba6
Update package.json
prateekbh Jun 11, 2018
0f977ba
Update to v36 (#828)
prateekbh Jun 22, 2018
72a4c9e
chore(package): update eslint to version 5.0.0 (#833)
greenkeeper[bot] Jun 23, 2018
44a372d
Default id for TextFieldInput (#830)
pavex Jun 26, 2018
5f979b4
Merge branch 'release' into master
prateekbh Jul 2, 2018
a162543
TextField improvements (#853)
Jul 6, 2018
aef2fe7
updating deps (#855)
prateekbh Jul 7, 2018
dc806b1
outlined select (#857)
prateekbh Jul 10, 2018
4ef3503
Fixed visible line ripple when outlined and outerStyle in case of no …
Jul 12, 2018
897f738
Merge branch 'release'
prateekbh Jul 14, 2018
65f5f38
fixes double body (#875)
prateekbh Jul 23, 2018
3396799
Merge branch 'release'
prateekbh Jul 23, 2018
4cd26ed
Card: change prop 16-9 to sixteenByNine (#868)
aravindballa Jul 25, 2018
3b7e48a
updating deps (#879)
prateekbh Jul 25, 2018
f3d0306
Update index.d.ts (#861)
prateekbh Jul 25, 2018
00c76be
fixing double render
prateekbh Jul 28, 2018
789fb69
Merge branch 'release' into master
prateekbh Jul 28, 2018
b4eeb18
fixing golden docs
prateekbh Jul 28, 2018
7ab4796
Merge branch 'master' of https://github.com/prateekbh/preact-material…
prateekbh Jul 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Card/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ class CardMedia extends MaterialComponent {
this.componentName = 'card__media';
this._mdcProps = ['square', '16-9'];
}
materialDom(props) {
if (props.sixteenByNine) {
props.className = 'mdc-card__media--16-9';
}
return super.materialDom(props);
}
}

class CardActionButton extends Button {
Expand Down
2 changes: 1 addition & 1 deletion Card/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ declare class ActionIcon extends Icon<JSX.HTMLAttributes, {}> {}
declare class CardMediaContent extends MaterialComponent<IActionsProps, {}> {}

declare interface IMediaProps extends JSX.HTMLAttributes {
x?: 'square' | '16-9';
x?: 'square' | 'sixteenByNine';
}
declare class Media extends MaterialComponent<IMediaProps, {}> {}
2 changes: 1 addition & 1 deletion ImageList/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class ImageList extends MaterialComponent<IImageListProps, {}> {
static Image: typeof ImageListImage;
static Supporting: typeof ImageListSupporting;
static Label: typeof ImageListLabel;
static Aspectcontainer: typeof ImageListAspectcontainer;
static AspectContainer: typeof ImageListAspectcontainer;
}

export class ImageListAspectcontainer extends MaterialComponent<
Expand Down
8 changes: 4 additions & 4 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"webpack": "^3.8.1"
},
"dependencies": {
"preact": "^8.2.1",
"preact": "^8.2.9",
"preact-cli": "^2.2.1",
"preact-router": "^2.6.1"
}
Expand Down
33 changes: 11 additions & 22 deletions docs/src/components/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ export default class Home extends Component {
this.state = {
darkMode: false
};
if (typeof window !== "undefined") {
this.state.toolbarTitle =
window.location.pathname === '/'
? null
: (menuItems.find(item => item.link === window.location.pathname) ||{}).text;
}
}

closeDrawer() {
Expand All @@ -225,29 +231,13 @@ export default class Home extends Component {
}
}

componentDidMount() {
handleRoute_ = url => {
this.setState({
toolbarTitle:
window.location.pathname === '/'
url === '/'
? null
: (
menuItems.find(item => item.link === window.location.pathname) ||
{}
).text
: (menuItems.find(item => item.link === url) || {}).text
});
}

_handleRoute = e => {
setTimeout(
() =>
this.setState({
toolbarTitle:
e.url === '/'
? null
: (menuItems.find(item => item.link === e.url) || {}).text
}),
100
);
};

render() {
Expand Down Expand Up @@ -381,15 +371,14 @@ export default class Home extends Component {
preact-material-components
</div>
</div>
<Menu items={menuItems} ref={menu => (this.menu = menu)} />
<Menu items={menuItems} ref={menu => (this.menu = menu)} onSelect={this.handleRoute_} />
<LayoutGrid className="content">
<LayoutGrid.Inner>
<LayoutGrid.Cell cols="12">
<Router onChange={this._handleRoute}>
<Router>
{menuItems.map(({component: Element, link}) => (
<Element path={link} />
))}
<HomePage default />
</Router>
</LayoutGrid.Cell>
</LayoutGrid.Inner>
Expand Down
1 change: 1 addition & 0 deletions docs/src/components/menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default class Menu extends Component {
return;

// attempt to route, if no match simply cede control to browser
this.props.onSelect && this.props.onSelect(href);
return route(href);
}

Expand Down
2 changes: 1 addition & 1 deletion docs/src/routes/card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class CardPage extends Component {
description: 'Makes Media aspect ratio 1:1.'
},
{
name: '16-9',
name: 'sixteenByNine',
description: 'Makes Media aspect ratio 16:9.'
}
]
Expand Down
Binary file modified docs/tests/golden/wide/component/card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/tests/visdiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function compareScreenshots(fileName) {
img1.width,
img1.height,
{
threshold: 0.1
threshold: 0.2
}
);

Expand Down
Loading