Skip to content

Commit

Permalink
Fixed music showing wrong on Create
Browse files Browse the repository at this point in the history
  • Loading branch information
luloxi committed Sep 23, 2024
1 parent 6eba4f7 commit 123fe76
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 41 deletions.
10 changes: 7 additions & 3 deletions packages/nextjs/app/create/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { useEffect, useState } from "react";
import { AttributesForm } from "./_components/AttributesForm";
import { Description } from "./_components/Description";
import { ImageUploader } from "./_components/ImageUploader";
import { JSONViewer } from "./_components/JSONViewer";
import { MediaPreview } from "./_components/MediaPreview";
import { MetadataForm } from "./_components/MetadataForm";
import { MintingForm } from "./_components/MintingButtons";
import { RestoreDescriptionButton } from "./_components/RestoreDescriptionButton";
Expand Down Expand Up @@ -81,13 +81,17 @@ export const Create: NextPage = () => {
animationUrl={animationUrl}
setAnimationUrl={setAnimationUrl}
/>
{animationUrl && (
<video controls className="h-20 w-full pb-4">
<source src={animationUrl} type="audio/mpeg" />
</video>
)}
<AttributesForm attributes={attributes} setAttributes={setAttributes} />
</div>

{/* Media Preview */}
<MediaPreview
<ImageUploader
image={uploadedImageIpfsPath}
animationUrl={animationUrl}
setUploadedImageIpfsPath={setUploadedImageIpfsPath} // NEW: Set the uploaded image IPFS path here
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import Image from "next/image";
import { notification } from "~~/utils/scaffold-eth";
import { addToIPFS } from "~~/utils/simpleNFT/ipfs-fetch";

interface MediaPreviewProps {
interface ImageUploaderProps {
image: string;
animationUrl?: string;
setUploadedImageIpfsPath: (path: string) => void; // For handling IPFS upload
}

export const MediaPreview: React.FC<MediaPreviewProps> = ({ image, animationUrl, setUploadedImageIpfsPath }) => {
export const ImageUploader: React.FC<ImageUploaderProps> = ({ image, setUploadedImageIpfsPath }) => {
const [previewImage, setPreviewImage] = useState<string | null>(image || null);
const [dragActive, setDragActive] = useState(false);
const [loading, setLoading] = useState(false);
Expand Down Expand Up @@ -125,11 +124,6 @@ export const MediaPreview: React.FC<MediaPreviewProps> = ({ image, animationUrl,
Uploading...
</div>
)}
{animationUrl && (
<video controls className="w-full h-12-2">
<source src={animationUrl} type="audio/mpeg" />
</video>
)}
</div>
);
};
10 changes: 5 additions & 5 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";
const deployedContracts = {
31337: {
ProfileInfo: {
address: "0x82e01223d51eb87e16a03e24687edf0f294da6f1",
address: "0x18e317a7d70d8fbf8e6e893616b52390ebbdb629",
abi: [
{
type: "function",
Expand Down Expand Up @@ -75,7 +75,7 @@ const deployedContracts = {
inheritedFunctions: {},
},
SimpleMint: {
address: "0x2bdcc0de6be1f7d2ee689a0342d76f52e8efaba3",
address: "0x4b6ab5f819a515382b0deb6935d793817bb4af28",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -388,7 +388,7 @@ const deployedContracts = {
},
},
MockNFT: {
address: "0x7969c5ed335650692bc04293b07f5bf2e7a673c0",
address: "0xcace1b78160ae76398f486c8a18044da0d66d86d",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -1008,7 +1008,7 @@ const deployedContracts = {
},
},
MockUSDC: {
address: "0x7bc06c482dead17c0e297afbc32f6e63d3846650",
address: "0xd5ac451b0c50b9476107823af206ed814a2e2580",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -1465,7 +1465,7 @@ const deployedContracts = {
},
},
Marketplace: {
address: "0xc351628eb244ec633d5f21fbd6621e1a683b1181",
address: "0xf8e31cb472bc70500f08cd84917e5a1912ec8397",
abi: [
{
type: "constructor",
Expand Down
50 changes: 25 additions & 25 deletions packages/nextjs/utils/simpleNFT/nftsMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,25 @@ const nftsMetadata = [
],
},
{
name: "Dog in a bike",
description: "Just as expected",
name: "Desolated rails",
description: "Sometimes the shortest way is to follow the rails.",
// external_url: "https://austingriffith.com/portfolio/paintings/", // <-- this can link to a page for the specific file too
image: "https://ipfs.io/ipfs/QmccnSeQc9ND2pUfEkFhQWxyU3Gu4WDRv4J11QgUtpkU3H",
animation_url: "https://ipfs.io/ipfs/QmT4RaimopnKHxAF81ut9MBFLGqun1CyTM39ZEmKxDxkoL",
image: "https://ipfs.io/ipfs/Qmdw6ujzDhn6GEcXgJbQ8KWDuFyTDD7xpMcepcqTERKgCK",
animation_url: "https://ipfs.io/ipfs/QmfF1jkVp339GXh5VtuYF3Kj4wLfKfYieQ8zp47LQWM8RP",

attributes: [],
},
{
name: "Fork cemetery",
description: "R.I.P.",
// external_url: "https://austingriffith.com/portfolio/paintings/", // <-- this can link to a page for the specific file too
image: "https://ipfs.io/ipfs/QmZhs1eddBRFLtZ6enF7mzk4n5trE1WyLAgtWeWNHGAigX",
animation_url: "https://ipfs.io/ipfs/QmTMwY2gRBoY2auvJZTRMtw7N4ZiPzPMqMBiRbQN5358tk",

attributes: [
{
trait_type: "Dogs",
value: "U can",
},
{
trait_type: "Moto",
value: "Cool",
trait_type: "Deaths",
value: "3 deaths",
},
],
},
Expand All @@ -49,28 +54,23 @@ const nftsMetadata = [
],
},
{
name: "Fork cemetery",
description: "R.I.P.",
name: "Dog in a bike",
description: "Just as expected",
// external_url: "https://austingriffith.com/portfolio/paintings/", // <-- this can link to a page for the specific file too
image: "https://ipfs.io/ipfs/QmZhs1eddBRFLtZ6enF7mzk4n5trE1WyLAgtWeWNHGAigX",
animation_url: "https://ipfs.io/ipfs/QmTMwY2gRBoY2auvJZTRMtw7N4ZiPzPMqMBiRbQN5358tk",
image: "https://ipfs.io/ipfs/QmccnSeQc9ND2pUfEkFhQWxyU3Gu4WDRv4J11QgUtpkU3H",
animation_url: "https://ipfs.io/ipfs/QmT4RaimopnKHxAF81ut9MBFLGqun1CyTM39ZEmKxDxkoL",

attributes: [
{
trait_type: "Deaths",
value: "3 deaths",
trait_type: "Dogs",
value: "U can",
},
{
trait_type: "Moto",
value: "Cool",
},
],
},
{
name: "Desolated rails",
description: "Sometimes the shortest way is to follow the rails.",
// external_url: "https://austingriffith.com/portfolio/paintings/", // <-- this can link to a page for the specific file too
image: "https://ipfs.io/ipfs/Qmdw6ujzDhn6GEcXgJbQ8KWDuFyTDD7xpMcepcqTERKgCK",
animation_url: "https://ipfs.io/ipfs/QmfF1jkVp339GXh5VtuYF3Kj4wLfKfYieQ8zp47LQWM8RP",

attributes: [],
},
{
name: "Strange Lights",
description: "They look cool tho",
Expand Down

0 comments on commit 123fe76

Please sign in to comment.