From 94aed2a2941182fca61a6f48b41ad52de435e9f7 Mon Sep 17 00:00:00 2001 From: Bu Kinoshita Date: Thu, 23 Nov 2017 18:09:56 -0200 Subject: [PATCH] `input` component (https://github.com/bukinoshita/secret/issues/10) --- components/button.js | 9 +++- components/input.js | 123 +++++++++++++++++++++++++++++++++++++++++++ pages/index.js | 96 ++++----------------------------- pages/s/index.js | 42 ++------------- 4 files changed, 146 insertions(+), 124 deletions(-) create mode 100644 components/input.js diff --git a/components/button.js b/components/button.js index 7d2cf1d..93bc85f 100644 --- a/components/button.js +++ b/components/button.js @@ -2,7 +2,7 @@ import React from 'react' -import { colors, typography } from './../theme' +import { colors, typography, phone } from './../theme' const Button = ({ children, type, onClick, disabled }) => { return ( @@ -37,6 +37,13 @@ const Button = ({ children, type, onClick, disabled }) => { background-color: ${colors.gray}; cursor: default; } + + @media ${phone} { + button { + display: block; + width: 100%; + } + } `} ) diff --git a/components/input.js b/components/input.js new file mode 100644 index 0000000..e1151fe --- /dev/null +++ b/components/input.js @@ -0,0 +1,123 @@ +'use strict' + +import React from 'react' + +import { colors, typography } from './../theme' + +const Input = ({ + name, + type, + placeholder, + value, + onChange, + autoFocus, + multiline, + customStyle +}) => { + return ( +
+ {multiline ? ( +