Skip to content

Commit

Permalink
Merge pull request #455 from Itheum/stg
Browse files Browse the repository at this point in the history
STG -> MAIN 1.16
  • Loading branch information
damienen authored May 28, 2024
2 parents bbc84a4 + b98123d commit 50506b7
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 15 deletions.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -12,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",
Expand Down
12 changes: 11 additions & 1 deletion src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<boolean>(false);
const [giverLeaderBoard, setGiverLeaderBoard] = useState<LeaderBoardItemType[]>([]);
Expand Down Expand Up @@ -269,6 +272,7 @@ const GiveBitzBase = (props: GiveBitzBaseProps) => {
fetchMyGivenBitz();
fetchGiverLeaderBoard();
updateDataBountyTotalReceivedAmount(bitsToCampaignId, bitsVal, isNewGiver);
updateBitzBalance(bitzBalance - bitsVal);
return true;
}
} else {
Expand Down Expand Up @@ -352,7 +356,13 @@ const GiveBitzBase = (props: GiveBitzBaseProps) => {

<div id="bounties" className="flex flex-col w-full items-center justify-center">
<div className="flex flex-col mt-10 mb-8 items-center justify-center ">
<span className="text-foreground text-4xl mb-2">Power-up Data Bounties</span>
<div className="flex flex-col md:flex-row items-center justify-center ">
<span className="text-foreground text-4xl mb-2 text-center">Power-up Data Bounties </span>
<div className="flex flex-row ml-8 text-foreground text-4xl ">
{bitzBalance === -2 ? `...` : <>{bitzBalance === -1 ? "0" : `${bitzBalance}`}</>}
<FlaskRound className=" w-10 h-10 fill-[#35d9fa]" />
</div>
</div>
<span className="text-base text-foreground/75 text-center ">
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.
</span>
Expand Down
32 changes: 22 additions & 10 deletions src/pages/AppMarketplace/GetBitz/GiveBitz/GiveBitzLowerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,28 @@ const GiveBitzLowerCard: React.FC<GiveBitzLowerCardProps> = (props) => {
transition={{ duration: 0.6, delay: 0.1 }}>
<div>Give More BiTz</div>
<div className="mb-3 mt-1 w-full">
<input
type="range"
id="rangeBitz"
min="0"
max={bitzBalance}
step="1"
value={bitzVal}
onChange={(e) => setBitzVal(Number(e.target.value))}
className="accent-black dark:accent-white w-full cursor-pointer custom-range-slider"
/>
<div className="flex flex-row gap-2 justify-center items-center">
<input
type="range"
id="rangeBitz"
min="0"
max={bitzBalance}
step="1"
value={bitzVal}
onChange={(e) => setBitzVal(Number(e.target.value))}
className="accent-black dark:accent-white w-full cursor-pointer custom-range-slider"
/>
<input
type="number"
min="0"
max={bitzBalance}
step="1"
value={bitzVal}
onChange={(e) => setBitzVal(Math.min(Number(e.target.value), bitzBalance))}
className="bg-[#35d9fa]/30 text- dark:text-[#35d9fa] focus:none focus:outline-none focus:border-transparent text-center border-[#35d9fa] rounded-md"
/>
</div>

<div className="flex flex-row items-center md:gap-2">
<input
type="checkbox"
Expand Down
7 changes: 7 additions & 0 deletions src/store/StoreProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 50506b7

Please sign in to comment.