Няма описание

preview.882bafd716960d2ded4d.bundle.js.map 2.1KB

1
  1. {"version":3,"file":"static/preview.882bafd716960d2ded4d.bundle.js","sources":["webpack:///./.storybook/stories/customization/commandButton/ButtonComponent.tsx"],"sourcesContent":["import * as React from \"react\";\r\n\r\nconst containerStyle: React.CSSProperties = {\r\n width: \"200px\",\r\n border: \"1px solid #c8ccd0\",\r\n height: \"50px\",\r\n position: \"absolute\",\r\n background: \"#fff\",\r\n zIndex: 999,\r\n padding: \"5px\",\r\n};\r\n\r\nconst buttonStyle = {\r\n textAlign: \"center\",\r\n width: \"100%\",\r\n};\r\n\r\nconst imagePlaceholder = \"https://www.comet.ml/images/logo_comet_dark.png\";\r\n\r\nexport interface Props {\r\n onTextChange: (value: string) => void;\r\n handleSubmit: () => void;\r\n}\r\n\r\nexport interface State {\r\n isOpen: boolean;\r\n}\r\n\r\nexport default class SimpleForm extends React.Component<Props, State> {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n isOpen: false,\r\n };\r\n\r\n props.setValues(imagePlaceholder);\r\n }\r\n\r\n handleClick = () => {\r\n const {isOpen} = this.state;\r\n this.setState({isOpen: !isOpen});\r\n }\r\n\r\n handleTextChange = (e) => {\r\n this.props.onTextChange(e.target.value);\r\n }\r\n\r\n handleSubmit = () => {\r\n this.props.handleSubmit();\r\n this.setState({isOpen: false});\r\n }\r\n\r\n render() {\r\n const {isOpen} = this.state;\r\n\r\n return (\r\n <div>\r\n <button onClick={this.handleClick}> Upload Image</button>\r\n {isOpen &&\r\n <div style={containerStyle}>\r\n <input\r\n type=\"text\"\r\n onChange={this.handleTextChange}\r\n style={{width: \"100%\"}}\r\n value={imagePlaceholder}\r\n />\r\n <button onClick={this.handleSubmit} style={buttonStyle}>Submit</button>\r\n </div>\r\n }\r\n </div>\r\n );\r\n }\r\n}\r\n"],"mappings":"AAAA","sourceRoot":""}