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

Adding gallery #27

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1984683
build(deps): bump wagmi from 2.5.11 to 2.7.0
dependabot[bot] May 1, 2024
460a6ec
Bump @next/eslint-plugin-next from 13.5.6 to 14.2.3
dependabot[bot] May 1, 2024
0c080ab
Bump @noble/ed25519 from 2.0.0 to 2.1.0
dependabot[bot] May 1, 2024
d8b1636
refactor: move signerRequests to app
hiporox May 1, 2024
8fea5ec
refactor: app/frames/route.tsx -> .ts
hiporox May 1, 2024
66f9fa6
refactor: port the rest of pages/api to app
hiporox May 1, 2024
250d461
refactor: move supabase info to common/data/database
hiporox May 1, 2024
a0813d1
refactor: change all references to herocast over to Nounspace
hiporox May 1, 2024
0d7e90a
Merge pull request #22 from Nounspace/hy_remove_herocast
hiporox May 1, 2024
dada96b
Merge pull request #21 from Nounspace/dependabot/npm_and_yarn/wagmi-2…
hiporox May 1, 2024
baeb61e
Merge pull request #14 from Nounspace/dependabot/npm_and_yarn/next/es…
hiporox May 1, 2024
3e8f2ac
fix: change export to not default
hiporox May 1, 2024
d15d7cb
Merge remote-tracking branch 'origin/main'
hiporox May 1, 2024
326ab3d
build: add check-types to package.json
hiporox May 1, 2024
803ab3a
build: force type checking on build
hiporox May 1, 2024
5199495
build: add type check to github action for build
hiporox May 1, 2024
eea8b07
Merge pull request #11 from Nounspace/dependabot/npm_and_yarn/noble/e…
hiporox May 1, 2024
a0e4b21
fix: wagmi update no longer breaks localhost
hiporox May 3, 2024
26b007e
Merge branch 'main' into SpaceLayout
hiporox May 3, 2024
cddca40
fix: merge conflict adding herocast text back in
hiporox May 3, 2024
3bf2d8a
Merge pull request #24 from Nounspace/SpaceLayout
j-paterson May 3, 2024
4ceb924
Update README.md
j-paterson May 3, 2024
69d59d2
Merge pull request #26 from Nounspace/j-paterson-patch-2
j-paterson May 3, 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
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
NEXT_PUBLIC_MOD_PROTOCOL_API_URL = 'https://api.modprotocol.org/api'
NEXT_PUBLIC_MOD_PROTOCOL_API_URL = 'https://api.modprotocol.org/api'
NEXT_PUBLIC_APP_NAME = "Nounspace"
NEXT_PUBLIC_WALLET_CONNECT_ID = "ca568706fd42f2029d21f486df16364f"
62 changes: 8 additions & 54 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Setup Rust cache
uses: actions/cache@v3
with:
key: ${{ matrix.os }}-${{ hashFiles('src-tauri/Cargo.lock') }}
path: |
~/.cargo

- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -39,51 +32,12 @@ jobs:
cache-dependency-path: |
yarn.lock

# - name: 🦀 Install Rust
# uses: actions-rs/toolchain@v1
# with: { toolchain: stable }

# - name: Install webkit2gtk (ubuntu only)
# if: matrix.os == 'ubuntu-latest'
# run: |
# sudo apt-get update
# sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
# - name: Install Node.js dependencies
# run: yarn install
# - name: Test build
# uses: tauri-apps/tauri-action@v0
# if: (!startsWith(github.ref, 'refs/tags/v'))
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
# - name: Build the app
# if: startsWith(github.ref, 'refs/tags/v')
# uses: tauri-apps/tauri-action@v0
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
# # ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
# # APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
# # APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
# # APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
# # APPLE_ID: ${{ secrets.APPLE_ID }}
# # APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
# with:
# tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
# releaseName: 'herocast v__VERSION__'
# prerelease: false
- name: Run Type Check
uses: borales/actions-yarn@v4
with:
cmd: tsc

# - name: Upload release artifacts
# if: startsWith(github.ref, 'refs/tags/v')
# uses: actions/upload-artifact@v3
# with:
# name: release-${{ matrix.os }}
# path: |
# src-tauri/target/release/**/*
# - name: Sentry Release
# if: github.ref == 'refs/heads/main'
# uses: getsentry/[email protected]
# env:
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
# SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: Build
uses: borales/actions-yarn@v4
with:
cmd: build
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

Forked from [herocast](https://github.com/hellno/herocast/)

# Docs
https://docs.nounspace.com/nounspace-alpha/

## What is Farcaster?
a protocol for decentralized social apps: https://www.farcaster.xyz

Expand Down
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="index.html NAME" content="index.html CONTENT" />
<meta name="description" content="herocast">
<meta property="og:site_name" content="herocast">
<meta property="og:title" content="herocast">
<meta name="description" content="Nounspace">
<meta property="og:site_name" content="Nounspace">
<meta property="og:title" content="Nounspace">
<meta property="og:type" content="website">
<meta property="og:description" content="herocast">
<meta property="og:description" content="Nounspace">
<meta property="og:image" content="/images/nounspace_og.png">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="737">
<meta property="og:url" content="https://app.herocast.xyz">
<meta property="og:url" content="https://app.nounspace.com">
<meta property="twitter:card" content="summary_large_image">
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png">
<link rel="icon" type="image/x-icon" href="/images/favicon.ico">
<title>herocast</title>
<title>Nounspace</title>
</head>

<body>
Expand Down
6 changes: 1 addition & 5 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ const nextConfig = {
// distDir: './dist', // Changes the build output directory to `./dist/`.
transpilePackages: ['react-tweet'], // https://react-tweet.vercel.app/next,
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
ignoreBuildErrors: false,
},
images: {
remotePatterns: [
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "herocast",
"name": "Nounspace",
"version": "0.1",
"license": "",
"private": true,
Expand All @@ -9,7 +9,8 @@
"start": "next start",
"serve": "serve -s build",
"lint": "next lint",
"lint:fix": "eslint --fix --ext .js,.jsx,.ts,.tsx src"
"lint:fix": "eslint --fix --ext .js,.jsx,.ts,.tsx src",
"check-types": "tsc"
},
"browserslist": {
"production": [
Expand Down Expand Up @@ -39,7 +40,7 @@
"@mod-protocol/react-editor": "^0.1.0",
"@mod-protocol/react-ui-shadcn": "^0.3.1",
"@neynar/nodejs-sdk": "^1.9.6",
"@noble/ed25519": "^2.0.0",
"@noble/ed25519": "^2.1.0",
"@radix-ui/colors": "^3.0.0",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-aspect-ratio": "^1.0.3",
Expand Down Expand Up @@ -108,13 +109,13 @@
"ts-key-enum": "^2.0.12",
"typescript": "^5.1.6",
"viem": "2.x",
"wagmi": "^2.5.11",
"wagmi": "^2.7.0",
"zod": "^3.22.4",
"zustand": "^4.5.2"
},
"devDependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@next/eslint-plugin-next": "^13.5.5",
"@next/eslint-plugin-next": "^14.2.3",
"@types/node": "^18.7.15",
"@types/ramda": "^0.29.11",
"@types/react": "^18.2.79",
Expand Down
4 changes: 2 additions & 2 deletions splashscreen.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
<title>herocast</title>
<title>Nounspace</title>
</head>

<body>
<div class="select-none cursor-progress min-h-screen bg-background mx-auto max-w-7xl px-6 pt-10">
<div class="mx-auto max-w-2xl flex-shrink-0 lg:mx-0 lg:max-w-xl lg:pt-8">
<h1 class="hoveranimate-pulse mt-6 text-6xl font-bold tracking-tight text-foreground">
herocast
Nounspace
</h1>
<p class="text-lg leading-8 text-gray-200">loading the fastest farcaster client for you</p>
<div class="mt-6 inline-flex space-x-6 cursor-not-allowed">
Expand Down
33 changes: 33 additions & 0 deletions src/app/api/auth/confirm/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { type EmailOtpType } from '@supabase/supabase-js'

import createClient from '@/common/data/database/supabase/clients/api'
import { NextRequest, NextResponse } from 'next/server';
import { get } from 'lodash';

function stringOrFirstString(item: string | string[] | undefined) {
return Array.isArray(item) ? item[0] : item
}

export async function POST(req: NextRequest) {
const queryParams = req.nextUrl.searchParams;
const token_hash = stringOrFirstString(get(queryParams, "token_hash", ""));
const type = stringOrFirstString(get(queryParams, "type", ""));

const resp = NextResponse.redirect("/error");

if (token_hash && type) {
const supabase = createClient(req, resp)
const { error } = await supabase.auth.verifyOtp({
type: type as EmailOtpType,
token_hash,
})
if (error) {
console.error(error)
} else {
// When no error, change redirect to the "next" query param or to root
resp.headers.set("Location", stringOrFirstString(get(queryParams, "next")) || '/');
}
}

return resp;
}
15 changes: 15 additions & 0 deletions src/app/api/signerRequests/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { createSignerRequest, getSignerRequestStatus } from '@/common/data/api/warpcastLogin';
import { get } from 'lodash';
import { NextRequest, NextResponse } from 'next/server';

export async function POST(req: NextRequest) {
const body = await req.json();
const signerRequestResult = await createSignerRequest(body);
return NextResponse.json(signerRequestResult);
}

export async function GET(req: NextRequest) {
const signerToken = get(req.nextUrl.searchParams, "signerToken", "") as string;
const signerStatus = await getSignerRequestStatus(signerToken)
return NextResponse.json(signerStatus);
}
File renamed without changes.
24 changes: 0 additions & 24 deletions src/common/data/api/supabase/api.ts

This file was deleted.

24 changes: 24 additions & 0 deletions src/common/data/database/supabase/clients/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { createServerClient } from '@supabase/ssr'
import { type NextRequest, type NextResponse } from 'next/server'

export default function createClient(req: NextRequest, res: NextResponse) {
const supabase = createServerClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
cookies: {
get(name: string) {
return req.cookies.get(name)?.value;
},
set(name: string, value: string) {
res.cookies.set(name, value);
},
remove(name: string) {
res.cookies.delete(name);
},
},
}
)

return supabase
}
6 changes: 3 additions & 3 deletions src/common/data/stores/useAccountStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { isEmpty, findIndex, sortBy, cloneDeep, includes, uniqBy } from "lodash"
import { UUID } from "crypto";
import { NeynarAPIClient } from "@neynar/nodejs-sdk";
import { User } from "@neynar/nodejs-sdk/build/neynar-api/v2";
import { createClient } from "@/common/data/api/supabase/component";
import { createClient } from "@/common/data/database/supabase/clients/component";
import { v4 as uuidv4 } from 'uuid';
import { getUsernameForFid } from "@/common/lib/utils/farcaster";
import { APP_FID } from "@/constants/app";
Expand All @@ -33,7 +33,7 @@ const CUSTOM_CHANNEL_COUNT = 2;
export const DEFAULT_CHANNEL_URL = CUSTOM_CHANNELS.FOLLOWING;
const DEFAULT_LOCAL_ACCOUNT_CHANNELS = [
"Farcaster",
"herocast",
"nounspace",
"Base",
"Founders",
"Product",
Expand Down Expand Up @@ -306,7 +306,7 @@ const store = (set: StoreSet) => ({
name,
url,
icon_url: iconUrl,
source: `${account} via herocast`,
source: `${account} via Nounspace`,
})
.select()
.then(({ error, data }) => {
Expand Down
Empty file.
18 changes: 9 additions & 9 deletions src/common/data/stores/useNewPostStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ export const NewPostDraft: DraftType = {


const NewFeedbackPostDraft: DraftType = {
text: "hey @hellno, feedback on @herocast: ",
parentUrl: "https://herocast.xyz",
text: "hey @nounspace, feedback on /nounspace: ",
parentUrl: "https://nounspace.com",
status: DraftStatus.writing,
mentionsToFids: { 'herocast': '18665', 'hellno': '13596' }
mentionsToFids: { 'nounspace': '456830' }
};

export const JoinedHerocastPostDraft: DraftType = {
text: "I just joined @herocast! ",
export const JoinedNounspacePostDraft: DraftType = {
text: "I just joined @nounspace! ",
status: DraftStatus.writing,
mentionsToFids: { 'herocast': '18665' }
mentionsToFids: { 'nounspace': '456830' }
}

export const JoinedHerocastViaHatsProtocolDraft: DraftType = {
text: "I just joined @herocast via @hatsprotocol",
export const JoinedNounspaceViaHatsProtocolDraft: DraftType = {
text: "I just joined @nounspace via @hatsprotocol",
status: DraftStatus.writing,
mentionsToFids: { 'herocast': '18665', 'hatsprotocol': '18484' }
mentionsToFids: { 'nounspace': '456830', 'hatsprotocol': '18484' }
}

type addNewPostDraftProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const RenameAccountForm = ({
if (!(await validateConnectedWalletOwnsFid())) return;
setIsPending(true);

console.log("herocast account", account);
console.log("Nounspace account", account);
console.log("userInProtocol", userInProtocol);
let timestamp = getTimestamp();

Expand Down
2 changes: 1 addition & 1 deletion src/common/ui/components/AlertDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const AlertDialogDemo = ({ buttonText, onClick }: AlertDialogProps) => (
Are you absolutely sure?
</AlertDialog.Title>
<AlertDialog.Description className="text-radix-mauve1 mt-4 mb-5 text-[15px] leading-normal">
This action cannot be undone. <br />This will remove your account from herocast. <br />You will have to reconnect your account to use herocast again.
This action cannot be undone. <br />This will remove your account from Nounspace. <br />You will have to reconnect your account to use Nounspace again.
</AlertDialog.Description>
<div className="flex justify-end gap-[25px]">
<AlertDialog.Cancel asChild>
Expand Down
2 changes: 1 addition & 1 deletion src/common/ui/components/CommandPalette/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default function CommandPalette() {
/>
<Combobox.Input
className="h-12 w-full border-0 bg-transparent pl-11 pr-4 text-foreground focus:outline-none focus:ring focus:border-gray-500 sm:text-sm"
placeholder="Search Herocast..."
placeholder="Search Nounspace..."
onChange={(event) => setQuery(event.target.value)}
/>
</div>
Expand Down
Loading