diff --git a/README.md b/README.md index b4e842b..d791f31 100644 --- a/README.md +++ b/README.md @@ -15,16 +15,39 @@ Never ever worry about a fancy dropdown menu. This component does it for you! Component usage: -`` +```jsx +const food = { + a: { + value: "Button1", + action: () => { + alert("test1") + } + }, + b: { + value: "Button2", + action: () => { + alert("test2") + } + }, + c: { + value: "Button3", + action: () => { + alert("test3") + } + } +} -Replace `width` optionally width `height` but don't use both at the same time. -To keep the ratio between height and width one has to be given and the other one is calculated by the component. + -One example with height: +//Replace 'width' optionally width 'height' but don't use both at the same time. +T//o keep the ratio between height and width one has to be given and the other one is calculated by the component. -`` +//One example with height: -`color` is optional. The defaul value is `rgb(255, 255, 255)` if it's not defined. + + +//'color' is optional. The defaul value is 'rgb(255, 255, 255)' if it's not defined. +``` # Contact diff --git a/src/components/Menu.js b/src/components/Menu.js index 7f7d9cd..16a4b29 100644 --- a/src/components/Menu.js +++ b/src/components/Menu.js @@ -16,6 +16,26 @@ class App extends Component { * - width: Int in percentage * - OR height: Int in percentage * - color: String + * - food = { + * a: { + * value: "Button1", + * action: () => { + * alert("test1") + * } + * }, + * b: { + * value: "Button2", + * action: () => { + * alert("test2") + * } + * }, + * c: { + * value: "Button3", + * action: () => { + * alert("test3") + * } + * } + * } */ this.state = { @@ -147,7 +167,6 @@ class App extends Component { if(!(inputWidth ||inputHeight)) { console.log("Please define a height OR width!"); } -console.log(inputWidth) //Units and values seperated if(inputWidth !== undefined) { //Width @@ -188,7 +207,6 @@ console.log(inputWidth) height: this.getDimensions().height }; - console.log(style.height); const styleDot = { backgroundColor: this.getColor() }; @@ -214,14 +232,14 @@ console.log(inputWidth)
-
- Button +
+ {this.props.food.a.value}
-
- Button +
+ {this.props.food.b.value}
-
- Button +
+ {this.props.food.c.value}