wvi-test-ui-components
Advanced tools
Comparing version 0.0.95 to 0.0.96
{ | ||
"name": "wvi-test-ui-components", | ||
"version": "0.0.95", | ||
"version": "0.0.96", | ||
"description": "React component library for WVI", | ||
@@ -5,0 +5,0 @@ "main": "src/dist/ui.js", |
@@ -9,10 +9,2 @@ import React from 'react'; | ||
/** | ||
* Handles the action. | ||
*/ | ||
const handleAction = () => { | ||
const { action } = props; | ||
action(); | ||
} | ||
// Create a Button component that will render a <button> element with styles. | ||
@@ -50,5 +42,5 @@ const Button = styled.button` | ||
return ( | ||
<Button onClick={() => handleAction()}> | ||
{props.text} | ||
</Button> | ||
<Button | ||
onClick={props.action} | ||
>{props.text}</Button> | ||
); | ||
@@ -55,0 +47,0 @@ } |
@@ -7,3 +7,2 @@ import React from 'react'; | ||
import LinkButton from '../Button/LinkButton'; | ||
import ActionButton from '../Button/ActionButton'; | ||
import Icon from '../Icon'; | ||
@@ -68,11 +67,6 @@ import Image from '../Image'; | ||
renderButton() { | ||
renderLinkButton() { | ||
const button = this.props.data.button; | ||
if (button !== undefined) { | ||
return <LinkButton text={button.text} link={button.link}/>; | ||
// return ( | ||
// (button.action !== undefined) ? | ||
// <ActionButton text={button.text} action={button.action}/> : | ||
// <LinkButton text={button.text} link={button.link}/> | ||
// ); | ||
} | ||
@@ -237,3 +231,3 @@ } | ||
{this.renderFormFields()} | ||
{this.renderButton()} | ||
{this.renderLinkButton()} | ||
</div> | ||
@@ -240,0 +234,0 @@ </ItemBox> |
@@ -139,4 +139,4 @@ | ||
button: { | ||
text: 'Search', | ||
action: () => handleSearch(), | ||
text: 'Click here', | ||
link: '#', | ||
} | ||
@@ -243,3 +243,3 @@ }; | ||
// Dummy functions that need to be passed to the components. | ||
// Dummy functions that need to be passed to the child component. | ||
function handleFieldChange(name, value) { | ||
@@ -251,4 +251,3 @@ console.log('handle field change', name, value); | ||
} | ||
function handleSearch() { | ||
console.log('handle search'); | ||
} | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
5985485
4163