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

Update Challenge-simple-nft-example last Version Scaffold Stark #101

Merged
merged 52 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d3b75e7
Add postinstall (#187)
jrcarlos2000 Jul 11, 2024
bf86a2e
feat: Add cyberpunk style (#181)
GabrielaDelPilarR Jul 12, 2024
0954e0a
Fix correctly display wallet connectors (#189)
danielcdz Jul 14, 2024
8659c38
Changes in styles (#191)
GabrielaDelPilarR Jul 16, 2024
1c9aa03
Add correctly display wallet connectors in new style (#192)
Nadai2010 Jul 17, 2024
fe7eaae
Removed all mention of Goerli and all associated packages (#193)
Ugo-X Jul 17, 2024
df5f867
Update README.md
GabrielaDelPilarR Jul 17, 2024
bb0c32e
workflow to update create-stark in every PR (#195)
edulanasca Jul 18, 2024
dcf1e5c
chore(release): 0.0.3 [skip ci]
github-actions[bot] Jul 18, 2024
051bec6
update: wallet not deployed in ui & deploy.ts (#196) [minor]
edulanasca Jul 19, 2024
0525ed0
chore(release): 0.1.0 [skip ci]
github-actions[bot] Jul 19, 2024
5c1b40e
devops(demo): support scaffol-stark-demo workflow (#199)
oceanlvr Jul 20, 2024
b51c207
Update CONTRIBUTING.md (#201)
0xquantum3labs Jul 21, 2024
ffeb461
chore(release): 0.1.1 [skip ci]
github-actions[bot] Jul 21, 2024
d1097a2
Fix botton Wallet Not Deployed (#203)
Nadai2010 Jul 23, 2024
cba6bc4
Update package.json (#204)
jrcarlos2000 Jul 23, 2024
5621fa2
chore(release): 0.1.2 [skip ci]
github-actions[bot] Jul 23, 2024
2ad3b6a
lint to validate deployContract (#198)
edulanasca Jul 23, 2024
ed0b2ba
chore(release): 0.1.3 [skip ci]
github-actions[bot] Jul 23, 2024
783a64e
Support for latest versions : v2 Release (#165) [minor]
0xquantum3labs Jul 28, 2024
f3b9656
chore(release): 0.2.0 [skip ci]
github-actions[bot] Jul 28, 2024
4a8d170
Update rpc (#206)
0xquantum3labs Jul 28, 2024
b12b6e9
chore(release): 0.2.1 [skip ci]
github-actions[bot] Jul 28, 2024
8ba39e2
chore : remove submodule (#207)
0xquantum3labs Jul 28, 2024
5fee13e
chore(release): 0.2.2 [skip ci]
github-actions[bot] Jul 28, 2024
63ccf8f
Update readme (#208)
0xquantum3labs Jul 28, 2024
7149cb4
chore(release): 0.2.3 [skip ci]
github-actions[bot] Jul 28, 2024
21a9edc
Update readme (#221)
GabrielaDelPilarR Jul 30, 2024
9f65b18
chore(release): 0.2.4 [skip ci]
github-actions[bot] Jul 30, 2024
57494b3
feat: improved faucet functionality and added sepolia faucets (#222)
Ayoazeez26 Jul 31, 2024
cd4ab1a
Feat/set and integrate blockexplorer (#225)
Ayoazeez26 Aug 1, 2024
3918641
Improve deploy function on deploy-contract.ts (#231)
ikemHood Aug 3, 2024
6bb817c
fix : format
jrcarlos2000 Aug 6, 2024
35efe94
feat: add support for STRK balance (#226) [skip ci]
raizo07 Aug 7, 2024
1b910bd
Update readme (#240) [skip ci]
gianalarcon Aug 8, 2024
77f50dc
chore(release): 0.2.5 [skip ci]
github-actions[bot] Aug 8, 2024
9265529
Added yarn deploy:reset script to reset deployments (#233)
josephchimebuka Aug 8, 2024
c222129
Improve contract (#242)
gianalarcon Aug 8, 2024
c436d25
chore(release): 0.2.6 [skip ci]
github-actions[bot] Aug 8, 2024
66a02bd
Clean challenge-base (#95)
gianalarcon Aug 8, 2024
db0128d
Update lint.yml
jrcarlos2000 Aug 9, 2024
80f3d15
Added classHash to debug page (#232)
Jemiiah Aug 9, 2024
a13379c
Update Challenge-simple-nft-example last Version Scaffold Stark
Nadai2010 Aug 10, 2024
41953c7
Remove MenuItem, uncomment refetch and add modify contactsData
Nadai2010 Aug 10, 2024
e6b74b7
Merge branch 'simple-nft-example' into nadai/simple-nft-update
Nadai2010 Aug 10, 2024
47ff9ab
Update fixed files and format
Nadai2010 Aug 10, 2024
e9f79d8
Update deployedContract
Nadai2010 Aug 10, 2024
7c63bc5
Update Challenge-base last Version Scaffold Stark (#99)
Nadai2010 Aug 11, 2024
3fd17ef
Remove unncesary workflows
gianalarcon Aug 13, 2024
0262c90
Update ch-base (#105)
gianalarcon Aug 13, 2024
c925ad1
Merge branch 'challenge-base' into nadai/simple-nft-update
gianalarcon Aug 13, 2024
403cd12
Remove comments
gianalarcon Aug 13, 2024
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
6 changes: 4 additions & 2 deletions .github/workflows/demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ on:
types: [closed]
branches: [main]
paths:
- "packages/nextjs/**"
- 'packages/nextjs/**'

jobs:
version-bump-nextjs:
runs-on: ubuntu-22.04
steps:

- name: Checkout Source Repository
uses: actions/checkout@v4
with:
Expand All @@ -28,7 +29,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: "https://registry.yarnpkg.com"
registry-url: 'https://registry.yarnpkg.com'

- name: Deploy to vercel
if: success()
Expand Down Expand Up @@ -60,3 +61,4 @@ jobs:
slack-message: "GitHub deployed to vercel result: ${{ job.status }}\nRepository Name: ${{ github.repository }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

6 changes: 0 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ jobs:
run: yarn install --immutable
working-directory: ./packages/nextjs

- name: Install scarb
run: curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh -s -- -v 2.5.4

- name: Check Code Format
run: npm run format:check

- name: Run Next.js lint
run: yarn next:lint --max-warnings=0
working-directory: ./packages/nextjs
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-create-stark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
git commit -m "chore: sync files from scaffold-stark-2 [skip ci]"

- name: Format .gitignore files
run: |
run: |
find destination_repo/templates/base -type f -name ".gitignore" | while read -r gitignore_file; do
mjs_file="${gitignore_file%/*}/.gitignore.template.mjs"
gitignore_content=$(cat "$gitignore_file")
Expand Down Expand Up @@ -83,8 +83,8 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org/"
node-version: '16'
registry-url: 'https://registry.npmjs.org/'

- name: Publish release
if: success()
Expand All @@ -93,7 +93,7 @@ jobs:
cd destination_repo
npm install && npm run build && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Notify Slack on Success
if: success()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Prepare your environment variables.

> 🦊 Since we have deployed to a public testnet, you will now need to connect using a wallet you own(Argent X or Braavos).

![connect-wallet](https://raw.githubusercontent.com/Quantum3-Labs/speedrunstark/gabi/simple-nft-example/packages/nextjs/public/ch0-wallet.png)
![connect-wallet](https://raw.githubusercontent.com/Quantum3-Labs/speedrunstark/simple-nft-example/packages/nextjs/public/ch0-wallet.png)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove reference to https link, lets call relative/internal path


> You should see the correct network in the frontend (<http://localhost:3000>):

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ss-2",
"version": "0.2.3",
"version": "0.2.6",
"author": "Q3 Labs",
"license": "MIT",
"private": true,
Expand All @@ -13,6 +13,7 @@
"scripts": {
"chain": "yarn workspace @ss-2/snfoundry chain",
"deploy": "yarn workspace @ss-2/snfoundry deploy",
"deploy:reset": "yarn workspace @ss-2/snfoundry deploy:reset",
"test": "yarn workspace @ss-2/snfoundry test",
"compile": "yarn workspace @ss-2/snfoundry compile",
"start": "yarn workspace @ss-2/nextjs dev",
Expand Down
5 changes: 5 additions & 0 deletions packages/nextjs/app/debug/_components/contract/ContractUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useTargetNetwork } from "~~/hooks/scaffold-stark/useTargetNetwork";
import { ContractName } from "~~/utils/scaffold-stark/contract";
import { ContractVariables } from "./ContractVariables";
import { ContractWriteMethods } from "./ContractWriteMethods";
import { ClassHash } from "~~/components/scaffold-stark/ClassHash";

type ContractUIProps = {
contractName: ContractName;
Expand Down Expand Up @@ -58,6 +59,10 @@ export const ContractUI = ({
<div className="flex flex-col gap-1">
<span className="font-bold text-neutral">{contractName}</span>
<Address address={deployedContractData.address} />
<ClassHash
classHash={deployedContractData.classHash}
size="xs"
/>
<div className="flex gap-1 items-center">
<span className="font-bold text-sm">Balance:</span>
<Balance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const ReadOnlyFunctionForm = ({
</div>
)}
</div>

<div
className={`flex ${
formErrorMessage &&
Expand Down
10 changes: 10 additions & 0 deletions packages/nextjs/app/debug/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ const Debug: NextPage = () => {
return (
<>
<DebugContracts />
{/* <div className="text-center mt-8 bg-secondary p-10">
<h1 className="text-4xl my-0">Debug Contracts</h1>
<p className="text-neutral">
You can debug & interact with your deployed contracts here.
<br /> Check{" "}
<code className="italic bg-base-300 text-base font-bold [word-spacing:-0.5rem] px-1">
packages / nextjs / app / debug / page.tsx
</code>{" "}
</p>
</div> */}
</>
);
};
Expand Down
72 changes: 49 additions & 23 deletions packages/nextjs/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import React from "react";
import Link from "next/link";

import {
CurrencyDollarIcon,
MagnifyingGlassIcon,
} from "@heroicons/react/24/outline";
import { CurrencyDollarIcon } from "@heroicons/react/24/outline";
import { useTargetNetwork } from "~~/hooks/scaffold-stark/useTargetNetwork";
import { useGlobalState } from "~~/services/store/store";
import { devnet } from "@starknet-react/chains";
import { Faucet } from "./scaffold-stark";
import { getBlockExplorerLink } from "~~/utils/scaffold-stark";
import { devnet, sepolia, mainnet } from "@starknet-react/chains";
import { Faucet } from "~~/components/scaffold-stark/Faucet";
import { FaucetSepolia } from "~~/components/scaffold-stark/FaucetSepolia";
import { BlockExplorerSepolia } from "./scaffold-stark/BlockExplorerSepolia";
import { BlockExplorer } from "./scaffold-stark/BlockExplorer";

/**
* Site footer
Expand All @@ -20,12 +18,14 @@ export const Footer = () => {
);
const { targetNetwork } = useTargetNetwork();
const isLocalNetwork = targetNetwork.id === devnet.id;
const isSepoliaNetwork = targetNetwork.id === sepolia.id;
const isMainnetNetwork = targetNetwork.id === mainnet.id;

return (
<div className="min-h-0 py-5 px-1 mb-11 lg:mb-0 bg-base-100">
<div>
<div className="fixed flex justify-between items-center w-full z-10 p-4 bottom-0 left-0 pointer-events-none ">
<div className="flex md:flex-row gap-2 pointer-events-auto text-[12px] sm:text-[16px]">
<div className="fixed flex justify-between items-center w-full z-10 p-4 bottom-0 left-0 pointer-events-none">
<div className="flex flex-col md:flex-row gap-2 pointer-events-auto">
{nativeCurrencyPrice > 0 && (
<div>
<div className="btn btn-sm font-normal gap-1 cursor-auto border border-[#32BAC4] shadow-none">
Expand All @@ -34,27 +34,28 @@ export const Footer = () => {
</div>
</div>
)}
{isSepoliaNetwork && (
<>
<FaucetSepolia />
<BlockExplorerSepolia />
</>
)}
{isLocalNetwork && (
<>
<Faucet />
<Link
href={getBlockExplorerLink(targetNetwork)}
target={"_blank"}
rel={"noopener noreferrer"}
passHref
className="btn btn-sm font-normal gap-1 border border-[#32BAC4] shadow-none"
>
<MagnifyingGlassIcon className="h-4 w-4 text-[#32BAC4]" />
<span>Block Explorer</span>
</Link>
</>
)}
{isMainnetNetwork && (
<>
<BlockExplorer />
</>
)}
</div>
</div>
</div>
<div className="w-full ">
<ul className="menu menu-horizontal w-full ">
<div className="flex justify-center items-center gap-2 text-sm w-full ">
<div className="w-full">
<ul className="menu menu-horizontal w-full">
<div className="flex justify-center items-center gap-2 text-sm w-full">
<div className="text-center">
<a
href="https://github.com/Quantum3-Labs/scaffold-stark-2"
Expand All @@ -66,6 +67,31 @@ export const Footer = () => {
</a>
</div>
<span>·</span>
{/* <div className="flex justify-center items-center gap-2">
<p className="m-0 text-center">
Built with <HeartIcon className="inline-block h-4 w-4" /> by
</p>
<a
className="flex justify-center items-center gap-1"
href="https://quantum3labs.com/"
target="_blank"
rel="noreferrer"
>
<BuidlGuidlLogo className="w-3 h-5 pb-1" />
<span className="link">Q3 Labs</span>
</a>
<p className="m-0 text-center">at</p>
<a
className="flex justify-center items-center gap-1"
href="https://buidlguidl.com/"
target="_blank"
rel="noreferrer"
>
<BuidlGuidlLogo className="w-3 h-5 pb-1" />
<span className="link">BuidlGuidl</span>
</a>
</div>
<span>·</span> */}
<div className="text-center">
<a
href="https://t.me/+wO3PtlRAreo4MDI9"
Expand Down
9 changes: 5 additions & 4 deletions packages/nextjs/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use client";

import React, { useCallback, useRef, useState, useEffect } from "react";
import Image from "next/image";
import Link from "next/link";
Expand All @@ -19,7 +20,7 @@ import { devnet } from "@starknet-react/chains";
import { SwitchTheme } from "./SwitchTheme";
import { useAccount, useProvider } from "@starknet-react/core";

export type HeaderMenuLink = {
type HeaderMenuLink = {
label: string;
href: string;
icon?: React.ReactNode;
Expand Down Expand Up @@ -61,7 +62,6 @@ export const HeaderMenuLinks = () => {
useEffect(() => {
setIsDark(theme === "dark");
}, [theme]);

return (
<>
{menuLinks.map(({ label, href, icon }) => {
Expand Down Expand Up @@ -93,13 +93,13 @@ export const HeaderMenuLinks = () => {
export const Header = () => {
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
const burgerMenuRef = useRef<HTMLDivElement>(null);

useOutsideClick(
burgerMenuRef,
useCallback(() => setIsDrawerOpen(false), []),
);
const { targetNetwork } = useTargetNetwork();
const isLocalNetwork = targetNetwork.id === devnet.id;

const { provider } = useProvider();
const { address, status } = useAccount();
const [isDeployed, setIsDeployed] = useState(true);
Expand Down Expand Up @@ -151,7 +151,7 @@ export const Header = () => {
alt="SE2 logo"
className="cursor-pointer"
fill
src="/challenge-icon-starknet.svg"
Copy link
Collaborator

@gianalarcon gianalarcon Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this two .svg are the same for me. We can delete one of them. Lets check and fix it from the scaffold-stark repo. We can fix this from the challenge-base branch

src="/logo.svg"
/>
</div>
<div className="flex flex-col">
Expand All @@ -170,6 +170,7 @@ export const Header = () => {
</span>
) : null}
<CustomConnectButton />
{/* <FaucetButton /> */}
<SwitchTheme
className={`pointer-events-auto ${
isLocalNetwork ? "self-end md:self-auto" : ""
Expand Down
29 changes: 0 additions & 29 deletions packages/nextjs/components/MenuItem/MenuItem.tsx

This file was deleted.

7 changes: 7 additions & 0 deletions packages/nextjs/components/SwitchTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export const SwitchTheme = ({ className }: { className?: string }) => {
<div
className={`flex space-x-2 h-5 items-center justify-center text-sm border-l border-neutral px-4 ${className}`}
>
{/* <input
id="theme-toggle"
type="checkbox"
className="toggle toggle-primary bg-primary hover:bg-primary border-primary"
onChange={handleToggle}
checked={isDarkMode}
/> */}
{
<label
htmlFor="theme-toggle"
Expand Down
Loading
Loading