aboutsummaryrefslogtreecommitdiff
path: root/src/components/onboarding
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/onboarding')
-rw-r--r--src/components/onboarding/ArrowButton.tsx44
-rw-r--r--src/components/onboarding/TaggInput.tsx11
2 files changed, 41 insertions, 14 deletions
diff --git a/src/components/onboarding/ArrowButton.tsx b/src/components/onboarding/ArrowButton.tsx
index 57ebc774..78dbab32 100644
--- a/src/components/onboarding/ArrowButton.tsx
+++ b/src/components/onboarding/ArrowButton.tsx
@@ -1,26 +1,46 @@
import React from 'react';
-import {Image, TouchableOpacity, TouchableOpacityProps} from 'react-native';
+import {
+ Image,
+ StyleSheet,
+ TouchableOpacity,
+ TouchableOpacityProps,
+} from 'react-native';
interface ArrowButtonProps extends TouchableOpacityProps {
direction: 'forward' | 'backward';
disabled?: boolean;
- onboarding?: boolean
+ onboarding?: boolean;
}
-const ArrowButton: React.FC<ArrowButtonProps> = (props: ArrowButtonProps) => {
- const arrow =
- props.direction === 'forward'
- ? props.disabled
- ? require('../../assets/images/arrow-forward-disabled.png')
- : require('../../assets/images/arrow-forward-enabled.png')
- : require('../../assets/images/arrow-backward.png')
- ? props.onboarding
- : require ('../../assets/images/onboarding-arrow.png')
+const ArrowButton: React.FC<ArrowButtonProps> = (props) => {
+ const {direction, disabled, onboarding} = props;
+ let uri;
+
+ if (direction === 'forward') {
+ if (disabled) {
+ uri = require('../../assets/images/arrow-forward-disabled.png');
+ } else {
+ uri = require('../../assets/images/arrow-forward-enabled.png');
+ }
+ } else {
+ if (onboarding) {
+ uri = require('../../assets/images/onboarding-backarrow.png');
+ } else {
+ uri = require('../../assets/images/arrow-backward.png');
+ }
+ }
return (
<TouchableOpacity {...props}>
- <Image source={arrow} />
+ <Image style={styles.image} source={uri} />
</TouchableOpacity>
);
};
+const styles = StyleSheet.create({
+ image: {
+ // width: '100%',
+ // height: '100%',
+ },
+});
+
export default ArrowButton;
diff --git a/src/components/onboarding/TaggInput.tsx b/src/components/onboarding/TaggInput.tsx
index d52117b0..297392e5 100644
--- a/src/components/onboarding/TaggInput.tsx
+++ b/src/components/onboarding/TaggInput.tsx
@@ -1,5 +1,12 @@
import React from 'react';
-import {View, TextInput, StyleSheet, TextInputProps, ViewStyle, StyleProp} from 'react-native';
+import {
+ View,
+ TextInput,
+ StyleSheet,
+ TextInputProps,
+ ViewStyle,
+ StyleProp,
+} from 'react-native';
import * as Animatable from 'react-native-animatable';
import {TAGG_LIGHT_PURPLE} from '../../constants';
@@ -7,7 +14,7 @@ interface TaggInputProps extends TextInputProps {
valid?: boolean;
invalidWarning?: string;
attemptedSubmit?: boolean;
- externalStyles?: Record<string, StyleProp<ViewStyle>>
+ externalStyles?: Record<string, StyleProp<ViewStyle>>;
}
/**
* An input component that receives all props a normal TextInput component does. TaggInput components grow to 60% of their parent's width by default, but this can be set using the `width` prop.