Skip to content

Commit d6625a4

Browse files
committed
Hide the details unless server response
1 parent 7053767 commit d6625a4

File tree

1 file changed

+180
-116
lines changed

1 file changed

+180
-116
lines changed

src/screens/Realtime/index.js

+180-116
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,15 @@ export default class Realtime extends Component {
3636
ShortInfo: "",
3737
brandName: "null",
3838
manufacturer: "null",
39-
specs: [["Material", "null"], ["Plating", "null"], ["Lifestatus", "null"], ["RoHS", "null"]],
39+
specs: [
40+
["Material", "null"],
41+
["Plating", "null"],
42+
["Lifestatus", "null"],
43+
["RoHS", "null"]
44+
],
4045
octopartUrl: "https://github.com/aryaminus/nazar",
41-
flashMode: RNCamera.Constants.FlashMode.auto,
42-
flash: "auto",
46+
flashMode: RNCamera.Constants.FlashMode.off,
47+
flash: "off",
4348
showFlashOptions: false,
4449
type: RNCamera.Constants.Type.back,
4550
visible: false,
@@ -52,7 +57,7 @@ export default class Realtime extends Component {
5257
this.showFlashOptionsBlock = this.showFlashOptionsBlock.bind(this);
5358
this.switchCamera = this.switchCamera.bind(this);
5459
timer.setInterval(this, "takePicture", () => this.takePicture(), 1000);
55-
timer.setInterval(this, "clearInterval", () => this.clearInterval(), 30000);
60+
//timer.setInterval(this, "clearInterval", () => this.clearInterval(), 30000);
5661
}
5762

5863
componentDidMount() {
@@ -151,7 +156,12 @@ export default class Realtime extends Component {
151156
ShortInfo: "",
152157
brandName: "null",
153158
manufacturer: "null",
154-
specs: [["Material", "null"], ["Plating", "null"], ["Lifestatus", "null"], ["RoHS", "null"]],
159+
specs: [
160+
["Material", "null"],
161+
["Plating", "null"],
162+
["Lifestatus", "null"],
163+
["RoHS", "null"]
164+
],
155165
detail: false
156166
});
157167
}
@@ -335,6 +345,171 @@ export default class Realtime extends Component {
335345
visible={this.state.visible}
336346
onRequestClose={() => this.setState({ visible: false })}
337347
>
348+
{this.state.detail && (
349+
<View style={styles.slider}>
350+
<Text
351+
style={{
352+
fontSize: 26,
353+
color: "#00aeefff",
354+
fontFamily: "bold",
355+
marginTop: 80
356+
}}
357+
/>
358+
<View
359+
style={{
360+
flex: 1,
361+
flexDirection: "row",
362+
marginTop: 20,
363+
marginHorizontal: 40,
364+
justifyContent: "center",
365+
alignItems: "center",
366+
marginBottom: 40
367+
}}
368+
>
369+
<Text
370+
style={{
371+
flex: 1,
372+
fontSize: 26,
373+
color: "#00aeefff",
374+
fontFamily: "bold"
375+
}}
376+
>
377+
{this.state.result}
378+
</Text>
379+
<Text
380+
style={{
381+
flex: 0.5,
382+
fontSize: 15,
383+
color: "gray",
384+
textAlign: "left",
385+
marginTop: 5
386+
}}
387+
/>
388+
<Text
389+
style={{
390+
flex: 1,
391+
fontSize: 26,
392+
color: "green",
393+
fontFamily: "bold",
394+
textAlign: "right"
395+
}}
396+
>
397+
{this.state.value}
398+
</Text>
399+
</View>
400+
<View
401+
style={{
402+
justifyContent: "center",
403+
alignItems: "center",
404+
marginRight: 35,
405+
flexDirection: "row"
406+
}}
407+
>
408+
<Text
409+
style={{
410+
fontSize: 17,
411+
color: "white",
412+
textAlign: "center",
413+
marginLeft: 40,
414+
fontFamily: "regular"
415+
}}
416+
>
417+
{this.state.ShortInfo}
418+
</Text>
419+
</View>
420+
<View style={{ marginTop: 30 }}>
421+
<View
422+
style={{
423+
flexDirection: "row",
424+
marginHorizontal: 40,
425+
justifyContent: "center"
426+
}}
427+
>
428+
<Text
429+
style={{
430+
fontSize: 20,
431+
color: "rgba(216, 121, 112, 1)",
432+
fontFamily: "regular",
433+
marginLeft: 20,
434+
textAlign: "left"
435+
}}
436+
>
437+
INFO
438+
</Text>
439+
</View>
440+
<View
441+
style={{
442+
flexDirection: "row",
443+
marginTop: 20,
444+
marginHorizontal: 30
445+
}}
446+
>
447+
<View style={{ flexDirection: "row" }}>
448+
<View style={{}}>
449+
<Text style={styles.infoTypeLabel}>Brand Name</Text>
450+
<Text style={styles.infoTypeLabel}>Manufacturer</Text>
451+
{this.state.specs.map((item, key) => (
452+
<Text key={key} style={styles.infoTypeLabel}>
453+
{item[0]}
454+
</Text>
455+
))}
456+
</View>
457+
<View style={{ marginLeft: 10 }}>
458+
<Text style={styles.infoAnswerLabel}>
459+
{this.state.brandName}
460+
</Text>
461+
<Text style={styles.infoAnswerLabel}>
462+
{this.state.manufacturer}
463+
</Text>
464+
{this.state.specs.map((item, key) => (
465+
<Text key={key} style={styles.infoAnswerLabel}>
466+
{item[1]}
467+
</Text>
468+
))}
469+
</View>
470+
</View>
471+
</View>
472+
</View>
473+
<View style={{ marginTop: 20 }}>
474+
<View
475+
style={{
476+
flexDirection: "row",
477+
marginHorizontal: 40,
478+
justifyContent: "center"
479+
}}
480+
>
481+
<Text
482+
style={{
483+
fontSize: 17,
484+
color: "white",
485+
fontFamily: "regular",
486+
marginLeft: 20,
487+
textAlign: "left"
488+
}}
489+
>
490+
For Further Details:
491+
</Text>
492+
</View>
493+
</View>
494+
<View style={{ marginTop: 10 }}>
495+
<View
496+
style={{
497+
flexDirection: "row",
498+
marginHorizontal: 40,
499+
justifyContent: "center"
500+
}}
501+
>
502+
<Icon
503+
iconStyle={styles.octopart}
504+
type="font-awesome"
505+
name="info-circle"
506+
size={40}
507+
onPress={() => Linking.openURL(this.state.octopartUrl)}
508+
/>
509+
</View>
510+
</View>
511+
</View>
512+
)}
338513
<View style={styles.slider}>
339514
<Text
340515
style={{
@@ -386,117 +561,6 @@ export default class Realtime extends Component {
386561
{this.state.value}
387562
</Text>
388563
</View>
389-
<View
390-
style={{
391-
justifyContent: "center",
392-
alignItems: "center",
393-
marginRight: 35,
394-
flexDirection: "row"
395-
}}
396-
>
397-
<Text
398-
style={{
399-
fontSize: 17,
400-
color: "white",
401-
textAlign: "center",
402-
marginLeft: 40,
403-
fontFamily: "regular"
404-
}}
405-
>
406-
{this.state.ShortInfo}
407-
</Text>
408-
</View>
409-
<View style={{ marginTop: 30 }}>
410-
<View
411-
style={{
412-
flexDirection: "row",
413-
marginHorizontal: 40,
414-
justifyContent: "center"
415-
}}
416-
>
417-
<Text
418-
style={{
419-
fontSize: 20,
420-
color: "rgba(216, 121, 112, 1)",
421-
fontFamily: "regular",
422-
marginLeft: 20,
423-
textAlign: "left"
424-
}}
425-
>
426-
INFO
427-
</Text>
428-
</View>
429-
<View
430-
style={{
431-
flexDirection: "row",
432-
marginTop: 20,
433-
marginHorizontal: 30
434-
}}
435-
>
436-
<View style={{ flexDirection: "row" }}>
437-
<View style={{}}>
438-
<Text style={styles.infoTypeLabel}>Brand Name</Text>
439-
<Text style={styles.infoTypeLabel}>Manufacturer</Text>
440-
{this.state.specs.map((item, key) => (
441-
<Text key={key} style={styles.infoTypeLabel}>
442-
{item[0]}
443-
</Text>
444-
))}
445-
</View>
446-
<View style={{ marginLeft: 10 }}>
447-
<Text style={styles.infoAnswerLabel}>
448-
{this.state.brandName}
449-
</Text>
450-
<Text style={styles.infoAnswerLabel}>
451-
{this.state.manufacturer}
452-
</Text>
453-
{this.state.specs.map((item, key) => (
454-
<Text key={key} style={styles.infoAnswerLabel}>
455-
{item[1]}
456-
</Text>
457-
))}
458-
</View>
459-
</View>
460-
</View>
461-
</View>
462-
<View style={{ marginTop: 20 }}>
463-
<View
464-
style={{
465-
flexDirection: "row",
466-
marginHorizontal: 40,
467-
justifyContent: "center"
468-
}}
469-
>
470-
<Text
471-
style={{
472-
fontSize: 17,
473-
color: "white",
474-
fontFamily: "regular",
475-
marginLeft: 20,
476-
textAlign: "left"
477-
}}
478-
>
479-
For Further Details:
480-
</Text>
481-
</View>
482-
</View>
483-
<View style={{ marginTop: 10 }}>
484-
<View
485-
style={{
486-
flexDirection: "row",
487-
marginHorizontal: 40,
488-
justifyContent: "center"
489-
}}
490-
>
491-
<Icon
492-
iconStyle={styles.octopart}
493-
type="font-awesome"
494-
name="info-circle"
495-
size={40}
496-
onPress={() => Linking.openURL(this.state.octopartUrl)}
497-
/>
498-
</View>
499-
</View>
500564
</View>
501565
</SlidingUpPanel>
502566
</View>

0 commit comments

Comments
 (0)