Skip to content

Commit

Permalink
falta as logos
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroRosalba committed Sep 21, 2024
1 parent 62a3aca commit 7e4c4ca
Show file tree
Hide file tree
Showing 16 changed files with 1,002 additions and 114 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"prettier": "^3.2.5"
},
"dependencies": {
"framer-motion": "^11.5.6",
"postcss": "^8.4.38"
}
}
13 changes: 8 additions & 5 deletions packages/nextjs/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@ import type { Metadata } from "next";
import { ScaffoldStarkAppWithProviders } from "~~/components/ScaffoldStarkAppWithProviders";
import "~~/styles/globals.css";
import { ThemeProvider } from "~~/components/ThemeProvider";
import { Space_Grotesk } from "next/font/google";

const spaceGrotesk = Space_Grotesk({ subsets: ["latin"] });
import { Inter } from 'next/font/google'
import ImprovedAnimatedBackground from '~~/components/ImprovedAnimatedBackground'

const inter = Inter({ subsets: ['latin'] })

export const metadata: Metadata = {
title: "Speedrun Stark",
description: "Fast track your starknet journey",
title: "Mediolano.app",
description: "Your gateway to own your intelectual properties",
icons: "/logo.ico",
};

const ScaffoldStarkApp = ({ children }: { children: React.ReactNode }) => {
return (
<html suppressHydrationWarning>
<body className={spaceGrotesk.className}>
<body className={inter.className}>
<ImprovedAnimatedBackground />
<ThemeProvider enableSystem>
<ScaffoldStarkAppWithProviders>
{children}
Expand Down
179 changes: 133 additions & 46 deletions packages/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,62 +1,149 @@
"use client";

import Link from "next/link";
import type { NextPage } from "next";
import { Address } from "~~/components/scaffold-stark";
import { useAccount } from "@starknet-react/core";
import { Address as AddressType } from "@starknet-react/chains";
import Image from "next/image";

import { Button } from "~~/components/ui/buttom";
import { Card, CardContent, CardHeader, CardTitle } from "~~/components/ui/card";
import { ArrowRight, BookOpen, Download, HeartHandshake, List, MessageSquare, ShieldCheck } from 'lucide-react';

const Home: NextPage = () => {
const connectedAddress = useAccount();

return (
<>
<div className="flex items-center flex-col flex-grow pt-10">
<div className="px-5 w-[90%] md:w-[75%]">
<h1 className="text-center mb-6">
<span className="block text-2xl mb-2">SpeedRunStarknet</span>
<span className="block text-4xl font-bold">
Challenge #0: Simple NFT
</span>
<div className="px-5">
<h1 className="text-center">
<span className="block text-2xl mb-2">Welcome to</span>
<span className="block text-4xl font-bold">Mediolano</span>
</h1>
<div className="flex flex-col items-center justify-center">
<Image
src="/ch0-cover.png"
width="727"
height="231"
alt="challenge banner"
className="rounded-xl border-4 border-primary"
/>
<div className="max-w-3xl">
<p className="text-center text-lg mt-8">
🎫 Create a simple NFT to learn basics of 🏗️ Scaffold-Stark 2.
You&apos;ll use 👷‍♀️
<a
href="https://github.com/foundry-rs/starknet-foundry"
target="_blank"
rel="noreferrer"
className="underline"
>
Starknet Foundry
</a>{" "}
to compile and deploy smart contracts. Then, you&apos;ll use a
template React app full of important Ethereum components and
hooks. Finally, you&apos;ll deploy an NFT to a public network to
share with friends! 🚀
</p>
<p className="text-center text-lg">
🌟 The final deliverable is an app that lets users purchase and
transfer NFTs. Deploy your contracts to a testnet then build and
upload your app to a public web server. Submit the url on{" "}
<a
href="https://www.scaffoldstark.com/"
target="_blank"
rel="noreferrer"
className="underline"
>
Scaffoldstark.com
</a>{" "}
!
</p>
</div>
<div className="flex justify-center items-center space-x-2">
<p className="my-2 font-medium text-[#00A3FF]">
Connected Address:
</p>
<Address address={connectedAddress.address as AddressType} />
</div>


</div>


{/* <div
onClick={() => {
writeAsync();
}}
>
TEST TX
</div> */}
</div>


<div className="flex flex-col min-h-screen">

<main className="flex-1">
<section className="w-full py-12 md:py-24 lg:py-32 xl:py-48">
<div className="container px-4 md:px-6">
<div className="flex flex-col items-center space-y-4 text-center">
<div className="space-y-2">
<h1 className="text-3xl font-bold tracking-tighter sm:text-4xl md:text-5xl lg:text-6xl/none">
Protect Your Intellectual Property
</h1>
<p className="mx-auto max-w-[700px] text-gray-500 md:text-xl dark:text-gray-400">
Register, license, and market your intellectual property with ease. Secure your ideas and innovations today.
</p>
</div>
<div className="space-x-4">
<Button asChild>
<Link href="/register">Get Started</Link>
</Button>
<Button variant="outline" asChild>
<Link href="/about">Learn More</Link>
</Button>
</div>
</div>
</div>
</section>


<section className="w-full py-12 md:py-24 lg:py-32">
<div className="container px-4 md:px-6">
<h2 className="text-3xl font-bold tracking-tighter sm:text-5xl text-center mb-12">Our Services</h2>
<div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
<Card>
<CardHeader>
<BookOpen className="h-6 w-6 mb-2" />
<CardTitle>Registration</CardTitle>
</CardHeader>
<CardContent>
<p>Register your intellectual property quickly and securely.</p>
<Button className="mt-4" variant="outline" asChild>
<Link href="/register">Register Now <ArrowRight className="ml-2 h-4 w-4" /></Link>
</Button>
</CardContent>
</Card>
<Card>
<CardHeader>
<List className="h-6 w-6 mb-2" />
<CardTitle>Listing</CardTitle>
</CardHeader>
<CardContent>
<p>List your intellectual property for potential buyers or licensees.</p>
<Button className="mt-4" variant="outline" asChild>
<Link href="/list">List Property <ArrowRight className="ml-2 h-4 w-4" /></Link>
</Button>
</CardContent>
</Card>
<Card>
<CardHeader>
<HeartHandshake className="h-6 w-6 mb-2" />
<CardTitle>Licensing</CardTitle>
</CardHeader>
<CardContent>
<p>License your intellectual property to interested parties.</p>
<Button className="mt-4" variant="outline" asChild>
<Link href="/license">License Now <ArrowRight className="ml-2 h-4 w-4" /></Link>
</Button>
</CardContent>
</Card>
<Card>
<CardHeader>
<Download className="h-6 w-6 mb-2" />
<CardTitle>Downloads</CardTitle>
</CardHeader>
<CardContent>
<p>Access and download important documents and resources.</p>
<Button className="mt-4" variant="outline" asChild>
<Link href="/downloads">Download <ArrowRight className="ml-2 h-4 w-4" /></Link>
</Button>
</CardContent>
</Card>
<Card>
<CardHeader>
<MessageSquare className="h-6 w-6 mb-2" />
<CardTitle>Support</CardTitle>
</CardHeader>
<CardContent>
<p>Get help and support for all your IP-related queries.</p>
<Button className="mt-4" variant="outline" asChild>
<Link href="/support">Get Support <ArrowRight className="ml-2 h-4 w-4" /></Link>
</Button>
</CardContent>
</Card>
</div>
</div>
</section>
</main>

</div>




</>
);
};
Expand Down
98 changes: 98 additions & 0 deletions packages/nextjs/app/register/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
'use client'

import { useParams } from 'next/navigation'
import type { NextPage } from "next";
import { useAccount } from "@starknet-react/core";
import { CustomConnectButton } from "~~/components/scaffold-stark/CustomConnectButton";
import { MyHoldings } from "~~/components/SimpleNFT/MyHoldings";
import { useScaffoldReadContract } from "~~/hooks/scaffold-stark/useScaffoldReadContract";
import { useScaffoldWriteContract } from "~~/hooks/scaffold-stark/useScaffoldWriteContract";
import { notification } from "~~/utils/scaffold-stark";
import { addToIPFS } from "~~/utils/simpleNFT/ipfs-fetch";
import nftsMetadata from "~~/utils/simpleNFT/nftsMetadata";
import { useState } from "react";

const SubmissionPage: NextPage = () => {
const params = useParams()
const { id } = params

// Fetch submission data here if needed
// For example, from an API endpoint

const { address: connectedAddress, isConnected, isConnecting } = useAccount();
const [status, setStatus] = useState("Mint NFT");

const { writeAsync: mintItem } = useScaffoldWriteContract({
contractName: "YourCollectible",
functionName: "mint_item",
args: [connectedAddress, ""],
});

const { data: tokenIdCounter, refetch } = useScaffoldReadContract({
contractName: "YourCollectible",
functionName: "current",
watch: false,
});

const handleMintItem = async () => {
setStatus("Minting NFT");
// circle back to the zero item if we've reached the end of the array
if (tokenIdCounter === undefined) {
setStatus("Mint NFT");
return;
}

const tokenIdCounterNumber = Number(tokenIdCounter);
const currentTokenMetaData =
nftsMetadata[tokenIdCounterNumber % nftsMetadata.length];
const notificationId = notification.loading("Uploading to IPFS");
try {
const uploadedItem = await addToIPFS(currentTokenMetaData);

// First remove previous loading notification and then show success notification
notification.remove(notificationId);
notification.success("Metadata uploaded to IPFS");

await mintItem({
args: [connectedAddress, uploadedItem.path],
});
setStatus("Updating NFT List");
refetch();
} catch (error) {
notification.remove(notificationId);
console.error(error);
setStatus("Mint NFT");
}
};

return (
<>
<div className="flex items-center flex-col pt-10">
<div className="px-5">
<h1 className="text-center mb-8">
<span className="block text-4xl font-bold">My NFTs</span>
</h1>
</div>
</div>
<div className="flex justify-center">
{!isConnected || isConnecting ? (
<CustomConnectButton />
) : (
<button
className="btn btn-secondary text-white"
disabled={status !== "Mint NFT"}
onClick={handleMintItem}
>
{status !== "Mint NFT" && (
<span className="loading loading-spinner loading-xs"></span>
)}
{status}
</button>
)}
</div>
<MyHoldings setStatus={setStatus} />
</>
)
}

export default SubmissionPage;
Loading

0 comments on commit 7e4c4ca

Please sign in to comment.