-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
99 changed files
with
40,826 additions
and
30,986 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
schedule: | ||
interval: 'monthly' | ||
groups: | ||
patch-dependencies: | ||
update-types: | ||
- 'patch' | ||
|
||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
interval: 'monthly' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
format: | ||
name: Assert code formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
- name: Install dependencies | ||
run: cd mobile-app; npm install | ||
- name: Run format check | ||
run: cd mobile-app; npm run ci:format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Merge remote-tracking branch 'origin/react-query-setup' into new-ui | ||
# Please enter a commit message to explain why this merge is necessary, | ||
# especially if it merges an updated upstream into a topic branch. | ||
# | ||
# Lines starting with '#' will be ignored, and an empty message aborts | ||
# the commit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// https://docs.expo.dev/guides/using-eslint/ | ||
module.exports = { | ||
extends: 'expo', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// eslint-disable-next-line | ||
module.exports = { | ||
semi: true, | ||
singleQuote: true, | ||
trailingComma: 'es5', | ||
printWidth: 80, | ||
tabWidth: 4, | ||
useTabs: false, | ||
plugins: ['@trivago/prettier-plugin-sort-imports'], | ||
importOrder: ['<THIRD_PARTY_MODULES>', '^@/(.*)$', '^[./]'], | ||
importOrderSeparation: true, | ||
importOrderSortSpecifiers: true, | ||
importOrderGroupNamespaceSpecifiers: true, | ||
importOrderCaseInsensitive: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { useQuery } from 'react-query'; | ||
|
||
import { ApiId } from '@/api/types'; | ||
import { createApi } from '@/api/utils/create-api'; | ||
|
||
interface IGroup { | ||
id: ApiId; | ||
name: string; | ||
} | ||
|
||
export const useGroup = (id: ApiId) => { | ||
const api = createApi(); | ||
|
||
return useQuery<IGroup>(['group', id], async () => { | ||
const { data } = await api.get(`/groups/${id}`); | ||
return data; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { GroupSettingsProps } from '@/components/screens/GroupSettings'; | ||
|
||
import { useGroup } from '../calls/group/groupHooks'; | ||
import { ApiId } from '../types'; | ||
|
||
export const useGroupSettingsProps = (groupId: ApiId) => { | ||
const { data, ...props } = useGroup(groupId); | ||
|
||
const groupPageProps: GroupSettingsProps | null = data | ||
? { | ||
groupName: data.name, | ||
hasPremium: false, | ||
pastSeasons: 0, | ||
pushNotificationsEnabled: true, | ||
groupCode: '123456', | ||
} | ||
: null; | ||
|
||
return { | ||
props: groupPageProps, | ||
...props, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type ApiId = string; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import axios from 'axios'; | ||
|
||
// Might make sense to make a hook for this if we implment tokens and add a interceptor | ||
|
||
export const createApi = () => { | ||
const api = axios.create({ | ||
baseURL: process.env.API_BASE_URL, | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}); | ||
|
||
return api; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { QueryClient } from 'react-query'; | ||
|
||
import { minutes } from '@/utils/time'; | ||
|
||
// --- QUERY CLIENT --- | ||
|
||
export const createQueryClient = () => { | ||
const qc = new QueryClient(); | ||
|
||
qc.setDefaultOptions({ | ||
queries: { | ||
staleTime: minutes(2), | ||
retry: false, | ||
}, | ||
mutations: { | ||
retry: false, | ||
}, | ||
}); | ||
|
||
return qc; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
{ | ||
"expo": { | ||
"name": "mobile-app", | ||
"slug": "mobile-app", | ||
"version": "1.0.0", | ||
"orientation": "portrait", | ||
"icon": "./assets/images/icon.png", | ||
"scheme": "myapp", | ||
"userInterfaceStyle": "automatic", | ||
"splash": { | ||
"image": "./assets/images/splash.png", | ||
"resizeMode": "contain", | ||
"backgroundColor": "#ffffff" | ||
}, | ||
"ios": { | ||
"supportsTablet": true, | ||
"bundleIdentifier": "com.linusbolls.mobileapp", | ||
"expo": { | ||
"name": "mobile-app", | ||
"slug": "mobile-app", | ||
"version": "1.0.0", | ||
"orientation": "portrait", | ||
"icon": "./assets/images/icon.png", | ||
"scheme": "myapp", | ||
"userInterfaceStyle": "automatic", | ||
"splash": { | ||
"image": "./assets/images/splash.png", | ||
"resizeMode": "contain", | ||
"backgroundColor": "#ffffff" | ||
}, | ||
"ios": { | ||
"supportsTablet": true, | ||
"bundleIdentifier": "com.linusbolls.mobileapp", | ||
|
||
"infoPlist": { | ||
"NSPhotoLibraryUsageDescription": true | ||
} | ||
}, | ||
"android": { | ||
"adaptiveIcon": { | ||
"foregroundImage": "./assets/images/adaptive-icon.png", | ||
"backgroundColor": "#ffffff" | ||
} | ||
}, | ||
"web": { | ||
"bundler": "metro", | ||
"output": "static", | ||
"favicon": "./assets/images/favicon.png" | ||
}, | ||
"plugins": ["expo-router"], | ||
"experiments": { | ||
"typedRoutes": true | ||
}, | ||
"extra": { | ||
"eas": { | ||
"projectId": "8dbfe974-43ce-4f4e-b3d8-cf6f77109412" | ||
} | ||
"infoPlist": { | ||
"NSPhotoLibraryUsageDescription": true | ||
} | ||
}, | ||
"android": { | ||
"adaptiveIcon": { | ||
"foregroundImage": "./assets/images/adaptive-icon.png", | ||
"backgroundColor": "#ffffff" | ||
} | ||
}, | ||
"web": { | ||
"bundler": "metro", | ||
"output": "static", | ||
"favicon": "./assets/images/favicon.png" | ||
}, | ||
"plugins": ["expo-router"], | ||
"experiments": { | ||
"typedRoutes": true | ||
}, | ||
"extra": { | ||
"eas": { | ||
"projectId": "8dbfe974-43ce-4f4e-b3d8-cf6f77109412" | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.