Skip to content

Commit 4d07f26

Browse files
committed
chore: cleanup
1 parent c2284dd commit 4d07f26

File tree

3 files changed

+15
-28
lines changed

3 files changed

+15
-28
lines changed

examples/nextjs-shadcn/src/app/actions.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ import { Embed, ModManifest, handleOpenFile } from "@mod-protocol/core";
22
import { actionMods, actionModsExperimental } from "@mod-protocol/mod-registry";
33
import { ActionMod } from "@mod-protocol/react";
44
import { ModsSearch } from "@mod-protocol/react-ui-shadcn/dist/components/creation-mods-search";
5+
import { Button } from "@mod-protocol/react-ui-shadcn/dist/components/ui/button";
56
import {
67
Popover,
78
PopoverContent,
89
PopoverTrigger,
910
} from "@mod-protocol/react-ui-shadcn/dist/components/ui/popover";
1011
import { renderers } from "@mod-protocol/react-ui-shadcn/dist/renderers";
12+
import { KebabHorizontalIcon } from "@primer/octicons-react";
1113
import React, { useMemo } from "react";
1214
import { getAddress } from "viem";
1315
import { useAccount } from "wagmi";
1416
import { API_URL } from "./constants";
1517
import { useExperimentalMods } from "./use-experimental-mods";
1618
import { sendEthTransaction } from "./utils";
17-
import { KebabHorizontalIcon } from "@primer/octicons-react";
18-
import { Button } from "@mod-protocol/react-ui-shadcn/dist/components/ui/button";
1919

2020
export function Actions({
2121
author,
@@ -62,7 +62,6 @@ export function Actions({
6262
mods={experimentalMods ? actionModsExperimental : actionMods}
6363
onSelect={setCurrentMod}
6464
>
65-
{/* TODO: Find a better way to do this */}
6665
<Button variant="ghost" role="combobox" type="button">
6766
<KebabHorizontalIcon></KebabHorizontalIcon>
6867
</Button>
@@ -79,9 +78,6 @@ export function Actions({
7978
renderers={renderers}
8079
onOpenFileAction={handleOpenFile}
8180
onExitAction={() => setCurrentMod(null)}
82-
// onSetInputAction={handleSetInput(setText)}
83-
// onAddEmbedAction={handleAddEmbed(addEmbed)}
84-
// onEthPersonalSignAction={getAuthSig}
8581
onSendEthTransactionAction={onSendEthTransactionAction}
8682
author={author}
8783
post={post}

examples/nextjs-shadcn/src/app/cast.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ export function Cast(props: {
140140
<span>· {publishedAt}</span>
141141
</div>
142142
<div className="ml-auto">
143-
{/* <button className="text-slate-500">
144-
<KebabHorizontalIcon />
145-
</button> */}
146143
<Actions
147144
post={{
148145
id: props.cast.hash,

packages/core/src/renderer.ts

+13-19
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,17 @@ export type ModElementRef<T> =
158158
};
159159
};
160160

161-
export type BaseContext = {
162-
user?: {
163-
wallet?: {
164-
address?: string;
165-
};
166-
farcaster?: {
167-
fid?: string;
168-
};
161+
export type UserData = {
162+
wallet?: {
163+
address?: string;
169164
};
165+
farcaster?: {
166+
fid?: string;
167+
};
168+
};
169+
170+
export type BaseContext = {
171+
user?: UserData;
170172
/** The url of the api hosting the mod backends. (including /api) **/
171173
api: string;
172174
};
@@ -182,16 +184,8 @@ export type RichEmbedContext = BaseContext & {
182184
};
183185

184186
export type ActionContext = BaseContext & {
185-
user: {
186-
wallet?: {
187-
address?: string;
188-
};
189-
};
190-
author: {
191-
farcaster?: {
192-
fid?: string;
193-
};
194-
};
187+
user: UserData;
188+
author: Omit<UserData, "wallet">;
195189
post: {
196190
text: string;
197191
embeds: Embed[];
@@ -449,7 +443,7 @@ export type RendererOptions = {
449443
onEthPersonalSignAction: EthPersonalSignActionResolver;
450444
onSendEthTransactionAction: SendEthTransactionActionResolver;
451445
onExitAction: ExitActionResolver;
452-
} & (
446+
} & ( // TODO: Variant-specific actions
453447
| {
454448
variant: "creation";
455449
context: CreationContext;

0 commit comments

Comments
 (0)