summaryrefslogtreecommitdiffhomepage
path: root/gui/packages
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-09-27 11:20:08 -0300
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-10-08 11:04:27 -0300
commitf067f2cb614da491be564bc45a735394178f6c8e (patch)
tree0097ad4c172d31ae7b0305d6c1d9f4db213092e4 /gui/packages
parentcd8564f249c0aa435daf65f832587c5d13821829 (diff)
downloadmullvadvpn-f067f2cb614da491be564bc45a735394178f6c8e.tar.xz
mullvadvpn-f067f2cb614da491be564bc45a735394178f6c8e.zip
Create `Cell.Input` component
Diffstat (limited to 'gui/packages')
-rw-r--r--gui/packages/desktop/src/renderer/components/Cell.js38
1 files changed, 37 insertions, 1 deletions
diff --git a/gui/packages/desktop/src/renderer/components/Cell.js b/gui/packages/desktop/src/renderer/components/Cell.js
index 95259568eb..5653af0ae3 100644
--- a/gui/packages/desktop/src/renderer/components/Cell.js
+++ b/gui/packages/desktop/src/renderer/components/Cell.js
@@ -1,7 +1,7 @@
// @flow
import * as React from 'react';
-import { Button, Text, Component, Styles, Types, View } from 'reactxp';
+import { Button, Component, Styles, Text, TextInput, Types, View } from 'reactxp';
import PlainImg from './Img';
import { colors } from '../../config';
@@ -61,6 +61,29 @@ const styles = {
}),
},
+ input: {
+ view: Styles.createViewStyle({
+ flexGrow: 1,
+ paddingLeft: 12,
+ paddingRight: 12,
+ paddingTop: 8,
+ paddingBottom: 8,
+ marginRight: 3,
+ borderWidth: 2,
+ borderRadius: 8,
+ borderColor: 'transparent',
+ }),
+ text: Styles.createTextStyle({
+ color: colors.blue,
+ backgroundColor: 'rgba(255, 255, 255, 0.5)',
+ fontFamily: 'DINPro',
+ fontSize: 20,
+ fontWeight: '900',
+ lineHeight: 26,
+ textAlign: 'center',
+ }),
+ },
+
cellHover: Styles.createViewStyle({
backgroundColor: colors.blue80,
}),
@@ -149,6 +172,19 @@ export function Label({
);
}
+export function Input({ style, ...otherProps }: Types.TextInputProps) {
+ return (
+ <TextInput
+ maxLength={10}
+ placeholderTextColor={colors.blue40}
+ autoCorrect={false}
+ autoFocus={false}
+ style={[styles.input.text, styles.input.view, style]}
+ {...otherProps}
+ />
+ );
+}
+
export type SubTextProps = {
children: React.Node,
cellHoverStyle?: Types.ViewStyle,