Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sverben committed Apr 13, 2024
0 parents commit 0720b9e
Show file tree
Hide file tree
Showing 34 changed files with 22,587 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Build and Deploy"
on:
push:
tags:
- v*
env:
EAS_BUILD_ARGS: --non-interactive --profile production --local

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '20.x'

- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'

- name: Setup Expo
uses: expo/expo-github-action@v7
with:
token: ${{ secrets.EXPO_TOKEN }}
expo-version: latest
eas-version: latest

- name: Install dependencies
run: npm ci

- name: Build app for Android
run: eas build --output ./android.aab --platform android ${{ env.EAS_BUILD_ARGS }}

- name: Upload to Google Play Console
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: nl.djoamersfoort.djo
releaseFiles: ./android.aab
track: draft
changesNotSentForReview: true
39 changes: 39 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Build and Deploy"
on:
push:
tags:
- v*
env:
EAS_BUILD_ARGS: --non-interactive --profile production --local

jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '20.x'

- name: Setup Expo
uses: expo/expo-github-action@v7
with:
token: ${{ secrets.EXPO_TOKEN }}
expo-version: latest
eas-version: latest

- name: Install dependencies
run: npm ci

- name: Build app for IOS
run: eas build --output ./app.ipa --platform ios ${{ env.EAS_BUILD_ARGS }}

- name: Upload to App Store Connect
uses: apple-actions/upload-testflight-build@v1
with:
app-path: './app.ipa'
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

.idea
86 changes: 86 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import {adaptNavigationTheme, MD3DarkTheme, MD3LightTheme, PaperProvider} from "react-native-paper";
import {AuthProvider} from "./src/auth";
import {decode, encode} from "base-64";
import {
DarkTheme as NavigationDarkTheme,
DefaultTheme as NavigationDefaultTheme,
NavigationContainer
} from "@react-navigation/native";
import HomeScreen from "./src/screens/home";
import CustomNavigationBar from "./src/components/navbar";
import SlotScreen from "./src/screens/feed/slot";
import {createStackNavigator} from "@react-navigation/stack";
import AlbumScreen from "./src/screens/media/album";
import {Item} from "./src/__generated__/media";
import SlidesScreen from "./src/screens/media/slides";
import {useColorScheme} from "react-native";
import merge from 'deepmerge'
import WebScreen from "./src/screens/web";
import * as Notifications from 'expo-notifications'
import SearchScreen from "./src/screens/feed/search";

Notifications.setNotificationHandler(({
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: false,
shouldSetBadge: true
})
}))

if (!global.btoa) global.btoa = encode;
if (!global.atob) global.atob = decode;

export type StackParamList = {
Home: undefined,
Slot: { slot: number, title: string },
Album: { album: string, title: string },
Slides: { items: Item[], item: number },
Web: { source: string, title: string },
Search: undefined
}


const Stack = createStackNavigator<StackParamList>()

const { LightTheme, DarkTheme } = adaptNavigationTheme({
reactNavigationLight: NavigationDefaultTheme,
reactNavigationDark: NavigationDarkTheme,
});

const CombinedDefaultTheme = merge(MD3LightTheme, LightTheme);
const CombinedDarkTheme = merge(MD3DarkTheme, DarkTheme);

export default function App() {
const colorScheme = useColorScheme()

return (
<NavigationContainer theme={colorScheme === 'dark' ? CombinedDarkTheme : CombinedDefaultTheme}>
<PaperProvider theme={colorScheme === 'dark' ? CombinedDarkTheme : CombinedDefaultTheme}>
<AuthProvider>
<Stack.Navigator
screenOptions={{
header: CustomNavigationBar
}}
>
<Stack.Screen name={"Home"} component={HomeScreen} options={{
headerShown: false
}} />
<Stack.Screen name={"Slot"} component={SlotScreen} options={({ route }) => ({
title: route.params.title,
})} />
<Stack.Screen name={"Album"} component={AlbumScreen} options={({ route }) => ({
title: route.params.title
})} />
<Stack.Screen name={"Slides"} component={SlidesScreen} />
<Stack.Screen name={"Web"} component={WebScreen} options={({ route }) => ({
title: route.params.title
})} />
<Stack.Screen name={"Search"} component={SearchScreen} options={{
headerShown: false
}} />
</Stack.Navigator>
</AuthProvider>
</PaperProvider>
</NavigationContainer>
);
}
64 changes: 64 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"expo": {
"name": "djo",
"slug": "djo",
"scheme": "djo",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "automatic",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#202088"
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"buildNumber": "1",
"userInterfaceStyle": "automatic",
"supportsTablet": true,
"bundleIdentifier": "nl.djoamersfoort.djo",
"config": {
"usesNonExemptEncryption": false
},
"infoPlist": {
"UIBackgroundModes": [
"remote-notification"
],
"LSApplicationQueriesSchemes": [
"djo"
]
}
},
"android": {
"package": "nl.djoamersfoort.djo",
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#202088"
},
"googleServicesFile": "./google-services.json",
"versionCode": 3
},
"web": {
"favicon": "./assets/favicon.png"
},
"plugins": [
"expo-secure-store",
[
"expo-image-picker",
{
"photosPermission": "Allows you to upload media",
"cameraPermission": "Allows you to upload media",
"microphonePermission": "Allows you to upload media"
}
]
],
"extra": {
"eas": {
"projectId": "b244a444-1aac-455c-93bf-119317e041fd"
}
}
}
}
Binary file added assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
29 changes: 29 additions & 0 deletions google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "1051309463770",
"project_id": "djo-firebase",
"storage_bucket": "djo-firebase.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1051309463770:android:d43d388066b60bda79ede3",
"android_client_info": {
"package_name": "nl.djoamersfoort.djo"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyAPTI_C6ljBBa7NGYG4vGO2uVqChQ_wOs4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
Loading

0 comments on commit 0720b9e

Please sign in to comment.