From c990d733927a0e5d35ddcde75e9f9fa0751bb08e Mon Sep 17 00:00:00 2001 From: Benedek Robert George Date: Tue, 7 May 2024 15:18:58 +0300 Subject: [PATCH 1/4] feat: show balance and add input number box for give bitz Ref: #415, #416 --- .../GetBitz/GiveBitz/GiveBitzBase.tsx | 12 ++++++- .../GetBitz/GiveBitz/GiveBitzLowerCard.tsx | 32 +++++++++++++------ 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzBase.tsx b/src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzBase.tsx index 48b99ba8..fbbc4996 100644 --- a/src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzBase.tsx +++ b/src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzBase.tsx @@ -14,6 +14,7 @@ import PowerUpBounty from "./PowerUpBounty"; import { getDataBounties, GiveBitzDataBounty } from "../config"; import { LeaderBoardItemType, viewDataJSONCore } from "../index"; import LeaderBoardTable from "../LeaderBoardTable"; +import { FlaskRound } from "lucide-react"; type GiveBitzBaseProps = { gameDataNFT: DataNft; @@ -25,6 +26,8 @@ const GiveBitzBase = (props: GiveBitzBaseProps) => { const { tokenLogin } = useGetLoginInfo(); const givenBitzSum = useAccountStore((state: any) => state.givenBitzSum); const collectedBitzSum = useAccountStore((state: any) => state.collectedBitzSum); + const bitzBalance = useAccountStore((state: any) => state.bitzBalance); + const { chainID } = useGetNetworkConfig(); const [giverLeaderBoardIsLoading, setGiverLeaderBoardIsLoading] = useState(false); const [giverLeaderBoard, setGiverLeaderBoard] = useState([]); @@ -265,6 +268,7 @@ const GiveBitzBase = (props: GiveBitzBaseProps) => { fetchMyGivenBitz(); fetchGiverLeaderBoard(); updateDataBountyTotalReceivedAmount(bitsToCampaignId, bitsVal, isNewGiver); + updateBitzBalance(bitzBalance - bitsVal); return true; } } else { @@ -348,7 +352,13 @@ const GiveBitzBase = (props: GiveBitzBaseProps) => {
- Power-up Data Bounties +
+ Power-up Data Bounties +
+ {bitzBalance === -2 ? `...` : <>{bitzBalance === -1 ? "0" : `${bitzBalance}`}} + +
+
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. diff --git a/src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzLowerCard.tsx b/src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzLowerCard.tsx index 2dfb0a39..7fb57ff3 100644 --- a/src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzLowerCard.tsx +++ b/src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzLowerCard.tsx @@ -128,16 +128,28 @@ const GiveBitzLowerCard: React.FC = (props) => { transition={{ duration: 0.6, delay: 0.1 }}>
Give More BiTz
- setBitzVal(Number(e.target.value))} - className="accent-black dark:accent-white w-full cursor-pointer custom-range-slider" - /> +
+ setBitzVal(Number(e.target.value))} + className="accent-black dark:accent-white w-full cursor-pointer custom-range-slider" + /> + setBitzVal(Math.min(Number(e.target.value), bitzBalance))} + className="bg-[#35d9fa]/30 text-[#35d9fa] focus:none focus:outline-none focus:border-transparent text-center border-[#35d9fa] rounded-md" + /> +
+
Date: Tue, 7 May 2024 15:21:44 +0300 Subject: [PATCH 2/4] fix: light mode text color --- src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzLowerCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzLowerCard.tsx b/src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzLowerCard.tsx index 7fb57ff3..20bad6dc 100644 --- a/src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzLowerCard.tsx +++ b/src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzLowerCard.tsx @@ -146,7 +146,7 @@ const GiveBitzLowerCard: React.FC = (props) => { step="1" value={bitzVal} onChange={(e) => setBitzVal(Math.min(Number(e.target.value), bitzBalance))} - className="bg-[#35d9fa]/30 text-[#35d9fa] focus:none focus:outline-none focus:border-transparent text-center border-[#35d9fa] rounded-md" + className="bg-[#35d9fa]/30 text- dark:text-[#35d9fa] focus:none focus:outline-none focus:border-transparent text-center border-[#35d9fa] rounded-md" />
From 258a305520f98d8eebb06e951dd835fb1bae15ae Mon Sep 17 00:00:00 2001 From: Damian Date: Thu, 16 May 2024 12:10:44 +0300 Subject: [PATCH 3/4] feat: #1319 --- package.json | 2 +- src/store/StoreProvider.tsx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f425dd07..59f67f1a 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "@fortawesome/react-fontawesome": "0.2.0", "@itheum/sdk-mx-data-nft": "3.3.0-alpha.3", "@multiversx/sdk-core": "13.0.1", - "@multiversx/sdk-dapp": "2.31.3", + "@multiversx/sdk-dapp": "2.29.2", "@multiversx/sdk-network-providers": "2.4.3", "@radix-ui/react-dialog": "1.0.5", "@radix-ui/react-dropdown-menu": "2.0.6", diff --git a/src/store/StoreProvider.tsx b/src/store/StoreProvider.tsx index 94121e10..1923d9ea 100644 --- a/src/store/StoreProvider.tsx +++ b/src/store/StoreProvider.tsx @@ -43,6 +43,13 @@ export const StoreProvider = ({ children }: PropsWithChildren) => { if (!address || !(tokenLogin && tokenLogin.nativeAuthToken)) { return; } + const nativeAuthTokenData = decodeNativeAuthToken(tokenLogin.nativeAuthToken); + if (nativeAuthTokenData.extraInfo.timestamp) { + const currentTime = new Date().getTime(); + if (currentTime > (nativeAuthTokenData.extraInfo.timestamp + nativeAuthTokenData.ttl) * 1000) { + return; + } + } // add all the balances into the loading phase updateBitzBalance(-2); updateGivenBitzSum(-2); From 891de63eaad791bd45c124d9253efbff33ffcd3e Mon Sep 17 00:00:00 2001 From: Damian Date: Tue, 28 May 2024 10:15:04 +0300 Subject: [PATCH 4/4] chore: package v up --- package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index 3f2146e3..69e8bf07 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,7 @@ { "name": "explorer-dapp", "description": "Itheum Explorer is a DApp for the public to explore and visualize data within the Itheum protocol", - - "version": "1.15.7", - + "version": "1.16.0", "author": "Itheum", "license": "GPL-3.0-or-later", "dependencies": {