Skip to content

Commit 48e806d

Browse files
authored
Merge branch 'main' into thedev132/cardcreation
2 parents 51cb368 + c0a06f6 commit 48e806d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+7024
-5559
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ module.exports = {
4646
],
4747
"@typescript-eslint/no-non-null-assertion": "off",
4848
"react/no-unescaped-entities": "off",
49-
"no-console": "warn",
5049
},
5150
globals: {
5251
fetch: "readonly",

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @yednapg @thedev132 @Luke-Oldenburg
1+
* @hackclub/hcb-mobile

.github/dependabot.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
## Summary of the problem
2+
23
<!-- Why these changes are being made? What problem does it solve? Link any related issues to provide more details. -->
34

45
## Describe your changes
6+
57
<!-- Explain your thought process to the solution and provide a quick summary of the changes. -->
68

79
## Checklist

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: CI
22
on:
33
push:
4-
branches:
5-
- '**'
4+
branches:
5+
- "**"
66
pull_request:
77
branches:
8-
- '**'
8+
- "**"
99
jobs:
1010
eslint:
1111
name: ESLint

.github/workflows/preview.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: preview
2+
on: pull_request
3+
4+
jobs:
5+
update:
6+
if: github.event.pull_request.head.repo.fork == false
7+
name: EAS Update
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
steps:
13+
- name: Check for EXPO_TOKEN
14+
run: |
15+
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
16+
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
17+
exit 1
18+
fi
19+
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Bun
24+
uses: oven-sh/setup-bun@v1
25+
with:
26+
bun-version: latest
27+
28+
- name: Setup EAS
29+
uses: expo/expo-github-action@v8
30+
with:
31+
eas-version: latest
32+
token: ${{ secrets.EXPO_TOKEN }}
33+
34+
- name: Install dependencies
35+
run: bun install
36+
37+
- name: 🚀 Create preview
38+
uses: expo/expo-github-action/preview@v8
39+
with:
40+
command: eas update --auto --branch preview

App.tsx

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import "expo-dev-client";
22

33
import { ActionSheetProvider } from "@expo/react-native-action-sheet";
44
import { LinkingOptions, NavigationContainer } from "@react-navigation/native";
5+
import { useStripeTerminal } from "@stripe/stripe-terminal-react-native";
56
import { useFonts } from "expo-font";
67
import * as Linking from "expo-linking";
78
import * as SecureStorage from "expo-secure-store";
89
import { useState, useEffect, useCallback } from "react";
910
import { StatusBar, useColorScheme } from "react-native";
11+
import { AlertNotificationRoot } from "react-native-alert-notification";
1012
import { SafeAreaProvider } from "react-native-safe-area-context";
1113
import { SWRConfig } from "swr";
1214

@@ -24,6 +26,8 @@ const linking: LinkingOptions<TabParamList> = {
2426
Linking.createURL("/"),
2527
"https://bank.hackclub.com",
2628
"https://hcb.hackclub.com",
29+
"http://bank.hackclub.com",
30+
"http://hcb.hackclub.com",
2731
],
2832
config: {
2933
screens: {
@@ -37,6 +41,7 @@ const linking: LinkingOptions<TabParamList> = {
3741
transactionId: (id) => `txn_${id}`,
3842
},
3943
},
44+
OrganizationLoader: ":orgId",
4045
},
4146
},
4247
Cards: {
@@ -45,27 +50,31 @@ const linking: LinkingOptions<TabParamList> = {
4550
CardList: "my/cards",
4651
},
4752
},
53+
Receipts: "my/inbox",
4854
},
4955
},
5056
getStateFromPath,
5157
};
5258

5359
export default function App() {
5460
const [fontsLoaded] = useFonts({
55-
'JetBrainsMono-Regular': require('./assets/fonts/JetBrainsMono-Regular.ttf'),
56-
'JetBrainsMono-Bold': require('./assets/fonts/JetBrainsMono-Bold.ttf'),
57-
'Consolas-Bold': require('./assets/fonts/CONSOLAB.ttf'),
61+
"JetBrainsMono-Regular": require("./assets/fonts/JetBrainsMono-Regular.ttf"),
62+
"JetBrainsMono-Bold": require("./assets/fonts/JetBrainsMono-Bold.ttf"),
63+
"Consolas-Bold": require("./assets/fonts/CONSOLAB.ttf"),
64+
Damion: require("./assets/fonts/Damion-Regular.ttf"),
5865
});
5966

6067
const [isLoading, setIsLoading] = useState(true);
6168
const [token, setToken] = useState<string | null>(null);
6269
const hcb = useClient(token);
6370
const scheme = useColorScheme();
71+
useStripeTerminal();
6472

6573
const fetcher = useCallback(
66-
async (url: string) => {
74+
async (url: string, options: RequestInit) => {
6775
try {
68-
return await hcb(url).json();
76+
// Allows us to use the v3 API in the v4 SWR
77+
return await hcb(url, options).json();
6978
} catch (error) {
7079
if (
7180
error.name === "HTTPError" &&
@@ -111,17 +120,20 @@ export default function App() {
111120

112121
<SWRConfig
113122
value={{
114-
provider: asyncStorageProvider, fetcher
123+
provider: asyncStorageProvider,
124+
fetcher,
115125
}}
116126
>
117127
<SafeAreaProvider>
118128
<ActionSheetProvider>
119-
<NavigationContainer
120-
theme={scheme == "dark" ? theme : lightTheme}
121-
linking={linking}
122-
>
123-
<Navigator />
124-
</NavigationContainer>
129+
<AlertNotificationRoot>
130+
<NavigationContainer
131+
theme={scheme == "dark" ? theme : lightTheme}
132+
linking={linking}
133+
>
134+
<Navigator />
135+
</NavigationContainer>
136+
</AlertNotificationRoot>
125137
</ActionSheetProvider>
126138
</SafeAreaProvider>
127139
</SWRConfig>

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Contributing
2+
23
Thank you for choosing to contribute to HCB Mobile! Please follow the guidelines before on how to contribute.
34

45
- Use the PR template

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,6 @@ EXPO_PUBLIC_CLIENT_ID=<uid field from the Doorkeeper app>
5858
- Bonus task: painfully watch Gradle attempt to work
5959

6060
## Contributing
61-
Please see [CONTRIBUTING.md](CONTRIBUTING.md).
61+
62+
Please see [CONTRIBUTING.md](CONTRIBUTING.md).
63+

app.config.js

Lines changed: 35 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import appIcons from "./src/lib/AppIconList";
12
const IS_DEV = process.env.APP_VARIANT === "development";
23

34
export default {
@@ -17,16 +18,19 @@ export default {
1718
},
1819
assetBundlePatterns: ["**/*"],
1920
ios: {
20-
supportsTablet: true,
21+
supportsTablet: false,
2122
bundleIdentifier: IS_DEV ? "com.hackclub.hcb.dev" : "com.hackclub.hcb",
22-
buildNumber: "1.0.0.15",
23+
buildNumber: "1.0.0.17",
2324
config: {
2425
usesNonExemptEncryption: false,
2526
},
2627
associatedDomains: [
2728
"applinks:hcb.hackclub.com",
2829
"applinks:bank.hackclub.com",
2930
],
31+
// entitlements: {
32+
// "com.apple.developer.proximity-reader.payment.acceptance": true,
33+
// }
3034
},
3135
android: {
3236
icon: "./assets/app-icon.png",
@@ -45,6 +49,12 @@ export default {
4549
projectId: "dfc97c77-31b1-4267-896f-9472c87f166c",
4650
},
4751
},
52+
updates: {
53+
url: "https://u.expo.dev/dfc97c77-31b1-4267-896f-9472c87f166c",
54+
},
55+
runtimeVersion: {
56+
policy: "appVersion",
57+
},
4858
plugins: [
4959
[
5060
"expo-image-picker",
@@ -53,73 +63,38 @@ export default {
5363
photosPermission: "Allow HCB to access your photos for receipts",
5464
},
5565
],
56-
[
57-
"expo-font",
58-
{
59-
fonts: [
60-
"./assets/fonts/JetBrainsMono-Regular.ttf",
61-
"./assets/fonts/JetBrainsMono-Bold.ttf",
62-
],
63-
},
64-
],
6566
"expo-secure-store",
6667
[
6768
"expo-local-authentication",
6869
{ faceIDPermission: "Allow $(PRODUCT_NAME) to use Face ID." },
6970
],
7071
[
71-
"expo-alternate-app-icons",
72-
[
73-
{
74-
name: "Default",
75-
ios: "./assets/app-icon.png",
76-
android: {
77-
foregroundImage: "./assets/app-icon-foreground.png",
78-
backgroundColor: "#EC3750",
79-
},
80-
},
81-
{
82-
name: "Artskillz",
83-
ios: "./assets/icons/art-skillz.png",
84-
android: {
85-
foregroundImage: "./assets/icons/art-skillz-foreground.png",
86-
backgroundColor: "#FF2500",
87-
},
88-
},
89-
{
90-
name: "Dev",
91-
ios: "./assets/icons/dev.png",
92-
android: {
93-
foregroundImage: "./assets/icons/dev-foreground.png",
94-
backgroundColor: "#33D6A6",
95-
},
96-
},
97-
{
98-
name: "Cashmoney",
99-
ios: "./assets/icons/cash-money.png",
100-
android: {
101-
foregroundImage: "./assets/icons/cash-money-foreground.png",
102-
backgroundColor: "#fff",
103-
},
104-
},
105-
{
106-
name: "Hacknight",
107-
ios: "./assets/icons/hack-night.png",
108-
android: {
109-
foregroundImage: "./assets/icons/hack-night.png",
110-
backgroundColor: "#FFD700",
111-
},
112-
},
113-
{
114-
name: "Testflight",
115-
ios: "./assets/icons/testflight.png",
116-
android: {
117-
foregroundImage: "./assets/icons/testflight.png",
118-
backgroundColor: "#FFD700",
72+
"@stripe/stripe-terminal-react-native",
73+
{
74+
bluetoothBackgroundMode: true,
75+
locationWhenInUsePermission:
76+
"Location access is required in order to accept payments.",
77+
bluetoothPeripheralPermission:
78+
"Bluetooth access is required in order to connect to supported bluetooth card readers.",
79+
bluetoothAlwaysUsagePermission:
80+
"This app uses Bluetooth to connect to supported card readers.",
81+
},
82+
],
83+
[
84+
"expo-build-properties",
85+
{
86+
android: {
87+
minSdkVersion: 26,
88+
packagingOptions: {
89+
pickFirst: [
90+
"org/bouncycastle/pqc/crypto/picnic/lowmcL*",
91+
"org/bouncycastle/x509/CertPathReviewerMessages*",
92+
],
11993
},
12094
},
121-
],
95+
},
12296
],
97+
["expo-alternate-app-icons", appIcons],
12398
],
12499
},
125100
};

0 commit comments

Comments
 (0)