-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[docs] Improve mui-treasury integration #21054
Conversation
siriwatknp
commented
May 16, 2020
- I have followed (at least) the PR section of the contributing guide.
Details of bundle changes.Comparing: 758a8ad...788051e Details of page changes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can only change the english version. Otherwise crowdin immediately opens PRs to revert the change.
0bbcb3e
to
22da8ff
Compare
@siriwatknp Yes, please leave the translations untouched for next time. In any case, the changes will be overridden. No much harm outside the wasted time in the first place. |
I don't think this link is relevant. It should be about layout positioning, not styles
@oliviertassinari thanks, I just updated the PR. please check it again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great :). Regarding the demos themselves, I think that what would be really cool is to explain how/expose the same capability with the theme. I think that most of the audience would, at 80%?, use the theme context:
import React from 'react';
import { Switch, createMuiTheme, ThemeProvider } from '@material-ui/core';
import { switchTheme, checkboxTheme } from '@mui-treasury/theme/iOS';
const theme = createMuiTheme({}, switchTheme, checkboxTheme);
export default function IosSwitchStyle() {
const [toggled, setToggled] = React.useState(false);
return (
<ThemeProvider theme={theme}>
<Switch
checked={toggled}
onChange={e => setToggled(e.target.checked)}
/>
<Switch
checked={!toggled}
onChange={e => setToggled(!e.target.checked)}
/>
</ThemeProvider>
);
}
rather than wrapping each component:
import React from 'react';
import Switch from '@material-ui/core/Switch';
import { useSwitchStyles } from '@mui-treasury/theme/iOS';
export default function IosSwitchStyle() {
const [toggled, setToggled] = React.useState(false);
const iosStyles = useSwitchStyles();
return (
<div>
<Switch
classes={iosStyles}
checked={toggled}
onChange={e => setToggled(e.target.checked)}
/>
<Switch
classes={iosStyles}
checked={!toggled}
onChange={e => setToggled(!e.target.checked)}
/>
</div>
);
}
But both are important.
Good point! I will focus on improving documentation for components & styles next week, will put that in the list. |