Skip to content

Commit c2fd4c7

Browse files
authored
Merge pull request #686 from OskarEichler/codex/viewshot-expo-result-controls
fix(example): show only supported results for the imperative Expo demo
2 parents c09771e + beef789 commit c2fd4c7

1 file changed

Lines changed: 22 additions & 18 deletions

File tree

example-expo/App.tsx

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -137,26 +137,30 @@ export default function App() {
137137
<View style={styles.buttons}>
138138
<Text style={styles.sectionTitle}>Capture Options:</Text>
139139

140-
<TouchableOpacity
141-
style={[styles.btn, {backgroundColor: "#007AFF"}]}
142-
onPress={() => capture("png", "data-uri")}
143-
>
144-
<Text style={styles.btnText}>PNG (Data URI)</Text>
145-
</TouchableOpacity>
140+
{mode === "view-ref" && (
141+
<>
142+
<TouchableOpacity
143+
style={[styles.btn, {backgroundColor: "#007AFF"}]}
144+
onPress={() => capture("png", "data-uri")}
145+
>
146+
<Text style={styles.btnText}>PNG (Data URI)</Text>
147+
</TouchableOpacity>
146148

147-
<TouchableOpacity
148-
style={[styles.btn, {backgroundColor: "#34C759"}]}
149-
onPress={() => capture("jpg", "data-uri")}
150-
>
151-
<Text style={styles.btnText}>JPG (Data URI)</Text>
152-
</TouchableOpacity>
149+
<TouchableOpacity
150+
style={[styles.btn, {backgroundColor: "#34C759"}]}
151+
onPress={() => capture("jpg", "data-uri")}
152+
>
153+
<Text style={styles.btnText}>JPG (Data URI)</Text>
154+
</TouchableOpacity>
153155

154-
<TouchableOpacity
155-
style={[styles.btn, {backgroundColor: "#FF9500"}]}
156-
onPress={() => capture("png", "base64")}
157-
>
158-
<Text style={styles.btnText}>PNG (Base64)</Text>
159-
</TouchableOpacity>
156+
<TouchableOpacity
157+
style={[styles.btn, {backgroundColor: "#FF9500"}]}
158+
onPress={() => capture("png", "base64")}
159+
>
160+
<Text style={styles.btnText}>PNG (Base64)</Text>
161+
</TouchableOpacity>
162+
</>
163+
)}
160164

161165
<TouchableOpacity
162166
style={[styles.btn, {backgroundColor: "#FF3B30"}]}

0 commit comments

Comments
 (0)