Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D kent #72

Merged
merged 4 commits into from
Aug 1, 2023
Merged
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
29 changes: 25 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@fortawesome/free-solid-svg-icons": "6.1.0",
"@fortawesome/react-fontawesome": "0.1.18",
"@headlessui/react": "1.7.15",
"@itheum/sdk-mx-data-nft": "0.0.4",
"@itheum/sdk-mx-data-nft": "0.0.7",
"@multiversx/sdk-core": "12.2.1",
"@multiversx/sdk-dapp": "2.10.17",
"@multiversx/sdk-network-providers": "1.4.0",
Expand All @@ -27,6 +27,7 @@
"react-dom": "18.2.0",
"react-hot-toast": "2.4.0",
"react-icons": "4.8.0",
"react-inlinesvg": "^3.0.2",
"react-modal": "3.16.1",
"react-router-dom": "6.4.2",
"react-tooltip": "5.11.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataNftCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function DataNftCard({
</span>
</div>
<div className="mb-1 row">
<span className="col-4 opacity-6">Supply:</span>
<span className="col-4 opacity-6">Total Supply:</span>
<span className="col-8">{dataNft.supply}</span>
</div>
<div className="mb-1 row">
Expand Down
1 change: 1 addition & 0 deletions src/libs/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export enum BlobDataType {
TEXT,
IMAGE,
AUDIO,
SVG,
}
4 changes: 2 additions & 2 deletions src/pages/MyListed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const MyListed = () => {
</span>
</div>
<div className="mb-1 row">
<span className="col-4 opacity-6">Amount:</span>
<span className="col-4 opacity-6">Listed:</span>
<span className="col-8">{offer.quantity}</span>
</div>
<div className="mb-1 row">
Expand Down Expand Up @@ -178,7 +178,7 @@ export const MyListed = () => {
</span>
</div>
<div className="mb-1 row">
<span className="col-4 opacity-6">Supply:</span>
<span className="col-4 opacity-6">Total Supply:</span>
<span className="col-8">
{isDataNftLoaded && dataNfts[index].supply}
</span>
Expand Down
19 changes: 15 additions & 4 deletions src/pages/MyWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useGetLoginInfo } from "@multiversx/sdk-dapp/hooks";
import { ModalBody } from "react-bootstrap";
import ModalHeader from "react-bootstrap/esm/ModalHeader";
import { IoClose } from "react-icons/io5";
import SVG from 'react-inlinesvg';
import Modal from "react-modal";
import { useNavigate, useParams } from "react-router-dom";
import { DataNftCard, Loader, TrailBlazerModal } from "components";
Expand Down Expand Up @@ -111,10 +112,15 @@ export const MyWallet = () => {
let blobDataType = BlobDataType.TEXT;
if (!res.error) {
if (res.contentType.search("image") >= 0) {
res.data = window.URL.createObjectURL(
new Blob([res.data], { type: res.contentType })
);
blobDataType = BlobDataType.IMAGE;
if (res.contentType == "image/svg+xml") {
blobDataType = BlobDataType.SVG;
res.data = await (res.data as Blob).text();
} else {
blobDataType = BlobDataType.IMAGE;
res.data = window.URL.createObjectURL(
new Blob([res.data], { type: res.contentType })
);
}
} else if (res.contentType.search("audio") >= 0) {
res.data = window.URL.createObjectURL(
new Blob([res.data], { type: res.contentType })
Expand Down Expand Up @@ -371,6 +377,11 @@ export const MyWallet = () => {
>
<audio controls autoPlay src={viewDataRes.data} />
</div>
) : viewDataRes.blobDataType === BlobDataType.SVG ? (
<SVG
src={viewDataRes.data}
style={{ width: "100%", height: "auto" }}
/>
) : (
<p
className="p-2"
Expand Down