-
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.
Merge pull request #74 from Grad-Squad/cleanup/general
fix: final fixes
- Loading branch information
Showing
93 changed files
with
22,549 additions
and
29,310 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,39 @@ | ||
name: CD_Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
Continous_Deployment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- run: npm ci | ||
|
||
- name: Setup Expo and EAS | ||
uses: expo/expo-github-action@v7 | ||
with: | ||
expo-version: 5.x | ||
eas-version: latest | ||
token: ${{ secrets.EXPO_TOKEN }} | ||
|
||
- name: Build app and push app to play store | ||
run: eas build --non-interactive --auto-submit --platform android | ||
|
||
- uses: sarisia/actions-status-discord@v1 | ||
if: always() | ||
with: | ||
webhook: ${{ secrets.DISCORD_WEBHOOK }} |
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
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
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
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
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 |
---|---|---|
@@ -1,26 +1,69 @@ | ||
import { useAxios } from 'api/AxiosProvider'; | ||
import { useQuery } from 'react-query'; | ||
import { useInfiniteQuery } from 'react-query'; | ||
import { useSelector } from 'react-redux'; | ||
import { formatString } from 'utility'; | ||
import endpoints from './endpoints'; | ||
|
||
export const searchQueryKey = (searchText, params) => [ | ||
'search text', | ||
export const searchPeopleQueryKey = (searchText, params) => [ | ||
'search text people', | ||
searchText, | ||
JSON.stringify(params), | ||
]; | ||
export const useAPIGetSearchResult = (searchText, options) => { | ||
export const useAPISearchPeople = (searchText, options) => { | ||
const { axios } = useAxios(); | ||
const params = useSelector((state) => state.search.params); | ||
return useQuery( | ||
searchQueryKey(searchText, params), | ||
async () => { | ||
return useInfiniteQuery( | ||
searchPeopleQueryKey(searchText, params), | ||
async ({ pageParam = 1 }) => { | ||
const { data } = await axios.get( | ||
formatString(endpoints.search.search, searchText), | ||
{ params } | ||
{ | ||
params: { | ||
...params, | ||
postslimit: 1, | ||
profilesLimit: 10, | ||
postsPage: 1, | ||
profilesPage: pageParam, | ||
}, | ||
} | ||
); | ||
return data; | ||
return data.profiles; | ||
}, | ||
options | ||
{ | ||
getNextPageParam: (lastPage) => lastPage?.nextPage, | ||
...options, | ||
} | ||
); | ||
}; | ||
|
||
export const searchPostsQueryKey = (searchText, params) => [ | ||
'search text posts', | ||
searchText, | ||
JSON.stringify(params), | ||
]; | ||
export const useAPISearchPosts = (searchText, options) => { | ||
const { axios } = useAxios(); | ||
const params = useSelector((state) => state.search.params); | ||
return useInfiniteQuery( | ||
searchPostsQueryKey(searchText, params), | ||
async ({ pageParam = 1 }) => { | ||
const { data } = await axios.get( | ||
formatString(endpoints.search.search, searchText), | ||
{ | ||
params: { | ||
...params, | ||
postslimit: 10, | ||
profilesLimit: 1, | ||
postsPage: pageParam, | ||
profilesPage: 1, | ||
}, | ||
} | ||
); | ||
return data.posts; | ||
}, | ||
{ | ||
getNextPageParam: (lastPage) => lastPage?.nextPage, | ||
...options, | ||
} | ||
); | ||
}; |
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,3 +1,3 @@ | ||
import endpoints from './endpoints/endpoints'; | ||
|
||
export default [endpoints.auth.login]; | ||
export default [endpoints.auth.login, endpoints.auth.verifyCode]; |
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
Oops, something went wrong.