Skip to content

Commit

Permalink
Merge pull request #173 from Itheum/milestone-1.6.0
Browse files Browse the repository at this point in the history
token login
  • Loading branch information
damienen authored Sep 21, 2023
2 parents 8615505 + cba8ce5 commit a77f466
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
import { TransactionsToastList, NotificationModal, SignTransactionsModals } from "components";
import { apiTimeout, walletConnectV2ProjectId, sampleAuthenticatedDomains, ELROND_NETWORK } from "config";
import { MultiversxBubbles, MultiversxInfographics, MyWallet, PageNotFound, Unlock } from "pages";
import { NFTunes } from "pages/AppMarketplace/NFTunes";
import { ItheumTrailblazer } from "pages/ItheumTrailblazer";
import { routes, routeNames } from "routes";
import { ThemeProvider } from "./libComponents/ThemeProvider";
import { NFTunes } from "pages/AppMarketplace/NFTunes";

export const App = () => {
return (
Expand Down
10 changes: 7 additions & 3 deletions src/components/DataNftCard.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from "react";
import { DataNft } from "@itheum/sdk-mx-data-nft/out";
import { useGetLoginInfo } from "@multiversx/sdk-dapp/hooks";
import { useGetNetworkConfig } from "@multiversx/sdk-dapp/hooks/useGetNetworkConfig";
import { MARKETPLACE_DETAILS_PAGE } from "config";
import { convertToLocalString } from "libs/utils";
import { Button } from "../libComponents/Button";
import { Card, CardContent, CardFooter } from "../libComponents/Card";
import { MXAddressLink } from "./MXAddressLink";
import { Modal } from "./Modal/Modal";
import { useGetLoginInfo } from "@multiversx/sdk-dapp/hooks";
import { MXAddressLink } from "./MXAddressLink";

export function DataNftCard({
index,
Expand Down Expand Up @@ -74,7 +74,11 @@ export function DataNftCard({
<span className="col-span-4 opacity-6">Identifier:</span>
<div className="col-span-8 w-full items-center justify-center">
<a
href={`${MARKETPLACE_DETAILS_PAGE}${dataNft.tokenIdentifier}`}
href={
`${MARKETPLACE_DETAILS_PAGE}${dataNft.tokenIdentifier}` + (tokenLogin && tokenLogin.nativeAuthToken)
? `/?accessToken=${tokenLogin?.nativeAuthToken}`
: ""
}
className="flex flex-row items-center text-decoration-none !text-blue-500"
target="_blank">
<p className="flex flex-row w-full items-center mb-0 text-sm xl:text-base">{dataNft.tokenIdentifier}</p>
Expand Down
8 changes: 7 additions & 1 deletion src/pages/MyListed.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect, useState } from "react";
import { DataNft, Offer } from "@itheum/sdk-mx-data-nft";
import { Address } from "@multiversx/sdk-core/out";
import { useGetLoginInfo } from "@multiversx/sdk-dapp/hooks";
import { FaExternalLinkAlt } from "react-icons/fa";
import { MXAddressLink, Loader } from "components";
import { MARKETPLACE_DETAILS_PAGE } from "config";
Expand All @@ -16,6 +17,7 @@ export const MyListed = () => {
network: { explorerAddress },
} = useGetNetworkConfig();
const { address } = useGetAccount();
const { tokenLogin } = useGetLoginInfo();
const { hasPendingTransactions } = useGetPendingTransactions();

const [offerCount, setOfferCount] = useState<number>(0);
Expand Down Expand Up @@ -87,7 +89,11 @@ export const MyListed = () => {
<div className="flex flex-row items-center gap-1">
<span className="xl:text-base text-sm">{nftId}</span>
<a
href={`${MARKETPLACE_DETAILS_PAGE}${nftId}`}
href={
`${MARKETPLACE_DETAILS_PAGE}${nftId}` + (tokenLogin && tokenLogin.nativeAuthToken)
? `/?accessToken=${tokenLogin?.nativeAuthToken}`
: ""
}
className="!text-blue-500 text-decoration-none hover:!text-blue-500/80"
target="_blank">
<FaExternalLinkAlt />
Expand Down
5 changes: 4 additions & 1 deletion src/pages/MyWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ export const MyWallet = () => {
<h4 className="no-items">
<div>
You do not own any Data NFTs yet. Browse and procure Data NFTs by visiting the
<a href={`${MARKETPLACE_DETAILS_PAGE}`} className="ml-2 address-link text-decoration-none" target="_blank">
<a
href={`${MARKETPLACE_DETAILS_PAGE}` + (tokenLogin && tokenLogin.nativeAuthToken) ? `/?accessToken=${tokenLogin?.nativeAuthToken}` : ""}
className="ml-2 address-link text-decoration-none"
target="_blank">
Data DEX
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/routes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { dAppName } from "config";
import { RouteType } from "libs/types";
import { NFTunes } from "pages/AppMarketplace/NFTunes";
import { ItheumTrailblazer } from "pages/ItheumTrailblazer";
import { withPageTitle } from "./components/PageTitle";
import { PlayStationGamer, Home, MyListed, MyWallet, EsdtBubble, MultiversxBubbles, MultiversxInfographics } from "./pages";
import { NFTunes } from "pages/AppMarketplace/NFTunes";

export const routeNames = {
home: "/",
Expand Down

0 comments on commit a77f466

Please sign in to comment.