Skip to content

Commit 50506b7

Browse files
authored
Merge pull request #455 from Itheum/stg
STG -> MAIN 1.16
2 parents bbc84a4 + b98123d commit 50506b7

File tree

4 files changed

+42
-15
lines changed

4 files changed

+42
-15
lines changed

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"name": "explorer-dapp",
33
"description": "Itheum Explorer is a DApp for the public to explore and visualize data within the Itheum protocol",
4-
5-
"version": "1.15.7",
6-
4+
"version": "1.16.0",
75
"author": "Itheum",
86
"license": "GPL-3.0-or-later",
97
"dependencies": {
@@ -12,7 +10,7 @@
1210
"@fortawesome/react-fontawesome": "0.2.0",
1311
"@itheum/sdk-mx-data-nft": "3.3.0-alpha.3",
1412
"@multiversx/sdk-core": "13.0.1",
15-
"@multiversx/sdk-dapp": "2.31.3",
13+
"@multiversx/sdk-dapp": "2.29.2",
1614
"@multiversx/sdk-network-providers": "2.4.3",
1715
"@radix-ui/react-dialog": "1.0.5",
1816
"@radix-ui/react-dropdown-menu": "2.0.6",

src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzBase.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import PowerUpBounty from "./PowerUpBounty";
1414
import { getDataBounties, GiveBitzDataBounty } from "../config";
1515
import { LeaderBoardItemType, viewDataJSONCore } from "../index";
1616
import LeaderBoardTable from "../LeaderBoardTable";
17+
import { FlaskRound } from "lucide-react";
1718

1819
type GiveBitzBaseProps = {
1920
gameDataNFT: DataNft;
@@ -25,6 +26,8 @@ const GiveBitzBase = (props: GiveBitzBaseProps) => {
2526
const { tokenLogin } = useGetLoginInfo();
2627
const givenBitzSum = useAccountStore((state: any) => state.givenBitzSum);
2728
const collectedBitzSum = useAccountStore((state: any) => state.collectedBitzSum);
29+
const bitzBalance = useAccountStore((state: any) => state.bitzBalance);
30+
2831
const { chainID } = useGetNetworkConfig();
2932
const [giverLeaderBoardIsLoading, setGiverLeaderBoardIsLoading] = useState<boolean>(false);
3033
const [giverLeaderBoard, setGiverLeaderBoard] = useState<LeaderBoardItemType[]>([]);
@@ -269,6 +272,7 @@ const GiveBitzBase = (props: GiveBitzBaseProps) => {
269272
fetchMyGivenBitz();
270273
fetchGiverLeaderBoard();
271274
updateDataBountyTotalReceivedAmount(bitsToCampaignId, bitsVal, isNewGiver);
275+
updateBitzBalance(bitzBalance - bitsVal);
272276
return true;
273277
}
274278
} else {
@@ -352,7 +356,13 @@ const GiveBitzBase = (props: GiveBitzBaseProps) => {
352356

353357
<div id="bounties" className="flex flex-col w-full items-center justify-center">
354358
<div className="flex flex-col mt-10 mb-8 items-center justify-center ">
355-
<span className="text-foreground text-4xl mb-2">Power-up Data Bounties</span>
359+
<div className="flex flex-col md:flex-row items-center justify-center ">
360+
<span className="text-foreground text-4xl mb-2 text-center">Power-up Data Bounties </span>
361+
<div className="flex flex-row ml-8 text-foreground text-4xl ">
362+
{bitzBalance === -2 ? `...` : <>{bitzBalance === -1 ? "0" : `${bitzBalance}`}</>}
363+
<FlaskRound className=" w-10 h-10 fill-[#35d9fa]" />
364+
</div>
365+
</div>
356366
<span className="text-base text-foreground/75 text-center ">
357367
Power-Up Data Bounties (Ideas for new Data NFTs) with your BiTz XP, Climb Bounty Leaderboards and get bonus rewards if your Bounty is realized.
358368
</span>

src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzLowerCard.tsx

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,28 @@ const GiveBitzLowerCard: React.FC<GiveBitzLowerCardProps> = (props) => {
128128
transition={{ duration: 0.6, delay: 0.1 }}>
129129
<div>Give More BiTz</div>
130130
<div className="mb-3 mt-1 w-full">
131-
<input
132-
type="range"
133-
id="rangeBitz"
134-
min="0"
135-
max={bitzBalance}
136-
step="1"
137-
value={bitzVal}
138-
onChange={(e) => setBitzVal(Number(e.target.value))}
139-
className="accent-black dark:accent-white w-full cursor-pointer custom-range-slider"
140-
/>
131+
<div className="flex flex-row gap-2 justify-center items-center">
132+
<input
133+
type="range"
134+
id="rangeBitz"
135+
min="0"
136+
max={bitzBalance}
137+
step="1"
138+
value={bitzVal}
139+
onChange={(e) => setBitzVal(Number(e.target.value))}
140+
className="accent-black dark:accent-white w-full cursor-pointer custom-range-slider"
141+
/>
142+
<input
143+
type="number"
144+
min="0"
145+
max={bitzBalance}
146+
step="1"
147+
value={bitzVal}
148+
onChange={(e) => setBitzVal(Math.min(Number(e.target.value), bitzBalance))}
149+
className="bg-[#35d9fa]/30 text- dark:text-[#35d9fa] focus:none focus:outline-none focus:border-transparent text-center border-[#35d9fa] rounded-md"
150+
/>
151+
</div>
152+
141153
<div className="flex flex-row items-center md:gap-2">
142154
<input
143155
type="checkbox"

src/store/StoreProvider.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ export const StoreProvider = ({ children }: PropsWithChildren) => {
4343
if (!address || !(tokenLogin && tokenLogin.nativeAuthToken)) {
4444
return;
4545
}
46+
const nativeAuthTokenData = decodeNativeAuthToken(tokenLogin.nativeAuthToken);
47+
if (nativeAuthTokenData.extraInfo.timestamp) {
48+
const currentTime = new Date().getTime();
49+
if (currentTime > (nativeAuthTokenData.extraInfo.timestamp + nativeAuthTokenData.ttl) * 1000) {
50+
return;
51+
}
52+
}
4653
// add all the balances into the loading phase
4754
updateBitzBalance(-2);
4855
updateGivenBitzSum(-2);

0 commit comments

Comments
 (0)