diff --git a/package.json b/package.json index c0b6888..d623043 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "prettier": "^3.2.5" }, "dependencies": { + "framer-motion": "^11.5.6", "postcss": "^8.4.38" } } diff --git a/packages/nextjs/app/layout.tsx b/packages/nextjs/app/layout.tsx index fc7605e..3ed66ce 100644 --- a/packages/nextjs/app/layout.tsx +++ b/packages/nextjs/app/layout.tsx @@ -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 ( - + + {children} diff --git a/packages/nextjs/app/page.tsx b/packages/nextjs/app/page.tsx index 20da62d..3211a41 100644 --- a/packages/nextjs/app/page.tsx +++ b/packages/nextjs/app/page.tsx @@ -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 ( <>
-
-

- SpeedRunStarknet - - Challenge #0: Simple NFT - +
+

+ Welcome to + Mediolano

-
- challenge banner -
-

- 🎫 Create a simple NFT to learn basics of 🏗️ Scaffold-Stark 2. - You'll use 👷‍♀️ - - Starknet Foundry - {" "} - to compile and deploy smart contracts. Then, you'll use a - template React app full of important Ethereum components and - hooks. Finally, you'll deploy an NFT to a public network to - share with friends! 🚀 -

-

- 🌟 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{" "} - - Scaffoldstark.com - {" "} - ! -

-
+
+

+ Connected Address: +

+
+ +
+ + + {/*
{ + writeAsync(); + }} + > + TEST TX +
*/}
+ + +
+ +
+
+
+
+
+

+ Protect Your Intellectual Property +

+

+ Register, license, and market your intellectual property with ease. Secure your ideas and innovations today. +

+
+
+ + +
+
+
+
+ + +
+
+

Our Services

+
+ + + + Registration + + +

Register your intellectual property quickly and securely.

+ +
+
+ + + + Listing + + +

List your intellectual property for potential buyers or licensees.

+ +
+
+ + + + Licensing + + +

License your intellectual property to interested parties.

+ +
+
+ + + + Downloads + + +

Access and download important documents and resources.

+ +
+
+ + + + Support + + +

Get help and support for all your IP-related queries.

+ +
+
+
+
+
+
+ +
+ + + + ); }; diff --git a/packages/nextjs/app/register/[id]/page.tsx b/packages/nextjs/app/register/[id]/page.tsx new file mode 100644 index 0000000..22c0d01 --- /dev/null +++ b/packages/nextjs/app/register/[id]/page.tsx @@ -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 ( + <> +
+
+

+ My NFTs +

+
+
+
+ {!isConnected || isConnecting ? ( + + ) : ( + + )} +
+ + + ) +} + +export default SubmissionPage; diff --git a/packages/nextjs/app/register/page.tsx b/packages/nextjs/app/register/page.tsx new file mode 100644 index 0000000..f93c66a --- /dev/null +++ b/packages/nextjs/app/register/page.tsx @@ -0,0 +1,175 @@ +"use client"; + +import Link from 'next/link' +// import { ArrowRight } from 'lucide-react' +import { useState, FormEvent } from 'react' +import { useRouter } from 'next/navigation' + +interface FormData { + title: string, + briefDescription: string, + detailedDescription: string, + // date: Date | null, + date: string, + authors: Array, +} + +export default function IntellectualPropertyForm(){ + const router = useRouter() + + const [formData, setFormData] = useState({ + title: '', + briefDescription: '', + detailedDescription: '', + date: '', + authors: [], + }) + + const [errors, setErrors] = useState>({}) + + const[count, setCount] = useState(0) + + const handleChange = (e: React.ChangeEvent) => { + const { name, value } = e.target + setFormData(prev => ({ ...prev, [name]: value })) + } + + // const validateForm = (): boolean => { + // const newErrors: Partial = {} + // if (formData.title.length < 2) { + // newErrors.title = "Title must be at least 2 characters." + // } + // if (formData.briefDescription.length < 10) { + // newErrors.briefDescription = "Brief description must be at least 10 characters." + // } + // if (formData.detailedDescription.length < 50) { + // newErrors.detailedDescription = "Detailed description must be at least 50 characters." + // } + // if (!/^\d{4}-\d{2}-\d{2}$/.test(formData.date)) { + // newErrors.date = "Please enter a valid date in YYYY-MM-DD format." + // } + // if (formData.authors.length < 2) { + // newErrors.authors = "Please enter at least one author." + // } + // setErrors(newErrors) + // return Object.keys(newErrors).length === 0 + // } + + const getNextSubmissionId = () => { + setCount(count + 1) + return count + } + + const handleSubmit = (e: FormEvent) => { + e.preventDefault() + + // if (validateForm()) { + // console.log(formData) + // alert("Form submitted successfully!") + // // Here you would typically send the form data to your backend + // } + + const id = getNextSubmissionId() + router.push(`/register/${id}`) + + } + + return ( +
+

Intellectual Property Submission

+
+
+ + + {/* {errors.title &&

{errors.title}

} */} +
+ +
+ +