Commit a44a6e17 by OuiAtichat

update

parent 3aa4cff0
...@@ -6,28 +6,32 @@ import { RectButton } from 'react-native-gesture-handler'; ...@@ -6,28 +6,32 @@ import { RectButton } from 'react-native-gesture-handler';
import Swipeable from 'react-native-gesture-handler/Swipeable'; import Swipeable from 'react-native-gesture-handler/Swipeable';
import IconMaterialIcons from 'react-native-vector-icons/MaterialIcons'; import IconMaterialIcons from 'react-native-vector-icons/MaterialIcons';
import { Overlay } from 'react-native-elements'; import { Overlay } from 'react-native-elements';
import { format } from 'date-fns';
const AnimatedIcon = Animated.createAnimatedComponent(IconMaterialIcons); const AnimatedIcon = Animated.createAnimatedComponent(IconMaterialIcons);
const Row = ({ data }) => ( const Row = ({ data }) => {
console.log(data);
return (
<RectButton style={styles.rectButton} onPress={() => alert('hello ' + data.name)}> <RectButton style={styles.rectButton} onPress={() => alert('hello ' + data.name)}>
<View style={{ flexDirection: 'row', paddingVertical: 5 }}> <View style={{ flexDirection: 'row', paddingVertical: 5 }}>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<Text style={[theme.title]}> <Text style={[theme.title]}>
{data.time} <Text style={[theme.description, theme.textDark]}>{data.period}</Text> {format(data.time, 'h:mm')}{' '}
<Text style={[theme.description, theme.textDark]}>{format(data.time, 'A')}</Text>
</Text> </Text>
<View style={theme.rowContainer}> <View style={theme.rowContainer}>
{data.day.map((item, index) => ( {data.repeatDays.map((item, index) => (
<Text <Text
key={index} key={index}
style={[ style={[
theme.description, theme.description,
{ {
color: data.active color: data.active
? item.dayActive ? item.isRepeat
? color.primary ? color.primary
: color.grey : color.grey
: item.dayActive : item.isRepeat
? color.darkGrey ? color.darkGrey
: color.grey, : color.grey,
}, },
...@@ -60,7 +64,8 @@ const Row = ({ data }) => ( ...@@ -60,7 +64,8 @@ const Row = ({ data }) => (
</View> </View>
</View> </View>
</RectButton> </RectButton>
); );
};
class SwipeableRow extends Component { class SwipeableRow extends Component {
selectedRow = null; selectedRow = null;
...@@ -91,17 +96,19 @@ class SwipeableRow extends Component { ...@@ -91,17 +96,19 @@ class SwipeableRow extends Component {
isVisible={this.state.isVisible} isVisible={this.state.isVisible}
onBackdropPress={() => this.setState({ isVisible: false })} onBackdropPress={() => this.setState({ isVisible: false })}
> >
<>
<Text style={[theme.smallTitle, theme.textDark, theme.centerText, { marginHorizontal: 30 }]}> <Text style={[theme.smallTitle, theme.textDark, theme.centerText, { marginHorizontal: 30 }]}>
Are you sure you want to delete this item?{' '} Are you sure you want to delete this item?{' '}
</Text> </Text>
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}> <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Button transparent style={{ width: '40%' }} onPress={this.cancel}> <Button transparent style={{ width: '40%' }} onPress={this.cancel} rounded>
<Text style={{ color: color.grey }}>Cancel</Text> <Text style={{ color: color.grey }}>Cancel</Text>
</Button> </Button>
<Button style={styles.delBtn} onPress={this.delete}> <Button style={styles.delBtn} onPress={this.delete} rounded>
<Text>Delete</Text> <Text>Delete</Text>
</Button> </Button>
</View> </View>
</>
</Overlay> </Overlay>
</> </>
); );
......
...@@ -12,9 +12,12 @@ ...@@ -12,9 +12,12 @@
"dependencies": { "dependencies": {
"@eva-design/eva": "^1.0.1", "@eva-design/eva": "^1.0.1",
"@react-native-community/async-storage": "^1.6.1", "@react-native-community/async-storage": "^1.6.1",
"date-fns": "^1.30.1",
"firebase": "^6.3.5", "firebase": "^6.3.5",
"lodash.set": "^4.3.2",
"native-base": "^2.12.2", "native-base": "^2.12.2",
"react": "^16.9.0", "react": "^16.9.0",
"react-addons-update": "^15.6.2",
"react-native": "^0.60.4", "react-native": "^0.60.4",
"react-native-barcode-mask": "^1.0.5", "react-native-barcode-mask": "^1.0.5",
"react-native-camera": "^2.11.1", "react-native-camera": "^2.11.1",
......
...@@ -33,7 +33,7 @@ class CameraScreen extends Component { ...@@ -33,7 +33,7 @@ class CameraScreen extends Component {
//short delay to increase frmaerate when open this screen //short delay to increase frmaerate when open this screen
setTimeout(() => { setTimeout(() => {
this.setState({ isWaiting: true }); this.setState({ isWaiting: true });
}, 500); }, 250);
}; };
handleBarCodeScanned = ({ type, data }) => { handleBarCodeScanned = ({ type, data }) => {
......
...@@ -2289,6 +2289,11 @@ data-urls@^1.0.0: ...@@ -2289,6 +2289,11 @@ data-urls@^1.0.0:
whatwg-mimetype "^2.2.0" whatwg-mimetype "^2.2.0"
whatwg-url "^7.0.0" whatwg-url "^7.0.0"
date-fns@^1.30.1:
version "1.30.1"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c"
integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==
debounce@^1.2.0: debounce@^1.2.0:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.0.tgz#44a540abc0ea9943018dc0eaa95cce87f65cd131" resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.0.tgz#44a540abc0ea9943018dc0eaa95cce87f65cd131"
...@@ -4491,6 +4496,11 @@ lodash.merge@^4.6.1: ...@@ -4491,6 +4496,11 @@ lodash.merge@^4.6.1:
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
lodash.set@^4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23"
integrity sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=
lodash.sortby@^4.7.0: lodash.sortby@^4.7.0:
version "4.7.0" version "4.7.0"
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
...@@ -5858,6 +5868,14 @@ rc@^1.2.7: ...@@ -5858,6 +5868,14 @@ rc@^1.2.7:
minimist "^1.2.0" minimist "^1.2.0"
strip-json-comments "~2.0.1" strip-json-comments "~2.0.1"
react-addons-update@^15.6.2:
version "15.6.2"
resolved "https://registry.yarnpkg.com/react-addons-update/-/react-addons-update-15.6.2.tgz#e53753c5b34887974510c882d7fb075851d5e504"
integrity sha1-5TdTxbNIh5dFEMiC1/sHWFHV5QQ=
dependencies:
fbjs "^0.8.9"
object-assign "^4.1.0"
react-deep-force-update@^1.0.0: react-deep-force-update@^1.0.0:
version "1.1.2" version "1.1.2"
resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.1.2.tgz#3d2ae45c2c9040cbb1772be52f8ea1ade6ca2ee1" resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.1.2.tgz#3d2ae45c2c9040cbb1772be52f8ea1ade6ca2ee1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment