Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/token-vendor' into nadai/token-v…
Browse files Browse the repository at this point in the history
…endor-update
  • Loading branch information
Nadai2010 committed Aug 10, 2024
2 parents 69d11d0 + 7b1ec65 commit c247176
Show file tree
Hide file tree
Showing 39 changed files with 518 additions and 207 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and Deploy to Droplet

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Build and deploy app on server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DROPLET_IP }}
username: ${{ secrets.DROPLET_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /var/www/speedrunstark
git pull origin main
pm2 stop speedrunstark
yarn install
cd packages/nextjs
yarn build
pm2 restart speedrunstark
pm2 save
Empty file removed .gitmodules
Empty file.
2 changes: 1 addition & 1 deletion .yarn/plugins/@yarnpkg/plugin-typescript.cjs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
compressionLevel: mixed

enableColors: true

enableGlobalCache: false

nmHoistingLimits: workspaces

nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"

yarnPath: .yarn/releases/yarn-3.2.3.cjs
302 changes: 200 additions & 102 deletions README.md

Large diffs are not rendered by default.

Binary file removed assests/debug-contracts.png
Binary file not shown.
1 change: 1 addition & 0 deletions packages/nextjs/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_PROVIDER_URL=https://starknet-sepolia.infura.io/v3/47279f22f9954d6facd977b57c932b6a
36 changes: 0 additions & 36 deletions packages/nextjs/README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { Abi } from "abi-wan-kanabi";
import {
AbiFunction,
Contract,
ContractName,
GenericContract,
InheritedFunctions,
getFunctionsByStateMutability,
} from "~~/utils/scaffold-stark/contract";
import { ReadOnlyFunctionForm } from "./ReadOnlyFunctionForm";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ export const ContractUI = ({
</div>
</div>
);
};
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { Abi } from "abi-wan-kanabi";
import {
AbiFunction,
Contract,
ContractName,
GenericContract,
InheritedFunctions,
getFunctionsByStateMutability,
} from "~~/utils/scaffold-stark/contract";
import { DisplayVariable } from "./DisplayVariable";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
"use client";

import { useEffect, useState } from "react";
// import { Abi, AbiFunction } from "abitype";
// import { Address, TransactionReceipt } from "viem";
// import { useContractWrite, useNetwork, useWaitForTransaction } from "wagmi";
import {
ContractInput,
// TxReceipt,
getFunctionInputKey,
getInitialFormState,
getParsedContractFunctionArgs,
Expand All @@ -31,16 +27,14 @@ type WriteOnlyFunctionFormProps = {
abiFunction: AbiFunction;
onChange: () => void;
contractAddress: Address;
// inheritedFrom?: string;
};

export const WriteOnlyFunctionForm = ({
abi,
abiFunction,
onChange,
contractAddress,
}: // inheritedFrom,
WriteOnlyFunctionFormProps) => {
}: WriteOnlyFunctionFormProps) => {
const [form, setForm] = useState<Record<string, any>>(() =>
getInitialFormState(abiFunction),
);
Expand Down Expand Up @@ -135,7 +129,6 @@ WriteOnlyFunctionFormProps) => {
>
<p className="font-medium my-0 break-words text-function">
{abiFunction.name}
{/* <InheritanceTooltip inheritedFrom={undefined} /> */}
</p>
{inputs}
<div className="flex justify-between gap-2">
Expand Down Expand Up @@ -167,7 +160,7 @@ WriteOnlyFunctionFormProps) => {
</div>
</div>
{zeroInputs && txResult ? (
<div className="flex-grow basis-0">
<div className="flex-grow basis-0 ">
<TxReceipt txResult={txResult} />
</div>
) : null}
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/app/token-vendor/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ const TokenVendor: NextPage = () => {
);
};

export default TokenVendor;
export default TokenVendor;
2 changes: 1 addition & 1 deletion packages/nextjs/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ export const Footer = () => {
</div>
</div>
);
};
};
16 changes: 8 additions & 8 deletions packages/nextjs/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import Link from "next/link";
import { usePathname } from "next/navigation";
import {
Bars3Icon,
BoltIcon,
BugAntIcon,
CircleStackIcon,
BoltIcon,
} from "@heroicons/react/24/outline";
import { useOutsideClick } from "~~/hooks/scaffold-stark";
import { CustomConnectButton } from "~~/components/scaffold-stark/CustomConnectButton";
Expand All @@ -18,7 +18,7 @@ import { devnet } from "@starknet-react/chains";
import { SwitchTheme } from "./SwitchTheme";
import { useAccount, useProvider } from "@starknet-react/core";

type HeaderMenuLink = {
export type HeaderMenuLink = {
label: string;
href: string;
icon?: React.ReactNode;
Expand Down Expand Up @@ -85,13 +85,14 @@ 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 All @@ -112,9 +113,8 @@ export const Header = () => {
<div className="lg:hidden dropdown" ref={burgerMenuRef}>
<label
tabIndex={0}
className={`ml-1 btn btn-ghost ${
isDrawerOpen ? "hover:bg-secondary" : "hover:bg-transparent"
}`}
className={`ml-1 btn btn-ghost ${isDrawerOpen ? "hover:bg-secondary" : "hover:bg-transparent"
}`}
onClick={() => {
setIsDrawerOpen((prevIsOpenState) => !prevIsOpenState);
}}
Expand Down Expand Up @@ -143,7 +143,7 @@ export const Header = () => {
alt="SE2 logo"
className="cursor-pointer"
fill
src="/logo.svg"
src="/challenge-icon-starknet.svg"
/>
</div>
<div className="flex flex-col">
Expand Down Expand Up @@ -171,4 +171,4 @@ export const Header = () => {
</div>
</div>
);
};
};
24 changes: 24 additions & 0 deletions packages/nextjs/components/HeaderLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import SpeedStarknetIcon from "~~/components/icons/SpeedStarknetIcon";

const HeaderLogo = () => {
return (
<svg
width="180"
height="62"
viewBox="0 0 755 154"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<SpeedStarknetIcon />
<image
id="image0_249_271"
width="100"
height="140"
xlinkHref="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEwAAABoCAYAAABbqhYLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAVDSURBVHgB7Z1NbBtFFMf/69pJIA7xoV8IETvnEikSFT0FOb2hVsI3LlVp7g1SJE5ElBS4t1WRWiGkWkEIIQ64RrQcgLjqAQ4gRajhgJC8AVJVQlSbxIZEcrKdafwxu7V3/brr7m79flLivPFOvPrb7+2bmedZDU+AZDK3AJjvUfpUKtc1hJAYGBIsGBEWjEgcPpBMvr6kach0et40zRSInPvI/E21P7/89uC9u3/49gabJnQRJ6dBxBfBpFjiBDLwl7RqxAYGh8Rr+CnYY8EuSYQFI6KNjOTOiBjzZqvJvFWpFBecOsmYZWvKgsayeOm5hnH4hfHRqddmvlAPuPPL9wnVXiuvxDaMf+Ajxt55tDBNba5aLSw7dYrXY0+20aBpMR3uZOENo1IplBrGG7Nmeh+wox7w5SfvDqK3yAtRVm0Qsdj14sQuSYQFIyLTipL4MDYbTHM3tTf2c8L5mqxpWl64+mrn56Gr9o8/fAZtR0uAwMmTxzAxMQ4vLC5+d2lt7V+jYddq1vNqxyMD3McZKLf5t9NqjHJjaCiXicfNMghcufIWTp06Do+MizdXp3RglyTCgh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xDEsPkPYaq1eveNsfvArnVgK2JY1ivYcGIBBLD5K0kEgnLl576Y3eSqMG7OwUAC0akrxZy7ePT+fn8pEhxMg07HseyYRQc42lktsPyA/fFYffbC7FLEmHBiLBgRB4AP47oKIsr3jYAAAAASUVORK5CYII="
transform="translate(580, 0)"
/>
</svg>
);
};

export default HeaderLogo;
29 changes: 29 additions & 0 deletions packages/nextjs/components/MenuItem/MenuItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Link from "next/link";
import React from "react";
import { HeaderMenuLink } from "~~/components/Header";

interface MenuItemProps {
link: HeaderMenuLink;
isActive: boolean;
}

const MenuItem: React.FC<MenuItemProps> = ({ link, isActive }) => {
return (
<li key={link.href}>
<Link
href={link.href}
passHref
className={`${
isActive
? "!bg-base-300 !text-base-100 active:bg-base-300 shadow-md text-base-100"
: ""
} hover:bg-base-300 hover:text-base-100`}
>
{link.icon}
<span>{link.label}</span>
</Link>
</li>
);
};

export default MenuItem;
2 changes: 1 addition & 1 deletion packages/nextjs/components/SwitchTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ export const SwitchTheme = ({ className }: { className?: string }) => {
}
</div>
);
};
};
18 changes: 0 additions & 18 deletions packages/nextjs/components/assets/BuidlGuidlLogo.tsx

This file was deleted.

Loading

0 comments on commit c247176

Please sign in to comment.