Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/andrew_testing' into fix/formatt…
Browse files Browse the repository at this point in the history
…ing-may10
  • Loading branch information
Andrew Bierman committed May 14, 2024
2 parents ceccda9 + 259a2ce commit ece2ec4
Show file tree
Hide file tree
Showing 26 changed files with 349 additions and 758 deletions.
11 changes: 11 additions & 0 deletions .github/actions/setup-java/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Setup Java'
description: 'Sets up Java'

runs:
using: 'composite'
steps:
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
25 changes: 25 additions & 0 deletions .github/actions/setup-standard-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Setup Standard Environment'
description: 'Sets up the standard environment for building the app'

inputs:
expo-token:
description: 'Expo token for authentication'
required: true

runs:
using: 'composite'
steps:
- name: Set up JS Runtime Environment
uses: ./.github/actions/setup-js-runtime

- name: Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ inputs.expo-token }}

- name: Install dependencies
uses: ./.github/actions/install-deps

- name: Setup Java
uses: ./.github/actions/setup-java
34 changes: 8 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,25 @@
name: android-build-apk
name: android-build-apk-gradlew

on:
push:
branches: ['**']
pull_request:
branches: ['**']

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
install-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install dependencies
uses: ./.github/actions/install-deps
build-android:
needs: install-and-test
build-android-gradlew:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Node
uses: actions/setup-node@v3
- name: Setup Standard Environment
uses: ./.github/actions/setup-standard-environment
with:
node-version: 20.x
cache: yarn

- name: Install dependencies
uses: ./.github/actions/install-deps
expo-token: ${{ secrets.EXPO_TOKEN }}

- name: Prebuild
run: |
Expand All @@ -52,6 +33,7 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v1

with:
name: app-release.apk
path: android/app/build/outputs/apk/release/
84 changes: 48 additions & 36 deletions .github/workflows/expo.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,66 @@ on:
pull_request:
branches: [ "**" ]

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
build:
build-android:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '20' # Use the version you prefer
- name: Setup Standard Environment
uses: ./.github/actions/setup-standard-environment
with:
expo-token: ${{ secrets.EXPO_TOKEN }}

- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'

- name: Install dependencies
uses: ./.github/actions/install-deps
- name: Run Local Build for Android
working-directory: ./apps/expo
run: |
eas build --non-interactive --platform android --local
env:
MAPBOX_DOWNLOADS_TOKEN: ${{ secrets.MAPBOX_DOWNLOADS_TOKEN }}

# - name: 🚀 Build app
# working-directory: ./client
# run: eas build --non-interactive --platform all --local
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: android-apk
path: /home/runner/work/PackRat/PackRat/apps/expo/build-*.apk

# - name: Install dependencies
# working-directory: ./client
# run: yarn install

# - name: Install EAS CLI
# run: yarn global add eas-cli
build-ios:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

# - name: Configure build
# working-directory: ./client
# run: npx eas build:configure
- name: Setup Standard Environment
uses: ./.github/actions/setup-standard-environment
with:
expo-token: ${{ secrets.EXPO_TOKEN }}

# If you need additional setup or configurations, add them here
# - name: Setup Xcode
# uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: latest-stable

- name: Run Local Build for Android
working-directory: ./apps/expo
run: eas build --non-interactive --platform android --local
- name: Run Local Build for iOS
working-directory: ./apps/expo
run: |
eas build --non-interactive --platform ios --local
env:
MAPBOX_DOWNLOADS_TOKEN: ${{ secrets.MAPBOX_DOWNLOADS_TOKEN }}

- name: Run Local Build for iOS
working-directory: ./apps/expo
run: eas build --non-interactive --platform ios --local
- name: Upload IPA
uses: actions/upload-artifact@v3
with:
name: ios-ipa
path: /home/runner/work/PackRat/PackRat/apps/expo/build-*.ipa
2 changes: 1 addition & 1 deletion packages/app/components/ScoreContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,4 @@ const loadStyles = (theme: any) => {
};
};

export default ScoreContainer;
export default ScoreContainer;
2 changes: 1 addition & 1 deletion packages/app/components/carousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const Carousel: React.FC<CarouselProps> = ({ children = [], itemWidth }) => {
const scrollToIndex = (index: number) => {
if (index >= 0 && index < children.length && scrollViewRef.current) {
scrollViewRef.current.scrollTo({
x: index * (itemWidth + 20),
x: index * 220,
y: 0,
animated: true,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/feed/FeedCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,4 +354,4 @@ export default function Card({
</ContextMenu.Content>
</ContextMenu.Root>
);
}
}
5 changes: 3 additions & 2 deletions packages/app/components/pack_table/DeletePackItemModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { useDeletePackItem } from 'app/hooks/packs/useDeletePackItem';
import { BaseModal, CloseModalHandler } from '@packrat/ui';
import { BaseModal, CloseModalHandler, RText } from '@packrat/ui';
import { useDeleteItem } from 'app/hooks/items';

interface DeletePackItemModalProps {
Expand Down Expand Up @@ -42,8 +42,9 @@ export const DeletePackItemModal = ({
onClose={onClose}
showTrigger={!!triggerComponent}
footerButtons={footerButtons}
footerComponent={undefined}
>
Are you sure you want to delete this item?
<RText>Are you sure you want to delete this item?</RText>
</BaseModal>
);
};
1 change: 1 addition & 0 deletions packages/app/components/pack_table/EditPackItemModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const EditPackItemModal = ({
title={'Edit Item'}
isOpen={isOpen}
onClose={onClose}
footerComponent={undefined}
footerButtons={footerButtons}
triggerComponent={triggerComponent}
showTrigger={showTrigger !== undefined ? showTrigger : true}
Expand Down
23 changes: 16 additions & 7 deletions packages/app/components/pack_table/TableItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';
import { Platform } from 'react-native';

import useCustomStyles from 'app/hooks/useCustomStyles';
Expand Down Expand Up @@ -40,25 +40,32 @@ const TableItem = ({
const styles = useCustomStyles(loadStyles);
const authUser = useAuthUser();

const openModal = (modalName: ModalName) => () => {
useEffect(() => {
setActiveModal(null);
}, [itemData]);

const openModal = (modalName: ModalName) => {
setActiveModal(modalName);
};

const closeModal = () => {
setActiveModal(null);
};

const rowActionItems = [
let rowActionItems = [
{ label: 'Delete', onSelect: () => openModal('delete') },
// TODO Implement Ignore Pack Item functional
// { label: 'Ignore', onSelect: () => {} },
];

if (authUser.id === itemData.ownerId) {
rowActionItems.unshift({
label: 'Edit',
onSelect: () => openModal('edit'),
});
rowActionItems = [
{
label: 'Edit',
onSelect: () => openModal('edit'),
},
...rowActionItems,
];
}

let rowData = [
Expand Down Expand Up @@ -88,9 +95,11 @@ const TableItem = ({
return (
<>
<EditPackItemModal
triggerComponent={undefined}
showTrigger={false}
isOpen={activeModal === 'edit'}
onClose={closeModal}

>
<AddItem id={id} packId={id} isEdit={true} initialData={itemData} />
</EditPackItemModal>
Expand Down
1 change: 1 addition & 0 deletions packages/app/components/trip/createTripModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const SaveTripContainer = ({ tripStore }: SaveTripContainerProps) => {
footerButtons={[
{
label: 'Save',
color: "#6F9CDE",
onClick: (_, closeModal) => submitTrigger(closeModal),
},
]}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/context/FontLoader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect } from 'react';
import { useFonts } from 'expo-font';
// import { SplashScreen } from 'expo-router';
import { APP } from '@env';
import { APP } from '@packrat/config';

// Expo vector icons
import {
Expand Down
Loading

0 comments on commit ece2ec4

Please sign in to comment.