-
-
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
[Button] Add outlined variant #11346
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1e036d7
[Button] Add outlined variant
leMaik 37a79e6
[Button] Lint code, update typescript definitions
leMaik 21c0b83
[Button] Update tests
leMaik e0714c2
[Button] Fix hover color of outlined variant
leMaik 3d8fa5e
One day I'll add docs:api as pre-commit script. But it's not this day.
leMaik f48b8f3
[MuiThemeProvider] Update tests
leMaik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { withStyles } from '@material-ui/core/styles'; | ||
import Button from '@material-ui/core/Button'; | ||
|
||
const styles = theme => ({ | ||
button: { | ||
margin: theme.spacing.unit, | ||
}, | ||
}); | ||
|
||
function doSomething(event) { | ||
// eslint-disable-next-line no-console | ||
console.log(event.currentTarget.getAttribute('data-something')); | ||
} | ||
|
||
function OutlinedButtons(props) { | ||
const { classes } = props; | ||
return ( | ||
<div> | ||
<Button variant="outlined" className={classes.button}> | ||
Default | ||
</Button> | ||
<Button color="primary" variant="outlined" className={classes.button}> | ||
Primary | ||
</Button> | ||
<Button color="secondary" variant="outlined" className={classes.button}> | ||
Secondary | ||
</Button> | ||
<Button variant="outlined" disabled className={classes.button}> | ||
Disabled | ||
</Button> | ||
<Button variant="outlined" href="#flat-buttons" className={classes.button}> | ||
Link | ||
</Button> | ||
<Button variant="outlined" disabled href="/" className={classes.button}> | ||
Link disabled | ||
</Button> | ||
<Button | ||
variant="outlined" | ||
className={classes.button} | ||
onClick={doSomething} | ||
data-something="here I am" | ||
> | ||
Does something | ||
</Button> | ||
</div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm removing the rather pointless "Link disabled" and "Does something" examples from the FlatButton demo in another PR (they've been on my hit-list for ages!), so no need to add them here. |
||
); | ||
} | ||
|
||
OutlinedButtons.propTypes = { | ||
classes: PropTypes.object.isRequired, | ||
}; | ||
|
||
export default withStyles(styles)(OutlinedButtons); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
href="#outlined-buttons"