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

fix: add ref to control player url #521

Open
wants to merge 51 commits into
base: canary
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9d60e26
Add NFT support to the music player (#511)
r4topunk Dec 4, 2024
db51b0d
wip: add log to user theme (#520)
r4topunk Dec 11, 2024
f02879d
fix: add ref to control player url
r4topunk Dec 11, 2024
1915288
Rename Iframe fidget to Embed and fixed a possible error on tabconfig…
sktbrd Dec 4, 2024
7f78fb9
update gateway url to public pinata gateway
willyogo Dec 9, 2024
ec9bdb0
Homepage v2.1 (#516)
willyogo Dec 10, 2024
0906d5e
Matcha without sugar (#514)
sktbrd Dec 10, 2024
67ac2f1
SpaceLoading now takes into account profile and sidebar (#515)
j-paterson Dec 10, 2024
3ebd297
Feed username fix (#513)
sktbrd Dec 10, 2024
bac2167
Hardcode white background for text fidgets on new homepage (#518)
willyogo Dec 10, 2024
43ebaad
Matcha scale (#524)
sktbrd Dec 20, 2024
58949bf
Hardcode values for homepage tabs (#527)
willyogo Dec 20, 2024
c51c960
Docs fix spelling issues (#502)
nnsW3 Dec 20, 2024
3cb44c9
fix: ensure LinksInput handles array values correctly (#534)
sktbrd Dec 20, 2024
b0a24d8
Cleanup2 (#522)
sktbrd Dec 20, 2024
220b221
Update package.json to 0.0.17 (#540)
j-paterson Dec 23, 2024
641f68d
Update app layout
Serubin Dec 29, 2024
824ec5e
move from next/router to next/navigation
Serubin Dec 29, 2024
0850193
Add 'use client' where needed
Serubin Dec 29, 2024
504c1ce
Move explore index page to app router
Serubin Dec 22, 2024
c0adedf
Improve typing
Serubin Dec 22, 2024
829a969
Add explore slug page to app router
Serubin Dec 22, 2024
665d91a
More typing improvements
Serubin Dec 22, 2024
c465b34
Fix typing
Serubin Dec 29, 2024
cf92ece
Fix supabase studio config and update readme
Serubin Dec 29, 2024
b0af9a9
Remove navigation theme print
Serubin Dec 29, 2024
d52b89d
Update yarn
Serubin Dec 29, 2024
ea51a5f
refactor: rename type to be more specific
hiporox Dec 19, 2024
5be983d
feat: add function to load contract from ethers
hiporox Dec 19, 2024
7aff380
build: install etherjs
hiporox Dec 19, 2024
73a5d15
feat: update database to add contract address to space registrations
hiporox Dec 24, 2024
73e8318
feat: add some utility functions
hiporox Dec 24, 2024
5731035
feat: update spaceStore and registry end points to support contract a…
hiporox Dec 24, 2024
11c3653
feat: add end point for base contracts
hiporox Dec 24, 2024
b4a68f0
refactor: move ownerType into ethers helper finle
hiporox Dec 24, 2024
c43c0c6
refactor + feat: add etherscan api info and reorder files to have bet…
hiporox Jan 4, 2025
ad48756
build: move nvmrc to latest node 20
hiporox Jan 4, 2025
c80d759
feat: add support for pages for contracts
hiporox Jan 4, 2025
79a0914
[wip] fix nouns proposal badge
sktbrd Dec 28, 2024
46d230e
feat: enhance proposal data structure and improve proposal handling i…
sktbrd Dec 30, 2024
2743825
Add Chat fidget component with configuration options
sktbrd Jan 3, 2025
809872c
Refactor Chat component by removing unused size property and cleaning…
sktbrd Jan 3, 2025
f21fdf9
Add keyword filtering to useGetCasts and implement useGetCastsByKeywo…
sktbrd Jan 1, 2025
25ebeff
build fix
sktbrd Jan 1, 2025
2f20720
build fix
sktbrd Jan 1, 2025
ffb5f27
Implement searchByKeyword API endpoint and refactor useGetCastsByKeyw…
sktbrd Jan 2, 2025
0c0edde
MarketData Fidget + ChainSelector and ThemeToggle inputs fix (#539)
sktbrd Jan 7, 2025
6c41db8
Add Token Page Header (#551)
sktbrd Jan 7, 2025
bebb0e5
Fix base token page editing (#556)
hiporox Jan 9, 2025
b86f3c5
Token header enhancements (#554)
sktbrd Jan 9, 2025
b21f75c
[v1] feat: Explore tokens (#552)
r4topunk Jan 9, 2025
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
8 changes: 4 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ NEXT_PUBLIC_VERCEL_ENV = development
NEXT_PUBLIC_URL = 'http://localhost:3000'
NEXT_PUBLIC_MOD_PROTOCOL_API_URL = 'https://api.modprotocol.org/api'

# The following are sensative data and should
# The following are sensitive data and should
# be stored in a .env.development.local file
# for local development, and are hosted in Vercel
# for production use cases
Expand All @@ -14,12 +14,12 @@ APP_MNENOMIC = 'candy maple cake sugar honey ... potato blue'
NEYNAR_API_KEY = ''
SUPABASE_SERVICE_KEY = ''
YOUTUBE_API_KEY = ''
# These are sepecific to the environment
# These are specific to the environment
# and so need to be configured locally
# but are not sensative data
# but are not sensitive data
NEXT_PUBLIC_APP_FID = '123'
NEXT_PUBLIC_SUPABASE_URL = ''
NEXT_PUBLIC_SUPABASE_ANON_KEY = ''
NEXT_PUBLIC_PRIVY_API_KEY = ''
NEXT_PUBLIC_ALCHEMY_API_KEY = ''
NEXT_PUBLIC_SEGMENT_WRITE_KEY = ''
NEXT_PUBLIC_SEGMENT_WRITE_KEY = ''
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.13.1
v20.18.1
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ a protocol for decentralized social apps: https://www.farcaster.xyz
a. get a Neynar API key https://docs.neynar.com/docs -> `NEYNAR_API_KEY` <br>
b. get an Alchemy API key https://www.alchemy.com -> `NEXT_PUBLIC_ALCHEMY_API_KEY` <br>
c. get your Farcaster account FID and mnemonic -> `NEXT_PUBLIC_APP_FID` + `APP_MNENOMIC`<br>
d. launch local copy of Supabase with `supabase start`, use the info provided -> <br>
d. launch local copy of Supabase with `supabase start` (in the root directory of this repo), use the info provided -> <br>
`API URL`:`NEXT_PUBLIC_SUPABASE_URL` + `anon key`:`NEXT_PUBLIC_SUPABASE_ANON_KEY`

## Contributing and making Fidgets
Expand All @@ -35,17 +35,17 @@ The Nounspace App follows the Atomic Design Pattern

`src/common/ui` contains all of the display components for all other layers of the atomic design. `src/common/ui/components` are a mixture of Molecules and Organisms that were imported from `herocast`, they still need to be split into their appropriate folders (`src/common/ui/molecules` & `src/common/ui/organisms`).

`src/common/data` contains the access to datastreams, in the form of database connections and API's
`src/common/data` contains access to datastreams, in the form of database connections and API's

`src/common/lib` contains useful functions for accessing formatted data, along with helpers functions inside the `utils` directory.

`src/styles` contains information for managing website styling

`src/constants` contains all static information that is the needed to run the app. This includes actual constants, along with some global types
`src/constants` contains all static information that is needed to run the app. This includes actual constants, along with some global types

### Refactoring

This file structure is adapted from `herocast`, and not all files have been cleaned up properly. If you find files or data that is placed in the wrong location, please refactor it. For example, there are some constants that are not placed in the `src/constants` directory, and instead are in the other files
This file structure is adapted from `herocast`, and not all files have been cleaned up properly. If you find files or data that are placed in the wrong location, please refactor it. For example, there are some constants that are not placed in the `src/constants` directory, and instead are in the other files


### DB scheme: accounts
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Nounspace",
"version": "0.0.16",
"version": "0.0.17",
"license": "",
"private": true,
"scripts": {
Expand Down Expand Up @@ -45,7 +45,6 @@
"@heroicons/react": "^2.0.18",
"@hookform/resolvers": "^3.3.4",
"@internationalized/date": "^3.5.4",
"@lifi/widget": "^3.4.4",
"@mod-protocol/core": "^0.2.1",
"@mod-protocol/mod-registry": "^0.2.2",
"@mod-protocol/react": "^0.2.0",
Expand Down Expand Up @@ -95,13 +94,15 @@
"@webscopeio/react-textarea-autocomplete": "^4.9.2",
"@xmtp/frames-validator": "^0.6.0",
"@xmtp/proto": "^3.61.1",
"alchemy-sdk": "^3.5.0",
"axios": "^1.6.7",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cmdk": "^0.2.1",
"command-score": "^0.1.2",
"encoding": "^0.1.13",
"esbuild": "^0.21.5",
"ethers": "^6.13.4",
"fast-json-stable-stringify": "^2.1.0",
"focus-trap-react": "^10.2.1",
"framer-motion": "^11.3.30",
Expand All @@ -114,6 +115,7 @@
"linkify-react": "^4.1.1",
"linkifyjs": "^4.1.3",
"lodash": "^4.17.21",
"lucide-react": "^0.469.0",
"moment": "^2.30.1",
"mutative": "^1.0.3",
"neverthrow": "^6.2.2",
Expand Down
Binary file added public/images/clanker_galaxy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions src/app/explore/ExploreCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use client";

import React from "react";
import Link from "next/link";
import Image from "next/image";
import { AnalyticsEvent } from "@/common/providers/AnalyticsProvider"; // Import analytics
import { trackAnalyticsEvent } from "@/common/lib/utils/analyticsUtils";

const ExploreCard = ({ post }) => {
return (
<Link
onClick={() => {
trackAnalyticsEvent(AnalyticsEvent.CLICK_EXPLORE_CARD, {
slug: post.slug,
});
}}
href={`/s/${post.slug}`}
className="block border border-gray-300 rounded-lg overflow-hidden bg-[#FCFFF4] hover:shadow-md transition-all duration-100 ease-out hover:-translate-y-1"
>
<div className="h-36 w-full bg-gray-200 overflow-hidden relative">
<Image
src={post.image}
alt={post.title}
fill
className="object-cover object-center"
/>
</div>
<div className="p-3">
<h2 className="text-lg font-bold">@{post.title}</h2>
</div>
</Link>
);
};

export default ExploreCard;
167 changes: 167 additions & 0 deletions src/app/explore/Tokens.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
import React from "react";
import { formatDistanceToNow } from "date-fns";
import {
ChartNoAxesColumn,
ChartNoAxesColumnDecreasing,
ChartNoAxesColumnIncreasing,
CircleDollarSign,
Clock,
Flame,
User,
} from "lucide-react";
import Image from "next/image";
import Link from "next/link";
import { Address } from "viem";

export interface Token {
name: string;
address: Address;
symbol: string;
imageUrl?: string;
deployer: {
username: string;
avatarUrl: string;
followers: number;
score: number;
};
deployedAt: string;
marketCap: number;
volumeLastHour: number;
priceChange: number;
}

export function TokensGrid({ tokens }: { tokens: Token[] }) {
return (
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-4 mt-6">
{tokens.map((token) => (
<TokenCard key={token.address} token={token} />
))}
</div>
);
}

export function TokenCard({ token }: { token: Token }) {
const timeAgo = formatDistanceToNow(new Date(token.deployedAt), {
addSuffix: true,
});

return (
<div className="ease-out flex flex-col justify-between bg-white dark:bg-gray-800 rounded-xl shadow-md dark:shadow-lg overflow-hidden hover:shadow-lg transition-shadow duration-300">
<Link
href={`/t/base/${token.address}`}
className="block"
target="_blank"
prefetch={false}
>
<div className="relative h-48">
<Image
key={token.name}
src={token?.imageUrl || token.deployer?.avatarUrl || ""}
alt={token.name}
className="w-full h-full object-cover"
width={500}
height={500}
/>
<div className="absolute top-4 right-4 bg-black/70 dark:bg-gray-700 px-3 py-1 rounded-full">
<span className="text-white dark:text-gray-200 font-medium">
{token.symbol}
</span>
</div>
</div>

<div className="p-6">
<div className="flex items-center justify-between mb-4">
<h3 className="text-xl font-bold text-gray-900 dark:text-gray-100">
{token.name}
</h3>
<div className="flex items-center space-x-1">
{token.priceChange === 0 ? (
<ChartNoAxesColumn className="w-5 h-5 text-gray-900 dark:text-gray-100" />
) : token.priceChange < 0 ? (
<ChartNoAxesColumnDecreasing className="w-5 h-5 text-red-500 dark:text-red-400" />
) : (
<ChartNoAxesColumnIncreasing className="w-5 h-5 text-green-500 dark:text-green-400" />
)}
<span className="font-semibold text-muted-foreground">
{token.priceChange.toLocaleString(undefined, {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})}
%
</span>
</div>
{/* <div className="flex items-center space-x-1"> */}
{/* <Trophy className="w-4 h-4 text-yellow-500 dark:text-yellow-400" />
<span className="font-semibold text-gray-900 dark:text-gray-100">
{token.deployer.score}
</span> */}
{/* </div> */}
</div>
</div>
</Link>

<div className="px-6 pb-6">
{token.deployer.username == "Unknown" ? (
<p className="text-sm font-medium text-gray-900 dark:text-gray-100">
Anon deployer
</p>
) : (
<div className="flex justify-between items-center mb-4">
<div className="flex items-center hover:opacity-80 cursor-pointer">
<Image
src={token.deployer?.avatarUrl || ""}
alt={token.deployer.username}
className="w-8 h-8 rounded-full mr-2 object-cover bg-gray-400"
width={32}
height={32}
/>
<div>
<p className="text-sm font-medium text-gray-900 dark:text-gray-100">
@{token.deployer.username}
</p>
<p className="text-xs text-muted-foreground">
{token.deployer.followers.toLocaleString()} followers
</p>
</div>
</div>
<div className="flex items-center space-x-1">
<User className="w-4 h-4 text-muted-foreground" />
<span className="text-muted-foreground">
{token.deployer.score}
</span>
</div>
</div>
)}

<div className="flex items-end justify-between text-sm text-muted-foreground">
<div className="flex items-center">
<Clock className="w-4 h-4 mr-1 text-muted-foreground" />
<span>{timeAgo}</span>
</div>
<div className="flex flex-col items-end">
<div className="flex items-center">
<Flame className="w-4 h-4 mr-1 text-muted-foreground" />
<span>
$
{token.volumeLastHour.toLocaleString(undefined, {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})}
</span>
</div>
<div className="flex items-center">
<CircleDollarSign className="w-4 h-4 mr-1 text-muted-foreground" />
<span>
$
{token.marketCap.toLocaleString(undefined, {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})}
</span>
</div>
</div>
</div>
</div>
</div>
);
}
43 changes: 13 additions & 30 deletions src/pages/explore/[slug].tsx → src/app/explore/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
getAllSlugs,
getMarkdownFileBySlug,
} from "@/common/data/explore/loadExploreMarkdown";
import { GetStaticProps, InferGetStaticPropsType } from "next/types";
import { isNull, isObject, isUndefined, map } from "lodash";
import Image from "next/image";

Expand Down Expand Up @@ -33,47 +32,31 @@ function isExplorePost(maybe: unknown): maybe is ExplorePost {
);
}

export async function getStaticPaths() {
export async function generateStaticParams() {
const slugs = await getAllSlugs();
return {
paths: map(slugs, (s) => ({
params: {
slug: s,
},
})),
fallback: false,
};
return map(slugs, (s) => ({ slug: s }));
}

export const getStaticProps = (async ({ params }) => {
const post = await getMarkdownFileBySlug(params!.slug as string);
const getPostOrSlug = async (
slug: string,
): Promise<ExplorePost | SlugOnlyPost> => {
const post = await getMarkdownFileBySlug(slug);
if (isNull(post)) {
return {
props: {
post: {
slug: params!.slug as string,
},
},
slug,
};
}

const processedContent = await remark().use(html).process(post.content);
const contentHtml = processedContent.toString();

return {
props: {
post: {
...post,
contentHtml,
},
},
...post,
contentHtml,
};
}) satisfies GetStaticProps<{
post: ExplorePost | SlugOnlyPost;
}>;
};

export default function Post({
post,
}: InferGetStaticPropsType<typeof getStaticProps>) {
export default async function Post({ params }) {
const post = await getPostOrSlug(params!.slug as string);
if (isExplorePost(post)) {
return (
<div>
Expand Down
Loading