@plusscommunities/pluss-core-app 8.0.18 → 8.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component } from "react";
|
|
2
2
|
import _ from "lodash";
|
|
3
|
-
import {
|
|
3
|
+
import { TextInput, View, TouchableWithoutFeedback } from "react-native";
|
|
4
4
|
import { Text } from ".";
|
|
5
5
|
import { Icon } from "@rneui/themed";
|
|
6
6
|
import { TEXT_LIGHT, TEXT_DARK, TEXT_DARKEST } from "../colours";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","_","Input","View","TouchableWithoutFeedback","Text","Icon","TEXT_LIGHT","TEXT_DARK","TEXT_DARKEST","FontAwesome","GenericInput","constructor","props","state","showSecureText","inputRef","createRef","blur","current","toggleSecureText","setState","renderLeftIcon","icon","iconType","createElement","name","style","styles","searchIcon","type","iconStyle","renderRightIcon","secureTextEntry","onPress","bind","clearIcon","secureIcon","rightIcon","rightIconAction","hasClear","isEmpty","value","onChangeText","render","searchInputContainer","squaredCorners","squaredSearchInputContainer","autoGrow","paddingVertical","minHeight","height","containerStyle","TextInput","maxFontSizeMultiplier","ref","placeholder","placeholderTextColor","autoCorrect","autoFocus","multiline","searchText","textAlignVertical","keyboardType","returnKeyType","selectionColor","underlineColorAndroid","editable","autoCapitalize","onKeyPress","onSubmitEditing","onFocus","onBlur","flex","borderRadius","backgroundColor","alignItems","flexDirection","paddingHorizontal","fontSize","color","marginRight","marginLeft","marginTop","marginBottom","fontFamily"],"sources":["GenericInput.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport _ from \"lodash\";\nimport { Input, View, TouchableWithoutFeedback } from \"react-native\";\nimport { Text } from \".\";\nimport { Icon } from \"@rneui/themed\";\nimport { TEXT_LIGHT, TEXT_DARK, TEXT_DARKEST } from \"../colours\";\nimport { FontAwesome } from \"./Icon\";\n\nclass GenericInput extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tshowSecureText: false,\n\t\t};\n\t\tthis.inputRef = React.createRef();\n\t}\n\n\tblur() {\n\t\tthis.inputRef.current.blur();\n\t}\n\n\ttoggleSecureText() {\n\t\tthis.setState({\n\t\t\tshowSecureText: !this.state.showSecureText,\n\t\t});\n\t}\n\n\trenderLeftIcon() {\n\t\tif (!this.props.icon) {\n\t\t\treturn null;\n\t\t}\n\t\tif (this.props.iconType && this.props.iconType === \"pl60\") {\n\t\t\treturn <FontAwesome name={this.props.icon} style={styles.searchIcon} />;\n\t\t}\n\t\treturn (\n\t\t\t<Icon\n\t\t\t\ttype=\"font-awesome\"\n\t\t\t\tname={this.props.icon}\n\t\t\t\ticonStyle={styles.searchIcon}\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderRightIcon() {\n\t\tif (this.props.secureTextEntry) {\n\t\t\treturn (\n\t\t\t\t<TouchableWithoutFeedback onPress={this.toggleSecureText.bind(this)}>\n\t\t\t\t\t<FontAwesome\n\t\t\t\t\t\tname={this.state.showSecureText ? \"eye-slash\" : \"eye\"}\n\t\t\t\t\t\tstyle={[styles.clearIcon, styles.secureIcon]}\n\t\t\t\t\t/>\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t);\n\t\t}\n\t\tif (this.props.rightIcon) {\n\t\t\tif (this.props.rightIconAction) {\n\t\t\t\treturn (\n\t\t\t\t\t<TouchableWithoutFeedback onPress={this.props.rightIconAction}>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\tname={this.props.rightIcon}\n\t\t\t\t\t\t\ticonStyle={styles.clearIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<Icon\n\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\tname={this.props.rightIcon}\n\t\t\t\t\ticonStyle={styles.clearIcon}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tif (this.props.hasClear && !_.isEmpty(this.props.value)) {\n\t\t\treturn (\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\tonPress={() => {\n\t\t\t\t\t\tthis.props.onChangeText(\"\");\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesome name=\"circle-x\" style={styles.clearIcon} />\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.searchInputContainer,\n\t\t\t\t\tthis.props.squaredCorners && styles.squaredSearchInputContainer,\n\t\t\t\t\tthis.props.autoGrow\n\t\t\t\t\t\t? { paddingVertical: 8, minHeight: 40 }\n\t\t\t\t\t\t: { height: 36 },\n\t\t\t\t\tthis.props.containerStyle,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{this.renderLeftIcon()}\n\t\t\t\t<TextInput\n\t\t\t\t\tmaxFontSizeMultiplier={1.2}\n\t\t\t\t\tref={this.inputRef}\n\t\t\t\t\tplaceholder={this.props.placeholder}\n\t\t\t\t\tplaceholderTextColor={TEXT_LIGHT}\n\t\t\t\t\tautoCorrect={\n\t\t\t\t\t\tthis.props.autoCorrect != null ? this.props.autoCorrect : false\n\t\t\t\t\t}\n\t\t\t\t\tautoFocus={\n\t\t\t\t\t\tthis.props.autoFocus != null ? this.props.autoFocus : false\n\t\t\t\t\t}\n\t\t\t\t\tautoGrow={this.props.autoGrow != null ? this.props.autoGrow : false}\n\t\t\t\t\tmultiline={\n\t\t\t\t\t\tthis.props.multiline != null ? this.props.multiline : false\n\t\t\t\t\t}\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.searchText,\n\t\t\t\t\t\tthis.props.style,\n\t\t\t\t\t\t{ textAlignVertical: this.props.multiline ? \"top\" : \"center\" },\n\t\t\t\t\t\tthis.props.minHeight && { minHeight: this.props.minHeight },\n\t\t\t\t\t]}\n\t\t\t\t\tvalue={this.props.value}\n\t\t\t\t\tonChangeText={this.props.onChangeText}\n\t\t\t\t\tkeyboardType={this.props.keyboardType}\n\t\t\t\t\treturnKeyType={this.props.returnKeyType}\n\t\t\t\t\tselectionColor={TEXT_DARK}\n\t\t\t\t\tunderlineColorAndroid=\"rgba(0,0,0,0)\"\n\t\t\t\t\teditable={this.props.editable != null ? this.props.editable : true}\n\t\t\t\t\tautoCapitalize={this.props.autoCapitalize || \"none\"}\n\t\t\t\t\tonKeyPress={this.props.onKeyPress}\n\t\t\t\t\tonSubmitEditing={this.props.onSubmitEditing}\n\t\t\t\t\tonFocus={this.props.onFocus}\n\t\t\t\t\tonBlur={this.props.onBlur}\n\t\t\t\t\tsecureTextEntry={\n\t\t\t\t\t\tthis.props.secureTextEntry && !this.state.showSecureText\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{this.renderRightIcon()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tsearchInputContainer: {\n\t\tflex: 1,\n\t\tborderRadius: 25,\n\t\tbackgroundColor: \"#ebeff2\",\n\t\talignItems: \"center\",\n\t\tflexDirection: \"row\",\n\t\tpaddingHorizontal: 16,\n\t},\n\tsquaredSearchInputContainer: {\n\t\tborderRadius: 5,\n\t\tpaddingHorizontal: 8,\n\t},\n\tsearchIcon: {\n\t\tfontSize: 14,\n\t\tcolor: TEXT_LIGHT,\n\t\tmarginRight: 8,\n\t},\n\tclearIcon: {\n\t\tfontSize: 14,\n\t\tcolor: TEXT_LIGHT,\n\t\tmarginLeft: 8,\n\t\tmarginTop: 8,\n\t\tmarginBottom: 8,\n\t},\n\tsecureIcon: {\n\t\tfontSize: 20,\n\t},\n\tsearchText: {\n\t\tcolor: TEXT_DARKEST,\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 16,\n\t\tflex: 1,\n\t},\n};\n\nexport { GenericInput };\n"],"mappings":"A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AMJ,MAAM,GAAG;EACdiB,oBAAoB,EAAE;IACrB4B,IAAI,EAAE,CAAC;IACPC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAE,SAAS;IAC1BC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,iBAAiB,EAAE;EACpB,CAAC;EACD/B,2BAA2B,EAAE;IAC5B2B,YAAY,EAAE,CAAC;IACfI,iBAAiB,EAAE;EACpB,CAAC;EACDjD,UAAU,EAAE;IACXkD,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEzE,UAAU;IACjB0E,WAAW,EAAE;EACd,CAAC;EACD7C,SAAS,EAAE;IACV2C,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEzE,UAAU;IACjB2E,UAAU,EAAE,CAAC;IACbC,SAAS,EAAE,CAAC;IACZC,YAAY,EAAE;EACf,CAAC;EACD/C,UAAU,EAAE;IACX0C,QAAQ,EAAE;EACX,CAAC;EACDlB,UAAU,EAAE;IACXmB,KAAK,EAAEvE,YAAY;IACnB4E,UAAU,EAAE,YAAY;IACxBN,QAAQ,EAAE,EAAE;IACZN,IAAI,EAAE;EACP;AACD,CAAC;AAED,SAAS9D,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Component","_","TextInput","View","TouchableWithoutFeedback","Text","Icon","TEXT_LIGHT","TEXT_DARK","TEXT_DARKEST","FontAwesome","GenericInput","constructor","props","state","showSecureText","inputRef","createRef","blur","current","toggleSecureText","setState","renderLeftIcon","icon","iconType","createElement","name","style","styles","searchIcon","type","iconStyle","renderRightIcon","secureTextEntry","onPress","bind","clearIcon","secureIcon","rightIcon","rightIconAction","hasClear","isEmpty","value","onChangeText","render","searchInputContainer","squaredCorners","squaredSearchInputContainer","autoGrow","paddingVertical","minHeight","height","containerStyle","maxFontSizeMultiplier","ref","placeholder","placeholderTextColor","autoCorrect","autoFocus","multiline","searchText","textAlignVertical","keyboardType","returnKeyType","selectionColor","underlineColorAndroid","editable","autoCapitalize","onKeyPress","onSubmitEditing","onFocus","onBlur","flex","borderRadius","backgroundColor","alignItems","flexDirection","paddingHorizontal","fontSize","color","marginRight","marginLeft","marginTop","marginBottom","fontFamily"],"sources":["GenericInput.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport _ from \"lodash\";\nimport { TextInput, View, TouchableWithoutFeedback } from \"react-native\";\nimport { Text } from \".\";\nimport { Icon } from \"@rneui/themed\";\nimport { TEXT_LIGHT, TEXT_DARK, TEXT_DARKEST } from \"../colours\";\nimport { FontAwesome } from \"./Icon\";\n\nclass GenericInput extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tshowSecureText: false,\n\t\t};\n\t\tthis.inputRef = React.createRef();\n\t}\n\n\tblur() {\n\t\tthis.inputRef.current.blur();\n\t}\n\n\ttoggleSecureText() {\n\t\tthis.setState({\n\t\t\tshowSecureText: !this.state.showSecureText,\n\t\t});\n\t}\n\n\trenderLeftIcon() {\n\t\tif (!this.props.icon) {\n\t\t\treturn null;\n\t\t}\n\t\tif (this.props.iconType && this.props.iconType === \"pl60\") {\n\t\t\treturn <FontAwesome name={this.props.icon} style={styles.searchIcon} />;\n\t\t}\n\t\treturn (\n\t\t\t<Icon\n\t\t\t\ttype=\"font-awesome\"\n\t\t\t\tname={this.props.icon}\n\t\t\t\ticonStyle={styles.searchIcon}\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderRightIcon() {\n\t\tif (this.props.secureTextEntry) {\n\t\t\treturn (\n\t\t\t\t<TouchableWithoutFeedback onPress={this.toggleSecureText.bind(this)}>\n\t\t\t\t\t<FontAwesome\n\t\t\t\t\t\tname={this.state.showSecureText ? \"eye-slash\" : \"eye\"}\n\t\t\t\t\t\tstyle={[styles.clearIcon, styles.secureIcon]}\n\t\t\t\t\t/>\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t);\n\t\t}\n\t\tif (this.props.rightIcon) {\n\t\t\tif (this.props.rightIconAction) {\n\t\t\t\treturn (\n\t\t\t\t\t<TouchableWithoutFeedback onPress={this.props.rightIconAction}>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\tname={this.props.rightIcon}\n\t\t\t\t\t\t\ticonStyle={styles.clearIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<Icon\n\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\tname={this.props.rightIcon}\n\t\t\t\t\ticonStyle={styles.clearIcon}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tif (this.props.hasClear && !_.isEmpty(this.props.value)) {\n\t\t\treturn (\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\tonPress={() => {\n\t\t\t\t\t\tthis.props.onChangeText(\"\");\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesome name=\"circle-x\" style={styles.clearIcon} />\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.searchInputContainer,\n\t\t\t\t\tthis.props.squaredCorners && styles.squaredSearchInputContainer,\n\t\t\t\t\tthis.props.autoGrow\n\t\t\t\t\t\t? { paddingVertical: 8, minHeight: 40 }\n\t\t\t\t\t\t: { height: 36 },\n\t\t\t\t\tthis.props.containerStyle,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{this.renderLeftIcon()}\n\t\t\t\t<TextInput\n\t\t\t\t\tmaxFontSizeMultiplier={1.2}\n\t\t\t\t\tref={this.inputRef}\n\t\t\t\t\tplaceholder={this.props.placeholder}\n\t\t\t\t\tplaceholderTextColor={TEXT_LIGHT}\n\t\t\t\t\tautoCorrect={\n\t\t\t\t\t\tthis.props.autoCorrect != null ? this.props.autoCorrect : false\n\t\t\t\t\t}\n\t\t\t\t\tautoFocus={\n\t\t\t\t\t\tthis.props.autoFocus != null ? this.props.autoFocus : false\n\t\t\t\t\t}\n\t\t\t\t\tautoGrow={this.props.autoGrow != null ? this.props.autoGrow : false}\n\t\t\t\t\tmultiline={\n\t\t\t\t\t\tthis.props.multiline != null ? this.props.multiline : false\n\t\t\t\t\t}\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.searchText,\n\t\t\t\t\t\tthis.props.style,\n\t\t\t\t\t\t{ textAlignVertical: this.props.multiline ? \"top\" : \"center\" },\n\t\t\t\t\t\tthis.props.minHeight && { minHeight: this.props.minHeight },\n\t\t\t\t\t]}\n\t\t\t\t\tvalue={this.props.value}\n\t\t\t\t\tonChangeText={this.props.onChangeText}\n\t\t\t\t\tkeyboardType={this.props.keyboardType}\n\t\t\t\t\treturnKeyType={this.props.returnKeyType}\n\t\t\t\t\tselectionColor={TEXT_DARK}\n\t\t\t\t\tunderlineColorAndroid=\"rgba(0,0,0,0)\"\n\t\t\t\t\teditable={this.props.editable != null ? this.props.editable : true}\n\t\t\t\t\tautoCapitalize={this.props.autoCapitalize || \"none\"}\n\t\t\t\t\tonKeyPress={this.props.onKeyPress}\n\t\t\t\t\tonSubmitEditing={this.props.onSubmitEditing}\n\t\t\t\t\tonFocus={this.props.onFocus}\n\t\t\t\t\tonBlur={this.props.onBlur}\n\t\t\t\t\tsecureTextEntry={\n\t\t\t\t\t\tthis.props.secureTextEntry && !this.state.showSecureText\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{this.renderRightIcon()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tsearchInputContainer: {\n\t\tflex: 1,\n\t\tborderRadius: 25,\n\t\tbackgroundColor: \"#ebeff2\",\n\t\talignItems: \"center\",\n\t\tflexDirection: \"row\",\n\t\tpaddingHorizontal: 16,\n\t},\n\tsquaredSearchInputContainer: {\n\t\tborderRadius: 5,\n\t\tpaddingHorizontal: 8,\n\t},\n\tsearchIcon: {\n\t\tfontSize: 14,\n\t\tcolor: TEXT_LIGHT,\n\t\tmarginRight: 8,\n\t},\n\tclearIcon: {\n\t\tfontSize: 14,\n\t\tcolor: TEXT_LIGHT,\n\t\tmarginLeft: 8,\n\t\tmarginTop: 8,\n\t\tmarginBottom: 8,\n\t},\n\tsecureIcon: {\n\t\tfontSize: 20,\n\t},\n\tsearchText: {\n\t\tcolor: TEXT_DARKEST,\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 16,\n\t\tflex: 1,\n\t},\n};\n\nexport { GenericInput };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,SAAS,EAAEC,IAAI,EAAEC,wBAAwB,QAAQ,cAAc;AACxE,SAASC,IAAI,QAAQ,GAAG;AACxB,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,UAAU,EAAEC,SAAS,EAAEC,YAAY,QAAQ,YAAY;AAChE,SAASC,WAAW,QAAQ,QAAQ;AAEpC,MAAMC,YAAY,SAASX,SAAS,CAAC;EACpCY,WAAWA,CAACC,KAAK,EAAE;IAClB,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;MACZC,cAAc,EAAE;IACjB,CAAC;IACD,IAAI,CAACC,QAAQ,gBAAGjB,KAAK,CAACkB,SAAS,CAAC,CAAC;EAClC;EAEAC,IAAIA,CAAA,EAAG;IACN,IAAI,CAACF,QAAQ,CAACG,OAAO,CAACD,IAAI,CAAC,CAAC;EAC7B;EAEAE,gBAAgBA,CAAA,EAAG;IAClB,IAAI,CAACC,QAAQ,CAAC;MACbN,cAAc,EAAE,CAAC,IAAI,CAACD,KAAK,CAACC;IAC7B,CAAC,CAAC;EACH;EAEAO,cAAcA,CAAA,EAAG;IAChB,IAAI,CAAC,IAAI,CAACT,KAAK,CAACU,IAAI,EAAE;MACrB,OAAO,IAAI;IACZ;IACA,IAAI,IAAI,CAAC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CAACvD,KAAK,CAACuD,UAAW;MAClCC,eAAe,EAAE,IAAI,CAACxD,KAAK,CAACwD,eAAgB;MAC5CC,OAAO,EAAE,IAAI,CAACzD,KAAK,CAACyD,OAAQ;MAC5BC,MAAM,EAAE,IAAI,CAAC1D,KAAK,CAAC0D,MAAO;MAC1BtC,eAAe,EACd,IAAI,CAACpB,KAAK,CAACoB,eAAe,IAAI,CAAC,IAAI,CAACnB,KAAK,CAACC;IAC1C,CACD,CAAC,EACD,IAAI,CAACiB,eAAe,CAAC,CACjB,CAAC;EAET;AACD;AAEA,MAAMJ,MAAM,GAAG;EACdiB,oBAAoB,EAAE;IACrB2B,IAAI,EAAE,CAAC;IACPC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAE,SAAS;IAC1BC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,iBAAiB,EAAE;EACpB,CAAC;EACD9B,2BAA2B,EAAE;IAC5B0B,YAAY,EAAE,CAAC;IACfI,iBAAiB,EAAE;EACpB,CAAC;EACDhD,UAAU,EAAE;IACXiD,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAExE,UAAU;IACjByE,WAAW,EAAE;EACd,CAAC;EACD5C,SAAS,EAAE;IACV0C,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAExE,UAAU;IACjB0E,UAAU,EAAE,CAAC;IACbC,SAAS,EAAE,CAAC;IACZC,YAAY,EAAE;EACf,CAAC;EACD9C,UAAU,EAAE;IACXyC,QAAQ,EAAE;EACX,CAAC;EACDlB,UAAU,EAAE;IACXmB,KAAK,EAAEtE,YAAY;IACnB2E,UAAU,EAAE,YAAY;IACxBN,QAAQ,EAAE,EAAE;IACZN,IAAI,EAAE;EACP;AACD,CAAC;AAED,SAAS7D,YAAY","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component } from "react";
|
|
2
2
|
import _ from "lodash";
|
|
3
|
-
import {
|
|
3
|
+
import { TextInput, View, TouchableWithoutFeedback } from "react-native";
|
|
4
4
|
import { Text } from ".";
|
|
5
5
|
import { Icon } from "@rneui/themed";
|
|
6
6
|
import { TEXT_LIGHT, TEXT_DARK, TEXT_DARKEST } from "../colours";
|