Skip to content
This repository was archived by the owner on Sep 13, 2020. It is now read-only.

Commit 7608e53

Browse files
committed
updating example to be cleaner and with less state.
1 parent a6cf413 commit 7608e53

File tree

3 files changed

+44
-44
lines changed

3 files changed

+44
-44
lines changed

examples/simple/index.ios.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ var simple = React.createClass({
6161

6262
getInitialState: function() {
6363
return {
64-
touchToClose: false,
65-
isOpen: false
64+
touchToClose: false
6665
};
6766
},
6867

@@ -72,11 +71,12 @@ var simple = React.createClass({
7271
});
7372
},
7473

75-
handleChange: function() {
76-
this.setState({
77-
isOpen: !this.state.isOpen,
78-
touchToClose: this.state.touchToClose ? false : this.state.touchToClose
79-
});
74+
handleChange: function(isOpen) {
75+
if (!isOpen) { // when it closes, reset touchToClose
76+
this.setState({
77+
touchToClose: false
78+
});
79+
}
8080
},
8181

8282
render: function() {

examples/simple/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
},
88
"dependencies": {
99
"react-native": "^0.4",
10-
"react-native-side-menu": "^0.5"
10+
"react-native-side-menu": "^0.7"
1111
}
1212
}

examples/simple/simple.xcodeproj/project.pbxproj

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
00481BE81AC0C86700671115 /* libRCTWebSocketDebugger.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00481BE61AC0C7FA00671115 /* libRCTWebSocketDebugger.a */; };
1110
00481BEA1AC0C89D00671115 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 00481BE91AC0C89D00671115 /* libicucore.dylib */; };
1211
008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 008F07F21AC5B25A0029DE68 /* main.jsbundle */; };
1312
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
@@ -21,17 +20,11 @@
2120
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
2221
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
2322
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
23+
665160AE1B1D223300CE95F9 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 665160AD1B1D222400CE95F9 /* libRCTWebSocket.a */; };
2424
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
2525
/* End PBXBuildFile section */
2626

2727
/* Begin PBXContainerItemProxy section */
28-
00481BE51AC0C7FA00671115 /* PBXContainerItemProxy */ = {
29-
isa = PBXContainerItemProxy;
30-
containerPortal = 00481BDB1AC0C7FA00671115 /* RCTWebSocketDebugger.xcodeproj */;
31-
proxyType = 2;
32-
remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;
33-
remoteInfo = RCTWebSocketDebugger;
34-
};
3528
00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = {
3629
isa = PBXContainerItemProxy;
3730
containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
@@ -81,6 +74,13 @@
8174
remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
8275
remoteInfo = React;
8376
};
77+
665160AC1B1D222400CE95F9 /* PBXContainerItemProxy */ = {
78+
isa = PBXContainerItemProxy;
79+
containerPortal = 665160A81B1D222300CE95F9 /* RCTWebSocket.xcodeproj */;
80+
proxyType = 2;
81+
remoteGlobalIDString = 3C86DF461ADF2C930047B81A;
82+
remoteInfo = RCTWebSocket;
83+
};
8484
832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {
8585
isa = PBXContainerItemProxy;
8686
containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
@@ -91,24 +91,24 @@
9191
/* End PBXContainerItemProxy section */
9292

9393
/* Begin PBXFileReference section */
94-
00481BDB1AC0C7FA00671115 /* RCTWebSocketDebugger.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocketDebugger.xcodeproj; path = node_modules/react-native/Libraries/RCTWebSocketDebugger/RCTWebSocketDebugger.xcodeproj; sourceTree = "<group>"; };
9594
00481BE91AC0C89D00671115 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; };
9695
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = iOS/main.jsbundle; sourceTree = "<group>"; };
97-
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = "<group>"; };
98-
00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAdSupport.xcodeproj; path = node_modules/react-native/Libraries/AdSupport/RCTAdSupport.xcodeproj; sourceTree = "<group>"; };
99-
00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = "<group>"; };
100-
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = node_modules/react-native/Libraries/Image/RCTImage.xcodeproj; sourceTree = "<group>"; };
101-
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj; sourceTree = "<group>"; };
102-
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = "<group>"; };
96+
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = "<group>"; };
97+
00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAdSupport.xcodeproj; path = "node_modules/react-native/Libraries/AdSupport/RCTAdSupport.xcodeproj"; sourceTree = "<group>"; };
98+
00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = "<group>"; };
99+
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = "<group>"; };
100+
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = "<group>"; };
101+
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = "<group>"; };
103102
13B07F961A680F5B00A75B9A /* simple.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = simple.app; sourceTree = BUILT_PRODUCTS_DIR; };
104103
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = iOS/AppDelegate.h; sourceTree = "<group>"; };
105104
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = iOS/AppDelegate.m; sourceTree = "<group>"; };
106105
13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
107106
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = iOS/Images.xcassets; sourceTree = "<group>"; };
108107
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iOS/Info.plist; sourceTree = "<group>"; };
109108
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iOS/main.m; sourceTree = "<group>"; };
110-
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = node_modules/react-native/React/React.xcodeproj; sourceTree = "<group>"; };
111-
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = node_modules/react-native/Libraries/Text/RCTText.xcodeproj; sourceTree = "<group>"; };
109+
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
110+
665160A81B1D222300CE95F9 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "node_modules/react-native/Libraries/Vibration/../WebSocket/RCTWebSocket.xcodeproj"; sourceTree = "<group>"; };
111+
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
112112
/* End PBXFileReference section */
113113

114114
/* Begin PBXFrameworksBuildPhase section */
@@ -118,28 +118,20 @@
118118
files = (
119119
00481BEA1AC0C89D00671115 /* libicucore.dylib in Frameworks */,
120120
146834051AC3E58100842450 /* libReact.a in Frameworks */,
121-
00481BE81AC0C86700671115 /* libRCTWebSocketDebugger.a in Frameworks */,
122121
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
123122
00C302E61ABCBA2D00DB3ED1 /* libRCTAdSupport.a in Frameworks */,
124123
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
125124
00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,
126125
00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,
127126
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
128127
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
128+
665160AE1B1D223300CE95F9 /* libRCTWebSocket.a in Frameworks */,
129129
);
130130
runOnlyForDeploymentPostprocessing = 0;
131131
};
132132
/* End PBXFrameworksBuildPhase section */
133133

134134
/* Begin PBXGroup section */
135-
00481BDC1AC0C7FA00671115 /* Products */ = {
136-
isa = PBXGroup;
137-
children = (
138-
00481BE61AC0C7FA00671115 /* libRCTWebSocketDebugger.a */,
139-
);
140-
name = Products;
141-
sourceTree = "<group>";
142-
};
143135
00C302A81ABCB8CE00DB3ED1 /* Products */ = {
144136
isa = PBXGroup;
145137
children = (
@@ -210,9 +202,18 @@
210202
name = Products;
211203
sourceTree = "<group>";
212204
};
205+
665160A91B1D222300CE95F9 /* Products */ = {
206+
isa = PBXGroup;
207+
children = (
208+
665160AD1B1D222400CE95F9 /* libRCTWebSocket.a */,
209+
);
210+
name = Products;
211+
sourceTree = "<group>";
212+
};
213213
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
214214
isa = PBXGroup;
215215
children = (
216+
665160A81B1D222300CE95F9 /* RCTWebSocket.xcodeproj */,
216217
146833FF1AC3E56700842450 /* React.xcodeproj */,
217218
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
218219
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
@@ -221,7 +222,6 @@
221222
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,
222223
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,
223224
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
224-
00481BDB1AC0C7FA00671115 /* RCTWebSocketDebugger.xcodeproj */,
225225
00481BE91AC0C89D00671115 /* libicucore.dylib */,
226226
);
227227
name = Libraries;
@@ -324,8 +324,8 @@
324324
ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
325325
},
326326
{
327-
ProductGroup = 00481BDC1AC0C7FA00671115 /* Products */;
328-
ProjectRef = 00481BDB1AC0C7FA00671115 /* RCTWebSocketDebugger.xcodeproj */;
327+
ProductGroup = 665160A91B1D222300CE95F9 /* Products */;
328+
ProjectRef = 665160A81B1D222300CE95F9 /* RCTWebSocket.xcodeproj */;
329329
},
330330
{
331331
ProductGroup = 146834001AC3E56700842450 /* Products */;
@@ -340,13 +340,6 @@
340340
/* End PBXProject section */
341341

342342
/* Begin PBXReferenceProxy section */
343-
00481BE61AC0C7FA00671115 /* libRCTWebSocketDebugger.a */ = {
344-
isa = PBXReferenceProxy;
345-
fileType = archive.ar;
346-
path = libRCTWebSocketDebugger.a;
347-
remoteRef = 00481BE51AC0C7FA00671115 /* PBXContainerItemProxy */;
348-
sourceTree = BUILT_PRODUCTS_DIR;
349-
};
350343
00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = {
351344
isa = PBXReferenceProxy;
352345
fileType = archive.ar;
@@ -396,6 +389,13 @@
396389
remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
397390
sourceTree = BUILT_PRODUCTS_DIR;
398391
};
392+
665160AD1B1D222400CE95F9 /* libRCTWebSocket.a */ = {
393+
isa = PBXReferenceProxy;
394+
fileType = archive.ar;
395+
path = libRCTWebSocket.a;
396+
remoteRef = 665160AC1B1D222400CE95F9 /* PBXContainerItemProxy */;
397+
sourceTree = BUILT_PRODUCTS_DIR;
398+
};
399399
832341B51AAA6A8300B99B32 /* libRCTText.a */ = {
400400
isa = PBXReferenceProxy;
401401
fileType = archive.ar;

0 commit comments

Comments
 (0)