Skip to content

Commit ba79fc9

Browse files
committed
bugs on day14 fixed
png won’t update bug fixed on day14.
1 parent d817bf4 commit ba79fc9

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

README.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,41 @@ This project is inspired by
1313
## Installation
1414
Require node.js , xcode & cocoapods
1515

16-
\#1 `$ npm install`
16+
\#1 `$ npm install`
1717

1818
IOS
1919

20-
\#2 run ios/ThirtyDaysOfReactNative.xcworkspace
20+
\#2 run ios/ThirtyDaysOfReactNative.xcworkspace
2121

2222
Android
2323

24-
\#2 `$ react-native run-android`
24+
\#2 `$ react-native run-android`
2525

2626
##ToDO
2727

28-
\#1 Add Android Support.
28+
\#1 Add Android Support.
29+
30+
\#2 ~~iPhone Compatibility~~.
2931

30-
\#2 ~~iPhone Compatibility~~.
32+
\#3 Add OSX Support. (https://github.com/ptmt/react-native-desktop)
3133

32-
\#3 Add OSX Support. (https://github.com/ptmt/react-native-desktop)
33-
34-
\#4 Add UWP Support when it is released. (https://blogs.windows.com/buildingapps/2016/04/13/react-native-on-the-universal-windows-platform/)
34+
\#4 Add UWP Support when it is released. (https://blogs.windows.com/buildingapps/2016/04/13/react-native-on-the-universal-windows-platform/)
3535

3636
##Compatibility
3737

38-
Compatible with iPhone 4, 5/5s, 6/6s, 6+/6s+.
38+
Compatible with iPhone 4/4s, 5/5s, 6/6s, 6+/6s+.
3939

4040
##Running on Device
4141

4242
https://facebook.github.io/react-native/docs/running-on-device-ios.html#content
4343

4444
##Known Bugs
45-
\#1 A warning occurs from package react-native-swiper
45+
46+
\#1 A warning occurs from package react-native-swiper
4647

4748
Solution here:
4849
https://github.com/leecade/react-native-swiper/pull/113/commits/e681a8e5f347efbf10b445647321b1f0865e31a4
4950

50-
\#2 PNG format images won't update on day14 tinder switch.
51-
52-
Issue here:
53-
https://github.com/meteor-factory/react-native-tinder-swipe-cards/issues/7
5451

5552
## Day 1
5653
An IOS-system-like stop watch.

view/day14.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,15 @@ class Card extends Component{
4646

4747
class SCard extends Component{
4848
static propTypes = {
49+
id: React.PropTypes.string.isRequired,
4950
top: React.PropTypes.number.isRequired,
5051
width: React.PropTypes.number.isRequired,
5152
img: React.PropTypes.string.isRequired,
5253
};
5354

5455
render(){
5556
return(
56-
<View style={[styles.scard,{top:this.props.top,width:this.props.width}]}>
57+
<View key={this.props.id} style={[styles.scard,{top:this.props.top,width:this.props.width}]}>
5758
<Image style={{width:this.props.width-2,height:350}} source={{uri:this.props.img}}></Image>
5859
<View style={styles.cardInfo}>
5960
<View>
@@ -82,7 +83,7 @@ class SwipeCard extends Component{
8283
// const simgs = ["https://media.giphy.com/media/GfXFVHUzjlbOg/giphy.gif","https://media.giphy.com/media/irTuv1L1T34TC/giphy.gif","https://media.giphy.com/media/LkLL0HJerdXMI/giphy.gif","https://media.giphy.com/media/fFBmUMzFL5zRS/giphy.gif","https://media.giphy.com/media/oDLDbBgf0dkis/giphy.gif"];
8384
const names=["Stuart","Bob","Kevin","Dave","Jerry"];
8485
const cards = simgs.map(function(elem, index) {
85-
return {img:simgs[4-index], name:names[4-index], top:13+index*4, width:Util.size.width-22-index*4,}
86+
return {id:"sc"+index,img:simgs[4-index], name:names[4-index], top:13+index*4, width:Util.size.width-22-index*4,}
8687
})
8788

8889
this.state = {
@@ -102,7 +103,7 @@ class SwipeCard extends Component{
102103
return (
103104
<SwipeCards
104105
cards={this.state.cards}
105-
renderCard={(cardData) => <SCard {...cardData} />}
106+
renderCard={(cardData) => <SCard key={cardData.id} {...cardData} />}
106107
handleYup={() => this.handleYup()}
107108
handleNope={() => this.handleNope()}
108109
showYup={false}

0 commit comments

Comments
 (0)