Skip to content
This repository has been archived by the owner on Dec 27, 2018. It is now read-only.

Commit

Permalink
Added snackbar (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cromefire_ authored Sep 3, 2018
2 parents 3a506ef + 9dd7ecb commit 9c627d2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion IconButton/index.scss
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@import "~preact-material-components/IconButton";
@import "~preact-material-components/IconButton/mdc-icon-button";
2 changes: 1 addition & 1 deletion IconButton/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface IIconButtonState extends RIconButtonState {

export class IconButton extends RIconButton {
public readonly styles = [
{style, id: "button"}
{style, id: "icon-button"}
];

public componentWillMount() {
Expand Down
1 change: 1 addition & 0 deletions Snackbar/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "~preact-material-components/Snackbar/mdc-snackbar";
30 changes: 30 additions & 0 deletions Snackbar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import RSnackbar, {
ISnackbarProps as RSnackbarProps,
ISnackbarState as RSnackbarState
} from "preact-material-components/esm/Snackbar";
import {load_styles, unload_styles} from "../util/style";
import style from "./index.scss";

export interface ISnackbarProps extends RSnackbarProps {
}

export interface ISnackbarState extends RSnackbarState {
}

export class Snackbar extends RSnackbar {
public readonly styles = [
{style, id: "snackbar"}
];

public componentWillMount() {
load_styles(this.styles);
}

public componentWillUnmount() {
super.componentWillUnmount();
unload_styles(this.styles);
}
}

// noinspection JSUnusedGlobalSymbols
export default Snackbar;

0 comments on commit 9c627d2

Please sign in to comment.