From 12f7344f9b64b7c0fa5e4dbd596002730f81a49f Mon Sep 17 00:00:00 2001 From: Mohamad Mortada Date: Sun, 19 Jan 2025 17:38:53 -0800 Subject: [PATCH 1/4] Create preview.yml --- .github/workflows/preview.yml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/preview.yml diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 0000000..760e494 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,39 @@ +name: preview +on: pull_request + +jobs: + update: + name: EAS Update + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Check for EXPO_TOKEN + run: | + if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then + 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" + exit 1 + fi + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Setup EAS + uses: expo/expo-github-action@v8 + with: + eas-version: latest + token: ${{ secrets.EXPO_TOKEN }} + + - name: Install dependencies + run: bun install + + - name: 🚀 Create preview + uses: expo/expo-github-action/preview@v8 + with: + command: eas update --auto --branch preview From 859c51d4ca7f192ad404e8f90281fd233938babf Mon Sep 17 00:00:00 2001 From: Mohamad Mortada Date: Wed, 22 Jan 2025 10:27:08 -0800 Subject: [PATCH 2/4] minor changes --- .../organizations/transfer/Disbursement.tsx | 21 +++++++++++-------- src/pages/organization/index.tsx | 14 +++++++------ 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/components/organizations/transfer/Disbursement.tsx b/src/components/organizations/transfer/Disbursement.tsx index 761ac22..843d23f 100644 --- a/src/components/organizations/transfer/Disbursement.tsx +++ b/src/components/organizations/transfer/Disbursement.tsx @@ -7,6 +7,7 @@ import { TouchableOpacity, ActivityIndicator, Alert, + useColorScheme, } from "react-native"; import RNPickerSelect from "react-native-picker-select"; import useSWR from "swr"; @@ -29,6 +30,7 @@ const DisbursementScreen = ({ organization }: DisbursementScreenProps) => { const { data: organizations } = useSWR("user/organizations"); const { token } = useContext(AuthContext); + const scheme = useColorScheme(); const validateInputs = () => { const numericAmount = Number(amount.replace("$", "").replace(",", "")); @@ -167,6 +169,7 @@ const DisbursementScreen = ({ organization }: DisbursementScreenProps) => { items={[ ...organizations .filter((org) => org.id !== organization.id) + .filter((org) => org.playground_mode === false) .map((org) => ({ label: org.name, value: org.id })), ]} /> @@ -255,15 +258,15 @@ const DisbursementScreen = ({ organization }: DisbursementScreenProps) => { {isLoading ? ( ) : ( - - Make Transfer - + + Make Transfer + )} diff --git a/src/pages/organization/index.tsx b/src/pages/organization/index.tsx index 1029ed9..5c6e1aa 100644 --- a/src/pages/organization/index.tsx +++ b/src/pages/organization/index.tsx @@ -105,7 +105,7 @@ export default function OrganizationPage({ }); } - if (isManager) { + if (isManager && !organization.playground_mode) { menuActions.push({ id: "transfer", title: "Transfer Money", @@ -119,11 +119,13 @@ export default function OrganizationPage({ image: "gearshape", }); - menuActions.push({ - id: "donation", - title: "Collect Donations", - image: "dollarsign.circle", - }); + if (!organization.playground_mode) { + menuActions.push({ + id: "donation", + title: "Collect Donations", + image: "dollarsign.circle", + }); + } navigation.setOptions({ headerRight: () => ( From 0a74293c2a4469d03fc1b8208a9ad2ac77e302f6 Mon Sep 17 00:00:00 2001 From: Mohamad Mortada Date: Wed, 22 Jan 2025 10:36:26 -0800 Subject: [PATCH 3/4] prettier --- .../organizations/transfer/Disbursement.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/organizations/transfer/Disbursement.tsx b/src/components/organizations/transfer/Disbursement.tsx index 843d23f..be28d7e 100644 --- a/src/components/organizations/transfer/Disbursement.tsx +++ b/src/components/organizations/transfer/Disbursement.tsx @@ -258,15 +258,15 @@ const DisbursementScreen = ({ organization }: DisbursementScreenProps) => { {isLoading ? ( ) : ( - - Make Transfer - + + Make Transfer + )} From fc03e4a6e35dd603a1fc50b61253b04f168c634d Mon Sep 17 00:00:00 2001 From: Mohamad Mortada Date: Wed, 22 Jan 2025 10:46:13 -0800 Subject: [PATCH 4/4] testing preview --- src/pages/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 006bd75..bfffcfa 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -162,7 +162,7 @@ function Event({ fontWeight: "600", }} > - {event.name} + Hi Luke {data?.playground_mode && (