Skip to content

Commit 736ed6a

Browse files
authored
Merge pull request #354 from AlphadayHQ/dev
v3.0.3 — Some missing cards and more fixes
2 parents 61948f7 + 6b919ae commit 736ed6a

File tree

33 files changed

+765
-140
lines changed

33 files changed

+765
-140
lines changed

packages/frontend/.env.production

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
VITE_ENVIRONMENT=production
2+
VITE_LOGLEVEL=2
3+
VITE_VERSION=$npm_package_version
4+
VITE_NAME=$npm_package_name
5+
VITE_X_APP_ID=sBnL0RkWkM
6+
VITE_X_APP_SECRET=21gPAwU3uOUisMJJFJjaotbDxCmvCHKMh76Xlvb8XK2RkkvZHhtSfcUfoz6QiFx8zhZf31vxvKAFD7pkdmbjHiKwoVuS2iDOLjvC
7+
8+
SKIP_PREFLIGHT_CHECK=true
9+
10+
VITE_ZAPPER_API_KEY=c75aa588-4c02-4141-b59d-8948cc829041
11+
VITE_DEFIPULSE_API_KEY=10f4dd7248da9f27421fb5c899aa5ddbc81b3703710a06000266b5e21b4c
12+
VITE_ETHERSCAN_API_KEY=XSCAM4EG9STBCGZTHR6IWKI9T7G8W17CMD
13+
VITE_ETHPLORER_API_KEY=EK-4dB3J-4SZrSU9-u51Q5
14+
15+
VITE_API_BASE_URL=https://api.alphaday.com/
16+
VITE_ZAPPER_BASE_URL=https://api.zapper.fi/v1/
17+
VITE_ZAPPER_BASE_URL_V2=https://api.zapper.fi/v2/
18+
VITE_COINGECKO_BASE_URL=https://api.coingecko.com/api/v3/
19+
VITE_DEFIPULSE_BASE_URL=https://data-api.defipulse.com/api/v1/
20+
VITE_ETHERSCAN_BASE_URL=https://api.etherscan.io/api
21+
VITE_ULTRA_SOUND_MONEY_BASE_URL=https://api.ultrasound.money/
22+
VITE_ALPHADAY_IPFS_GATEWAY=https://alphaday.infura-ipfs.io/ipfs/
23+
24+
VITE_WALLET_CONNECT_PROJECT_ID=22d27c7d76fe9427df00396197879979
25+
VITE_SWAP_FEE=10
26+
VITE_SWAP_FEE_ADDRESS=0x038C5e782FcE70C5CAf39b0Ba2Afe211F34f0bC5
27+
28+
VITE_OAUTH_ID_GOOGLE=459445752978-i4n219ug8sf8dmj84gektqs8fk9uspee.apps.googleusercontent.com
29+
VITE_OAUTH_ID_APPLE=com.alphaday.alphaday
30+
31+
VITE_GA_MEASUREMENT_ID=G-key
32+
VITE_SENTRY_DSN=https://[email protected]/4506196109950976
33+
34+
VITE_FIRE_API_KEY=AIzaSyA9SMPTjhw27P9mGBgP3zdIpLjYUxCb7rQ
35+
VITE_FIRE_AUTH_DOMAIN=gammaday-staging.firebaseapp.com
36+
VITE_FIRE_PROJECT_ID=gammaday-staging
37+
VITE_FIRE_STORAGE_BUCKET=gammaday-staging.appspot.com
38+
VITE_FIRE_MESSAGE_SENDER_ID=1004617464571
39+
VITE_FIRE_APP_ID=1:1004617464571:web:ec61e598676dc90b7a8e5e
40+
VITE_FIRE_MEASUREMENT_ID=G-J6KTFT40XV
41+
42+
# local stuff
43+
VITE_TEST_ADDRESS="0x038C5e782FcE70C5CAf39b0Ba2Afe211F34f0bC5"
44+
VITE_TEST_XPRV="a02ff1f574870d1689e0664f411ada2ba4cfc7fcf6bc5222467e384682696098"
45+
46+
REACT_APP_HOTJAR_SITE_ID=1

packages/frontend/.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
],
1414
"ignorePatterns": [
1515
"cypress.config.ts",
16-
"cypress"
16+
"cypress",
17+
"env-check.cjs"
1718
]
1819
}

packages/frontend/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ dist/
1010
# tsconfig
1111
*.tsbuildinfo
1212
.env
13-
13+
.env.*
14+
!.env.sample
1415
/public/*-*x*.png
1516
/public/favicon.ico
1617

packages/frontend/android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "com.alphaday"
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
10-
versionCode 1
11-
versionName "1.0.1"
10+
versionCode 4
11+
versionName "3.0.3"
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
aaptOptions {
1414
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

packages/frontend/capacitor.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const config: CapacitorConfig = {
88
androidScheme: "http",
99
iosScheme: "http",
1010
},
11-
backgroundColor: "#FAA202",
11+
backgroundColor: "#121212",
1212
};
1313

1414
export default config;

packages/frontend/docs/releasing.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Guidelines for New Releases
22

3+
## Web release
4+
35
Let's assume we have a stable `dev` branch with all the features, bug fixes
46
and any other changes that we may want to add for an upcoming new release.
57

@@ -35,4 +37,11 @@ We may now follow these steps:
3537

3638
1. If the staging version has bugs, we'll add bug fixes in the `dev` branch, and version `vX.Y.Z` will be skipped in production. We'll instead move back to step `2.` and try a new hot-fix release `vX.Y.Z+1` including the bug fixes found in staging.
3739

38-
1. If the production version has bugs and a hotfix is needed, we add the bug fixes to a hot-fix branch that stems from the `main` branch. The version of this branch is bumped to `vX.Y.Z-hotfix` and then released to production. Once the hotfix is released, The bug fixes should also be added to the `dev` branch
40+
1. If the production version has bugs and a hotfix is needed, we add the bug fixes to a hot-fix branch that stems from the `main` branch. The version of this branch is bumped to `vX.Y.Z-hotfix` and then released to production. Once the hotfix is released, The bug fixes should also be added to the `dev` branch
41+
42+
## Android Release
43+
44+
1. Make sure you have your env variables correctly set locally in `.env.production`.
45+
1. Open a PR to bump both `versionCode` and `versionName` in the _app_ `build.graddle` (not the root one).
46+
1. From that branch, create an Android bundle (not just a simple apk as google requires a "bundle" now) using `yarn build:android:prod`.
47+
1. Upload the bundle to `https://play.google.com/console` (make sure you have the rights to do it).

packages/frontend/env-check.cjs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
const fs = require("fs");
2+
const dotenv = require("dotenv");
3+
4+
// Load environment variables from .env file
5+
const envResult = dotenv.config({ path: '.env.production' });
6+
7+
if (envResult.error) {
8+
console.error('Error loading .env file:', envResult.error);
9+
process.exit(1);
10+
}
11+
12+
const requiredVariables = [
13+
"VITE_ENVIRONMENT",
14+
"VITE_API_BASE_URL",
15+
"VITE_X_APP_ID",
16+
"VITE_X_APP_SECRET",
17+
"VITE_ZAPPER_BASE_URL",
18+
"VITE_ZAPPER_BASE_URL_V2",
19+
"VITE_COINGECKO_BASE_URL",
20+
"VITE_WALLET_CONNECT_PROJECT_ID",
21+
"VITE_SWAP_FEE",
22+
"VITE_SWAP_FEE_ADDRESS",
23+
"VITE_GA_MEASUREMENT_ID",
24+
"VITE_FIRE_APP_ID",
25+
"VITE_FIRE_PROJECT_ID",
26+
"VITE_FIRE_MEASUREMENT_ID",
27+
"VITE_FIRE_API_KEY",
28+
"VITE_FIRE_AUTH_DOMAIN",
29+
"VITE_FIRE_STORAGE_BUCKET",
30+
"VITE_FIRE_MESSAGE_SENDER_ID",
31+
"VITE_SENTRY_DSN",
32+
"VITE_HOTJAR_SITE_ID",
33+
"VITE_HOTJAR_SNIPPET_VERSION",
34+
"VITE_OAUTH_ID_GOOGLE",
35+
"VITE_CLARITY_PROJECT_ID",
36+
"VITE_CLARITY_MOBILE_PROJECT_ID"
37+
];
38+
39+
// Check if all required variables are set
40+
const missingVariables = requiredVariables.filter((variable) => !process.env[variable]);
41+
42+
if (missingVariables.length > 0) {
43+
console.error('Missing required environment variables:', missingVariables.join(', '));
44+
process.exit(1);
45+
} else {
46+
console.log('All required environment variables are set.');
47+
}

packages/frontend/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "@alphaday/frontend",
33
"private": true,
4-
"version": "3.0.2",
4+
"version": "3.0.3",
55
"type": "module",
66
"scripts": {
77
"prepare": "export VITE_COMMIT=$(git rev-parse --short HEAD)",
88
"dev": "pwa-assets-generator && VITE_COMMIT=$(git rev-parse --short HEAD) VITE_COMMIT_TS=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d %H:%M:%S') vite",
99
"dev:ssl": "USE_SSL=true yarn dev --host --port 443",
1010
"build": "pwa-assets-generator && VITE_COMMIT=$(git rev-parse --short HEAD) VITE_COMMIT_TS=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d %H:%M:%S') vite build",
11-
"build:apk": "ionic capacitor build android",
11+
"build:android": "ionic capacitor build android",
12+
"build:android:prod": "node env-check.cjs && ionic capacitor build android --prod",
1213
"platform:add": "ionic capacitor add",
1314
"generate-pwa-assets": "pwa-assets-generator",
1415
"preview": "vite preview",
@@ -42,7 +43,7 @@
4243
"es6-error": "4.1.1",
4344
"firebase": "10.0.0",
4445
"html2canvas": "1.4.1",
45-
"ionicons": "7.1.2",
46+
"ionicons": "7.3.0",
4647
"md5": "2.3.0",
4748
"moment": "2.29.4",
4849
"query-string": "8.1.0",
@@ -87,6 +88,7 @@
8788
"@vitejs/plugin-legacy": "4.1.0",
8889
"cordova-res": "0.15.4",
8990
"cypress": "12.7.0",
91+
"dotenv": "16.4.5",
9092
"happy-dom": "10.5.2",
9193
"react-test-renderer": "18.2.0",
9294
"sharp": "0.32.6",

packages/frontend/src/MobileApp.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { useAuth } from "./api/hooks";
1515
import { useGetFeaturesQuery } from "./api/services";
1616
import { lazyRetry } from "./api/utils/helpers";
1717
import CONFIG from "./config";
18+
import ToastContainer from "./containers/toasts/ToastContainer";
1819
import PreloaderPage from "./pages/preloader";
1920
import "@alphaday/ui-kit/global.scss";
2021
import "./customIonicStyles.scss";
@@ -104,6 +105,11 @@ const MobileApp: React.FC = () => {
104105
</Suspense>
105106
</IonRouterOutlet>
106107
</IonReactRouter>
108+
<ToastContainer
109+
position="bottom-center"
110+
duration={CONFIG.UI.TOAST_DURATION}
111+
className="fontGroup-supportBold mb-20"
112+
/>
107113
</IonApp>
108114
);
109115
};

packages/frontend/src/api/services/superfeed/superfeedEndpoints.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,20 @@ export const superfeedApi = alphadayApi.injectEndpoints({
5757
likes: i.likes,
5858
isLiked: i.is_liked,
5959
comments: i.comments,
60-
data: i.data,
60+
data: {
61+
coin: i.data?.coin,
62+
price: i.data?.price,
63+
history: i.data?.history,
64+
location: i.data?.location,
65+
itemType: i.data?.item_type,
66+
projects: i.data?.projects,
67+
projectType: i.data?.project_type,
68+
gasFast: i.data?.GAS_FAST,
69+
gasSlow: i.data?.GAS_SLOW,
70+
gasStandard: i.data?.GAS_STANDARD,
71+
gasPercentChange: i.data?.PERCENT_CHANGE,
72+
gasPrevGasStandard: i.data?.PREV_GAS_STANDARD,
73+
},
6174
})),
6275
}),
6376
providesTags: ["Superfeed"],

0 commit comments

Comments
 (0)