Skip to content

Instantly share code, notes, and snippets.

@bookercodes
Last active June 6, 2018 15:28
Show Gist options
  • Save bookercodes/12b67d4f7a4c848d845ad958710d22c7 to your computer and use it in GitHub Desktop.
Save bookercodes/12b67d4f7a4c848d845ad958710d22c7 to your computer and use it in GitHub Desktop.
// ./src/UsernameForm.js
import React, { Component } from 'react'
import { TextInput } from 'react-desktop/macOs'
import { Button } from 'react-desktop/macOs'
class UsernameForm extends Component {
constructor() {
super()
this.state = {
username: ''
}
}
handleSubmit = e => {
e.preventDefault()
this.props.handleSubmit(this.state.username)
}
handleChange = e => {
this.setState({ username: e.target.value })
}
render() {
return (
<div className="username-form">
<form onSubmit={this.handleSubmit}>
<div>
<TextInput
label="Username:"
placeholder="For example, @bookercodes"
value={this.state.username}
onChange={this.handleChange}
/>
</div>
<div>
<Button color="blue" type="submit">
Submit
</Button>
</div>
</form>
</div>
)
}
}
export default UsernameForm
@anonur
Copy link

anonur commented Jun 6, 2018

how can I change the macOS part to win?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment