From 100bfa7b5bc5a488f78e9bf90589911e5cc8927d Mon Sep 17 00:00:00 2001 From: Rish Date: Mon, 27 Apr 2020 13:49:59 +0530 Subject: [PATCH] Extracted common Input and Button components no issue - Add new InputField common component for input fields with label - Add new ActionButton common component for action + ); +} + +export default ActionButton; diff --git a/ghost/portal/src/components/common/InputField.js b/ghost/portal/src/components/common/InputField.js new file mode 100644 index 0000000000..064c247336 --- /dev/null +++ b/ghost/portal/src/components/common/InputField.js @@ -0,0 +1,47 @@ +import React from 'react'; + +const Styles = ({style = {}}) => { + return { + input: { + display: 'block', + padding: '0 .6em', + width: '100%', + height: '44px', + outline: '0', + border: '1px solid #c5d2d9', + color: 'inherit', + textDecoration: 'none', + background: '#fff', + borderRadius: '9px', + fontSize: '14px', + marginBottom: '12px', + boxSizing: 'border-box', + ...(style.input || {}) // Override any custom style + }, + label: { + marginBottom: '3px', + fontSize: '12px', + fontWeight: '700', + ...(style.label || {}) // Override any custom style + } + }; +}; + +function InputField({name, label, type, value, placeholder, onChange, style}) { + const Style = Styles({style}); + return ( + <> + + onChange(e, name)} + style={Style.input} + /> + + ); +} + +export default InputField;