Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REACT_APP_KASPLEX_BASE=api.kasplex.org
REACT_APP_KASPLEX_VERSION=v1
REACT_APP_KASPLEX_API=api.kasplex.org/v1
3 changes: 3 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REACT_APP_KASPLEX_BASE=tn11api.kasplex.org
REACT_APP_KASPLEX_VERSION=v1
REACT_APP_KASPLEX_API=tn11api.kasplex.org/v1
3 changes: 3 additions & 0 deletions .eslint.rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "react-app"
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@

npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn-error.log*
404 changes: 186 additions & 218 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"aos": "^2.3.4",
"axios": "^1.7.2",
"bootstrap": "^5.3.3",
Expand All @@ -15,11 +12,11 @@
"react-icons": "^5.2.1",
"react-router-dom": "^6.24.0",
"react-scripts": "^5.0.1",
"react-twitter-widgets": "^1.11.0",
"web-vitals": "^2.1.4"
"react-twitter-widgets": "^1.11.0"
},
"scripts": {
"start": "react-scripts start",
"start:dev": "set REACT_APP_ENV=development && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
Expand All @@ -43,6 +40,13 @@
]
},
"devDependencies": {
"tailwindcss": "^3.4.3"
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"eslint": "^8.0.0",
"eslint-config-react-app": "^7.0.1",
"tailwindcss": "^3.4.3",
"web-vitals": "^2.1.4"
}
}
2 changes: 1 addition & 1 deletion src/components/Hero.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Hero = () => {
setLoading(true);
setError('');
try {
const response = await fetchWithTimeout(`https://api.kasplex.org/v1/krc20/token/${inputTick}?stat=true`, 10000);
const response = await fetchWithTimeout(`https://${process.env.REACT_APP_KASPLEX_API}/krc20/token/${inputTick}?stat=true`, 10000);
if (response.data.result && response.data.result.length > 0) {
navigate(`/${inputTick}`);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const Main = () => {

const fetchData = async () => {
try {
const tokenResponse = await axios.get(`https://api.kasplex.org/v1/krc20/token/${tick}?holder=true`);
const statsResponse = await axios.get(`https://api.kasplex.org/v1/krc20/token/${tick}?stat=true`);
const tokenResponse = await axios.get(`https://${process.env.REACT_APP_KASPLEX_API}/krc20/token/${tick}?holder=true`);
const statsResponse = await axios.get(`https://${process.env.REACT_APP_KASPLEX_API}/krc20/token/${tick}?stat=true`);
setTokenData(tokenResponse.data.result[0]);
setStatsData(statsResponse.data.result[0]);
setTimeoutReached(false); // Reset timeout state if data is fetched successfully
Expand Down