Skip to content

Commit

Permalink
make it not crash on android
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdenio committed Sep 11, 2023
1 parent b1800d9 commit 48e1f80
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
2 changes: 2 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export default function App() {
iconName = focused ? "receipt" : "receipt-outline";
} else if (route.name === "Settings") {
iconName = focused ? "settings" : "settings-outline";
} else {
throw new Error("unknown route name");
}

return <Ionicons name={iconName} size={size} color={color} />;
Expand Down
6 changes: 3 additions & 3 deletions src/auth.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createContext } from "react";

const AuthContext = createContext<{
token?: string | null;
setToken?: React.Dispatch<string>;
}>({});
token: string | null;
setToken: React.Dispatch<string>;
}>({ token: null, setToken: () => {} });

export default AuthContext;
12 changes: 6 additions & 6 deletions src/components/Transaction.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { View, PlatformColor, Text } from "react-native";
import { View, Text } from "react-native";
import { Ionicons } from "@expo/vector-icons";
import { palette } from "../theme";
import { renderMoney } from "../util";
Expand Down Expand Up @@ -41,15 +41,15 @@ export default function Transaction({
alignItems: "center",
marginHorizontal: 20,
backgroundColor: palette.darkless,
borderTopLeftRadius: top == true && 8,
borderTopRightRadius: top == true && 8,
borderBottomLeftRadius: bottom == true && 8,
borderBottomRightRadius: bottom == true && 8,
borderTopLeftRadius: top ? 8 : 0,
borderTopRightRadius: top ? 8 : 0,
borderBottomLeftRadius: bottom ? 8 : 0,
borderBottomRightRadius: bottom ? 8 : 0,
}}
>
<Ionicons
name={transactionIcon(transaction.code)}
color={PlatformColor("systemGray2")}
color={palette.muted}
size={20}
style={{ marginRight: 10 }}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types/Card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export default interface Card {
type: "virtual" | "physical";
status: "inactive" | "frozen" | "active" | "canceled";
name?: string;
organization?: Organization;
organization: Organization;
}
2 changes: 1 addition & 1 deletion src/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const redirectUri = makeRedirectUri({ scheme: "hcb" });
export default function Login() {
const [request, response, promptAsync] = useAuthRequest(
{
clientId: process.env.EXPO_PUBLIC_CLIENT_ID,
clientId: process.env.EXPO_PUBLIC_CLIENT_ID!,
redirectUri,
scopes: ["read", "write"],
extraParams: {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"jsx": "react-jsx",
"noImplicitAny": true
"noImplicitAny": true,
"strictNullChecks": true
},
"extends": "expo/tsconfig.base"
}

0 comments on commit 48e1f80

Please sign in to comment.