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

[WIP][Core] Remove style-resizable mixin #2934

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions src/mixins/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import ClickAwayable from './click-awayable';
import WindowListenable from './window-listenable';
import StylePropable from './style-propable';
import StyleResizable from './style-resizable';

export {ClickAwayable};
export {WindowListenable};
export {StylePropable};
export {StyleResizable};

export default {
ClickAwayable,
WindowListenable,
StylePropable,
StyleResizable,
};
53 changes: 0 additions & 53 deletions src/mixins/style-resizable.js

This file was deleted.

4 changes: 1 addition & 3 deletions src/snackbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import FlatButton from './flat-button';
import DefaultRawTheme from './styles/raw-themes/light-raw-theme';
import ThemeManager from './styles/theme-manager';
import ContextPure from './mixins/context-pure';
import StyleResizable from './mixins/style-resizable';
import warning from 'warning';
import deprecated from './utils/deprecatedPropType';

Expand Down Expand Up @@ -102,7 +101,6 @@ const Snackbar = React.createClass({

mixins: [
StylePropable,
StyleResizable,
ClickAwayable,
ContextPure,
],
Expand Down Expand Up @@ -236,7 +234,7 @@ const Snackbar = React.createClass({
actionColor,
} = this.constructor.getRelevantContextKeys(this.state.muiTheme);

const isSmall = this.state.deviceSize === this.constructor.Sizes.SMALL;
const isSmall = window.innerWidth < 768;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the screen is rezised?
The component won't rerender 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, on one hand I figured this shouldn't matter to much because:

  1. Snackbars are generally temporary
  2. The resolution of small devices typically does not change

Though on second thought, there are some other considerations like the width as a result from a orientation change.


const styles = {
root: {
Expand Down