-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearchResults.js
More file actions
52 lines (47 loc) · 1.2 KB
/
Copy pathSearchResults.js
File metadata and controls
52 lines (47 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React, { Component } from "react";
import { StyleSheet, Text, View } from "react-native";
import CardCard from "./CardCard";
export default class SearchResults extends Component {
constructor(props) {
super(props);
}
render() {
// this.state = {responseText: "loading"};
const target_card = this.props.response.target_card;
if (
this.props.response.similar_cards == null ||
this.props.response.similar_cards === undefined
) {
return (
<View>
<Text>
No similar cards.
</Text>
</View>
);
}
return (
<View>
<Text style={{ textAlign: "center" }}>
Your search
</Text>
<View style={[styles.searchedCard]}>
<CardCard card={target_card} />
</View>
<Text style={{ textAlign: "center" }}>
Tap a card to view on Scryfall. Long tap to copy/paste.
</Text>
<View>
{this.props.response.similar_cards.map((cardObj, index) => (
<CardCard card={cardObj} key={index} />
))}
</View>
</View>
);
}
}
const styles = StyleSheet.create({
searchedCard: {
backgroundColor: "wheat"
}
});