Skip to content

Commit d5f6aa5

Browse files
authored
Merge pull request #113 from P4-Games/feature/icp-deploy
merge feature/icp-deploy into develop
2 parents 143d209 + e5e2a47 commit d5f6aa5

File tree

5 files changed

+10
-30
lines changed

5 files changed

+10
-30
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"build": "next build",
1212
"create-env": "printenv > .env",
1313
"serve": "yarn build && npm i -g http-server && http-server ./.next",
14-
"export": "yarn build && next export -o _static",
1514
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
1615
"lint:fix": "eslint --fix \"src/**/*.{js,jsx,ts,tsx}\"",
1716
"prettier": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",

src/config-global.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { paths } from 'src/routes/paths'
2-
31
import { Network } from './types/networks'
42

53
// ----------------------------------------------------------------------
@@ -31,16 +29,15 @@ export const handleVercelFreePlanTimeOut =
3129
export const UI_API_URL = process.env.NEXT_PUBLIC_UI_URL
3230
export const USE_MOCK = (process.env.NEXT_PUBLIC_USE_MOCK || 'true') === 'true'
3331
export const ALLOWED_ORIGINS = process.env.NEXT_PUBLIC_ALLOWED_ORIGINS || '*'
34-
export const fromICP = (process.env.NEXT_PUBLIC_FROM_ICP || 'false') === 'true'
32+
export const fromICP = (process.env.NEXT_PUBLIC_FROM_ICP || 'true') === 'true'
3533
export const RECAPTCHA_SITE_KEY = process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY || ''
3634
export const NFT_IMAGE_REPOSITORY = (
3735
process.env.NEXT_PUBLIC_NFT_IMAGE_REPOSITORY || 'gcp'
3836
).toLowerCase()
3937
// ----------------------------------------------------------------------
4038

4139
// internal
42-
export const DOMAIN_TO_USE_WITH_ICP = fromICP ? 'https://chatterpay.net' : ''
43-
export const PATH_AFTER_LOGIN = `${DOMAIN_TO_USE_WITH_ICP}$/dashboard`
40+
export const PATH_AFTER_LOGIN = `/dashboard`
4441
export const BOT_WAPP_URL =
4542
'https://api.whatsapp.com/send/?phone=5491164629653&text=MESSAGE&type=phone_number&app_absent=0'
4643

src/layouts/common/login-button.tsx

+8-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { paths } from 'src/routes/paths'
55
import { RouterLink } from 'src/routes/components'
66

77
import { useTranslate } from 'src/locales'
8+
import { fromICP } from 'src/config-global'
89

910
// ----------------------------------------------------------------------
1011

@@ -18,18 +19,19 @@ export default function LoginButton({ sx }: Props) {
1819
return (
1920
<>
2021
<Button
21-
component={RouterLink}
22+
component={fromICP ? 'a' : RouterLink}
2223
href={paths.auth.jwt.register}
2324
variant='contained'
2425
sx={{ mr: 1, ...sx }}
2526
>
2627
{t('home.header.sign-up')}
2728
</Button>
28-
<Button
29-
component={RouterLink}
30-
href={paths.auth.jwt.login}
31-
variant='soft'
32-
sx={{ mr: 1, ...sx }}>
29+
<Button
30+
component={fromICP ? 'a' : RouterLink}
31+
href={paths.auth.jwt.login}
32+
variant='soft'
33+
sx={{ mr: 1, ...sx }}
34+
>
3335
{t('home.header.sign-in')}
3436
</Button>
3537
</>

src/layouts/main/header.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { useResponsive } from 'src/hooks/use-responsive'
1111

1212
import { bgBlur } from 'src/theme/css'
1313
import { useTranslate } from 'src/locales'
14-
import { PATH_AFTER_LOGIN } from 'src/config-global'
1514

1615
import Logo from 'src/components/logo'
1716
import Iconify from 'src/components/iconify'

src/routes/paths.ts

-17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const ROOTS = {
22
AUTH: '/auth',
3-
AUTH_DEMO: '/auth-demo',
43
DASHBOARD: '/dashboard'
54
}
65

@@ -18,22 +17,6 @@ export const paths = {
1817
register: `${ROOTS.AUTH}/jwt/register`
1918
}
2019
},
21-
authDemo: {
22-
classic: {
23-
login: `${ROOTS.AUTH_DEMO}/classic/login`,
24-
register: `${ROOTS.AUTH_DEMO}/classic/register`,
25-
forgotPassword: `${ROOTS.AUTH_DEMO}/classic/forgot-password`,
26-
newPassword: `${ROOTS.AUTH_DEMO}/classic/new-password`,
27-
verify: `${ROOTS.AUTH_DEMO}/classic/verify`
28-
},
29-
modern: {
30-
login: `${ROOTS.AUTH_DEMO}/modern/login`,
31-
register: `${ROOTS.AUTH_DEMO}/modern/register`,
32-
forgotPassword: `${ROOTS.AUTH_DEMO}/modern/forgot-password`,
33-
newPassword: `${ROOTS.AUTH_DEMO}/modern/new-password`,
34-
verify: `${ROOTS.AUTH_DEMO}/modern/verify`
35-
}
36-
},
3720
dashboard: {
3821
root: `${ROOTS.DASHBOARD}`,
3922
nfts: {

0 commit comments

Comments
 (0)