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

chore: update config #1

Merged
merged 11 commits into from
Oct 14, 2024
2 changes: 0 additions & 2 deletions .env.local.default
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ NEXT_PUBLIC_CDP_API_KEY="CDP_API_KEY_1234567890"

# ~~~
NEXT_PUBLIC_ENVIRONMENT=localhost


2 changes: 1 addition & 1 deletion .env.local.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
COINBASE_COMMERCE_API_KEY="GET_FROM_COINBASE_COMMERCE_PLATFORM"
# ~~~
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=

Expand All @@ -7,4 +8,3 @@ NEXT_PUBLIC_CDP_API_KEY="GET_FROM_COINBASE_DEVELOPER_PLATFORM"
# ~~~
NEXT_PUBLIC_ENVIRONMENT=localhost


2 changes: 0 additions & 2 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ NEXT_PUBLIC_CDP_API_KEY="CDP_API_KEY_1234567890"

# ~~~
NEXT_PUBLIC_ENVIRONMENT=localhost


4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

An Onchain Commerce Template build with [OnchainKit](https://onchainkit.xyz), and ready to be deployed to Vercel.

Play with it live on https://onchain-commerce-template.vercel.app

Have fun! ⛵️

<br />
Expand All @@ -34,6 +32,8 @@ COINBASE_COMMERCE_API_KEY="GET_FROM_COINBASE_COMMERCE"

## Locally run



```sh
# Install bun in case you don't have it
bun curl -fsSL <https://bun.sh/install> | bash
Expand Down
16 changes: 13 additions & 3 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
import { useState } from 'react';
import { useCallback, useState } from 'react';
import {
GITHUB_LINK,
ONCHAINKIT_LINK,
TEMPLATE_LINK,
TWITTER_LINK,
} from 'src/links';
import { ExternalLinkSvg } from 'src/svg/ExternalLinkSvg';
import { MenuSvg } from 'src/svg/MenuSvg';
import OnchainKitShopSvg from 'src/svg/OnchainKitShopSvg';
import type { NavbarLinkReact } from 'src/types';

function NavbarLink({ link, label }: NavbarLinkReact) {
return (
<li>
<li className="flex cursor-pointer items-center gap-2">
<a
href={link}
className="flex items-center text-gray-600 text-xs hover:text-gray-900"
>
{label}
</a>
<ExternalLinkSvg />
</li>
);
}

export default function Navbar() {
const [isMenuOpen, _] = useState(false);
const [isMenuOpen, setIsMenuOpen] = useState(false);

const toggleMenu = useCallback(() => {
setIsMenuOpen((prev) => !prev);
}, []);

return (
<header className="-mx-[50vw] fixed top-0 right-1/2 left-1/2 w-screen border-gray-200 border-b bg-white">
Expand All @@ -42,6 +49,9 @@ export default function Navbar() {
<NavbarLink link={TWITTER_LINK} label="X" />
</ul>
</nav>
<button type="button" className="md:hidden" onClick={toggleMenu}>
<MenuSvg />
</button>
</div>
</div>
{isMenuOpen && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/OnchainStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function OnchainStore() {
<div className="flex h-full max-h-screen max-w-full flex-col px-1">
<Navbar />
<main className="mx-auto flex max-w-7xl grow flex-col py-10">
<div className="flex grow flex-col md:flex-row">
<div className="flex grow flex-col pb-10 md:flex-row">
<OnchainStoreSummary />
<OnchainStoreItems />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/OnchainStoreItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function OnchainStoreItems() {
const { products } = useOnchainStoreContext();

return (
<div className="scroll mb-8 p-8 md:mb-0">
<div className="scroll mb-16 p-8 md:mb-0">
<div className="grid grid-cols-1 gap-8 sm:grid-cols-2">
{products?.map((item) => (
<OnchainStoreItem {...item} key={item.id} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/OnchainStoreSummary.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function OnchainStoreSummary() {
return (
<div className="mb-8 flex flex-col justify-center border-gray-200 border-r p-8 md:mb-0 md:w-1/3">
<div className="mb-8 flex flex-col justify-center border-gray-200 border-r p-8 md:mb-0 md:w-1/3 lg:border-r">
<div className="space-y-4 text-left">
<h2
className="font-bold text-3xl leading-tight"
Expand Down
14 changes: 14 additions & 0 deletions src/svg/ExternalLinkSvg.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export function ExternalLinkSvg() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
className="pb-1 md:pb-0"
>
<title>ExternalLinkSvg</title>
<path d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z" />
</svg>
);
}
13 changes: 13 additions & 0 deletions src/svg/MenuSvg.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export function MenuSvg() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
>
<title>MenuSvg</title>
<path d="M24 6h-24v-4h24v4zm0 4h-24v4h24v-4zm0 8h-24v4h24v-4z" />
</svg>
);
}