-
Notifications
You must be signed in to change notification settings - Fork 11
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 #789 from haqq-network/dev
release
- Loading branch information
Showing
62 changed files
with
676 additions
and
182 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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import store from 'app-store-scraper'; | ||
import gplay from 'google-play-scraper'; | ||
import { NextRequest, NextResponse } from 'next/server'; | ||
|
||
export async function GET(request: NextRequest) { | ||
const [appStoreResponse, googlePlayResponse] = await Promise.all([ | ||
store.app({ id: 6443843352 }), | ||
gplay.app({ appId: 'com.haqq.wallet' }), | ||
]); | ||
|
||
return NextResponse.json<{ | ||
appStore: number; | ||
googlePlay: number; | ||
}>( | ||
{ | ||
appStore: appStoreResponse.score, | ||
googlePlay: googlePlayResponse.score, | ||
}, | ||
{ | ||
status: 200, | ||
}, | ||
); | ||
} |
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,15 +1,18 @@ | ||
export const DEPLOY_URL = process.env['VERCEL_URL'] | ||
? `https://${process.env['VERCEL_URL']}` | ||
: process.env['NEXT_PUBLIC_VERCEL_URL'] | ||
? `https://${process.env['NEXT_PUBLIC_VERCEL_URL']}` | ||
: 'http://localhost:4200'; | ||
export const VERCEL_ENV = process.env['VERCEL_ENV']; | ||
export const SITE_URL = 'https://islamiccoin.net'; | ||
export const DEPLOY_URL = | ||
VERCEL_ENV === 'production' | ||
? SITE_URL | ||
: process.env['VERCEL_URL'] | ||
? `https://${process.env['VERCEL_URL']}` | ||
: process.env['NEXT_PUBLIC_VERCEL_URL'] | ||
? `https://${process.env['NEXT_PUBLIC_VERCEL_URL']}` | ||
: 'http://localhost:4200'; | ||
export const REVALIDATE_TIME = 300; | ||
export const FALCONER_ENDPOINT = process.env['FALCONER_ENDPOINT']; | ||
export const TURNSTILE_SITEKEY = process.env['TURNSTILE_SITEKEY']; | ||
export const SUPPORTED_LOCALES: Readonly<string[]> = [ | ||
'en', | ||
// , 'ar', 'id' | ||
]; | ||
export const SITE_URL = 'https://islamiccoin.net'; | ||
export const BLOCKED_COUNTRY = 'AE'; |
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 @@ | ||
declare module 'app-store-scraper'; |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { cache } from 'react'; | ||
import { DEPLOY_URL, REVALIDATE_TIME } from '../constants'; | ||
|
||
export const revalidate = REVALIDATE_TIME; | ||
|
||
export interface WalletStoreRatings { | ||
appStore: number; | ||
googlePlay: number; | ||
} | ||
|
||
export const getWalletRatings = cache(async () => { | ||
const ratesEndpoint = new URL('/api/wallet-store-rates', DEPLOY_URL); | ||
const response = await fetch(ratesEndpoint, { | ||
next: { | ||
revalidate, | ||
}, | ||
}); | ||
|
||
const data: WalletStoreRatings = await response.json(); | ||
|
||
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
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
Oops, something went wrong.