Skip to content

Commit

Permalink
Add tamagui
Browse files Browse the repository at this point in the history
  • Loading branch information
dgca committed Apr 24, 2024
1 parent e67b045 commit 9b83ef4
Show file tree
Hide file tree
Showing 16 changed files with 58,467 additions and 2,980 deletions.
7,279 changes: 4,364 additions & 2,915 deletions package-lock.json

Large diffs are not rendered by default.

53,431 changes: 53,431 additions & 0 deletions packages/mobile-app/.tamagui/tamagui.config.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/mobile-app/app/(tabs)/transact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function Transact() {
<Text>{JSON.stringify(getAllAccountsResult.data)}</Text>
<Text>Mutation: {facadeResult}</Text>
<Button
onClick={async () => {
onPress={async () => {
const otherResult = await createAccount.mutateAsync("dave");
setFacadeResult(otherResult);
}}
Expand Down
36 changes: 24 additions & 12 deletions packages/mobile-app/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
import {
DarkTheme,
DefaultTheme,
ThemeProvider,
} from "@react-navigation/native";
import { Stack } from "expo-router";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

import { FacadeProvider } from "../data";
import { useColorScheme } from "react-native";
import { UIKitProvider } from "@ironfish/ui";

const queryClient = new QueryClient();

export default function Layout() {
const scheme = useColorScheme();
return (
<QueryClientProvider client={queryClient}>
<FacadeProvider>
<Stack>
<Stack.Screen
name="(tabs)"
options={{
headerShown: false,
}}
/>
</Stack>
</FacadeProvider>
</QueryClientProvider>
<ThemeProvider value={scheme === "dark" ? DarkTheme : DefaultTheme}>
<UIKitProvider colorScheme={scheme || "light"}>
<QueryClientProvider client={queryClient}>
<FacadeProvider>
<Stack>
<Stack.Screen
name="(tabs)"
options={{
headerShown: false,
}}
/>
</Stack>
</FacadeProvider>
</QueryClientProvider>
</UIKitProvider>
</ThemeProvider>
);
}
17 changes: 15 additions & 2 deletions packages/mobile-app/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
module.exports = function(api) {
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
presets: ["babel-preset-expo"],
plugins: [
...(process.env.EAS_BUILD_PLATFORM === "android"
? []
: [
[
"@tamagui/babel-plugin",
{
components: ["@ironfish/ui", "tamagui"],
config: "../../packages/ui-kit/src/theme/config.ts",
},
],
]),
],
};
};
3 changes: 2 additions & 1 deletion packages/mobile-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/react": "~18.2.45"
"@types/react": "~18.2.45",
"@tamagui/babel-plugin": "^1.95.1"
},
"private": true
}
23 changes: 19 additions & 4 deletions packages/ui-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,30 @@
"version": "0.0.1",
"description": "Component library for the Iron Fish front-end ecosystem",
"license": "MPL-2.0",
"main": "./src/index.ts",
"types": "./src/index.ts",
"sideEffects": [
"*.css"
],
"private": true,
"types": "./src",
"main": "src/index.tsx",
"module:jsx": "src",
"files": [
"types",
"dist"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "tamagui-build --skip-types",
"watch": "tamagui-build --skip-types --watch"
},
"dependencies": {
"react-strict-dom": "^0.0.3"
"@tamagui/toast": "^1.95.1",
"@tamagui/font-inter": "^1.95.1",
"@tamagui/themes": "^1.95.1",
"burnt": "^0.12.1",
"tamagui": "^1.95.1"
},
"devDependencies": {
"@tamagui/build": "^1.95.1",
"react": "18.2.0"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit 9b83ef4

Please sign in to comment.