diff --git a/build.mjs b/build.mjs index 6a18b53..779904a 100644 --- a/build.mjs +++ b/build.mjs @@ -23,7 +23,7 @@ await build({ target: "esnext", logLevel: "info", outfile: "dist/index.js", - minify: true, + minify: !process.argv.includes("start"), treeShaking: true, // shake it off shake it offff jsx: "transform", inject: ["components-jsx/runtime.ts"], diff --git a/components-jsx/Container.tsx b/components-jsx/Container.tsx index 913757d..8cf180a 100644 --- a/components-jsx/Container.tsx +++ b/components-jsx/Container.tsx @@ -2,12 +2,17 @@ import { ComponentTypes, ContainerComponent } from "oceanic.js"; import { childrenToArray } from "./utils"; -export type ContainerProps = Omit & { children: ContainerComponent["components"]; }; +export type ContainerProps = Omit & { + children: ContainerComponent["components"]; +}; -export function Container({ children, ...props }: ContainerProps): ContainerComponent { - return { - type: ComponentTypes.CONTAINER, - components: childrenToArray(children), - ...props - }; +export function Container({ + children, + ...props +}: ContainerProps): ContainerComponent { + return { + type: ComponentTypes.CONTAINER, + components: childrenToArray(children), + ...props + }; } diff --git a/src/components/User.tsx b/src/components/User.tsx index 5fbbe04..98ccf1d 100644 --- a/src/components/User.tsx +++ b/src/components/User.tsx @@ -3,10 +3,10 @@ import { client } from ".."; import { Thumbnail } from "components-jsx/Thumbnail"; import { TextDisplay } from "components-jsx/TextDisplay"; import { br } from "components-jsx/br"; +import { User as DiscordUser } from "oceanic.js"; -export async function User(props: { id: string }) { - const user = await client.rest.users.get(props.id); - +export function User(props: { user: DiscordUser }) { + const { user } = props; return (
@@ -68,7 +71,7 @@ export async function setupJoinRequestHandler(shard: Shard) { ## Join request withdrawn - + ### Application {application ? (