Skip to content

Commit

Permalink
Demo pointer events
Browse files Browse the repository at this point in the history
  • Loading branch information
dgca committed Nov 10, 2024
1 parent 44079c1 commit 5f5ca7c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/mobile-app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"newArchEnabled": true
}
}
]
],
"./plugins/withPointerEvents.js"
]
}
}
12 changes: 12 additions & 0 deletions packages/mobile-app/app/(tabs)/ui.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { useState } from "react";
import { Text } from "react-native";
import { Button } from "@ironfish/tackle-box";
import { Appearance, useColorScheme, View } from "react-native";

export default function UiKit() {
const scheme = useColorScheme();
const [count, setCount] = useState(0);
return (
<View
style={{
Expand All @@ -11,12 +14,21 @@ export default function UiKit() {
backgroundColor: scheme === "dark" ? "#333" : "#fff",
}}
>
<Text>Count: {count}</Text>
<View
onPointerDown={() => {
setCount(count + 1);
}}
style={{ height: 100, width: 100, backgroundColor: "blue" }}
/>

<Button
label="Toggle color scheme"
onPress={() => {
Appearance.setColorScheme(scheme === "dark" ? "light" : "dark");
}}
/>

{/* Solid */}
<Button label="Click me" />

Expand Down

0 comments on commit 5f5ca7c

Please sign in to comment.