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

Github Picker is not taking into account the color parameter #824

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
23,118 changes: 8,480 additions & 14,638 deletions docs/build/bundle.js

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions examples/github-toggle-open-closed/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
14 changes: 14 additions & 0 deletions examples/github-toggle-open-closed/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "react-color-example-basic-toggle-open-closed",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^15.6.1",
"react-color": "latest",
"react-dom": "^15.6.1",
"react-scripts": "1.0.12"
},
"scripts": {
"start": "react-scripts start"
}
}
7 changes: 7 additions & 0 deletions examples/github-toggle-open-closed/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!doctype html>

<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css" rel="stylesheet" />
<style>#root { font-family: -apple-system, BlinkMacSystemFont, sans-serif; height: 100vh; width: 100vw;
display: flex; align-items: center; justify-content: center; }</style>

<div id="root"></div>
35 changes: 35 additions & 0 deletions examples/github-toggle-open-closed/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* eslint-disable no-console */
import React from 'react'

import { GithubPicker } from 'react-color'

class App extends React.Component {
state = {
pickerVisible: false,
activeColor: "#fff"
}

render() {
const handleColorChange = ({ hex }) => { console.log(hex); this.setState({activeColor: hex})}
const onTogglePicker = () => this.setState({ pickerVisible: !this.state.pickerVisible })

return (
<div>
<button onClick={ onTogglePicker } style={{ backgroundColor: this.state.activeColor}}>
Toggle Picker
</button>

{ this.state.pickerVisible && (
<div style={{ position: 'absolute' }}>
<GithubPicker
color={ this.state.activeColor }
onChangeComplete={ handleColorChange }
/>
</div>
) }
</div>
)
}
}

export default App
9 changes: 9 additions & 0 deletions examples/github-toggle-open-closed/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'
import ReactDOM from 'react-dom'

import App from './App'

ReactDOM.render(
<App />,
document.getElementById('root'),
)
Loading