remove some random comments and unneeded stuff
This commit is contained in:
@@ -39,43 +39,11 @@ export type ButtonClickEvent = ComponentEvent & {
|
|||||||
export function Button(props: ButtonProps) {
|
export function Button(props: ButtonProps) {
|
||||||
return (
|
return (
|
||||||
<ReacordElement props={props} createNode={() => new ButtonNode(props)}>
|
<ReacordElement props={props} createNode={() => new ButtonNode(props)}>
|
||||||
<ReacordElement props={{}} createNode={() => new ButtonLabelNode({})}>
|
{props.label}
|
||||||
{props.label}
|
|
||||||
</ReacordElement>
|
|
||||||
</ReacordElement>
|
</ReacordElement>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ButtonNode extends Node<ButtonProps> {
|
export class ButtonNode extends Node<ButtonProps> {
|
||||||
readonly customId = randomUUID()
|
readonly customId = randomUUID()
|
||||||
|
|
||||||
// this has text children, but buttons themselves shouldn't yield text
|
|
||||||
// eslint-disable-next-line class-methods-use-this
|
|
||||||
// override get text() {
|
|
||||||
// return ""
|
|
||||||
// }
|
|
||||||
|
|
||||||
// override modifyMessageOptions(options: MessageOptions): void {
|
|
||||||
// getNextActionRow(options).push({
|
|
||||||
// type: "button",
|
|
||||||
// customId: this.customId,
|
|
||||||
// style: this.props.style ?? "secondary",
|
|
||||||
// disabled: this.props.disabled,
|
|
||||||
// emoji: this.props.emoji,
|
|
||||||
// label: this.children.findType(ButtonLabelNode)?.text,
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
// override handleComponentInteraction(interaction: ComponentInteraction) {
|
|
||||||
// if (
|
|
||||||
// interaction.type === "button" &&
|
|
||||||
// interaction.customId === this.customId
|
|
||||||
// ) {
|
|
||||||
// this.props.onClick(interaction.event)
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ButtonLabelNode extends Node<{}> {}
|
|
||||||
|
|||||||
@@ -29,16 +29,6 @@ export function EmbedField(props: EmbedFieldProps) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export class EmbedFieldNode extends Node<EmbedFieldProps> {
|
export class EmbedFieldNode extends Node<EmbedFieldProps> {}
|
||||||
// override modifyEmbedOptions(options: EmbedOptions): void {
|
|
||||||
// options.fields ??= []
|
|
||||||
// options.fields.push({
|
|
||||||
// name: this.children.findType(FieldNameNode)?.text ?? "",
|
|
||||||
// value: this.children.findType(FieldValueNode)?.text ?? "",
|
|
||||||
// inline: this.props.inline,
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
export class EmbedFieldNameNode extends Node<{}> {}
|
export class EmbedFieldNameNode extends Node<{}> {}
|
||||||
export class EmbedFieldValueNode extends Node<{}> {}
|
export class EmbedFieldValueNode extends Node<{}> {}
|
||||||
|
|||||||
@@ -26,14 +26,4 @@ export function EmbedFooter({ text, children, ...props }: EmbedFooterProps) {
|
|||||||
|
|
||||||
export class EmbedFooterNode extends Node<
|
export class EmbedFooterNode extends Node<
|
||||||
Omit<EmbedFooterProps, "text" | "children">
|
Omit<EmbedFooterProps, "text" | "children">
|
||||||
> {
|
> {}
|
||||||
// override modifyEmbedOptions(options: EmbedOptions): void {
|
|
||||||
// options.footer = {
|
|
||||||
// text: this.children.findType(FooterTextNode)?.text ?? "",
|
|
||||||
// icon_url: this.props.iconUrl,
|
|
||||||
// }
|
|
||||||
// options.timestamp = this.props.timestamp
|
|
||||||
// ? new Date(this.props.timestamp).toISOString()
|
|
||||||
// : undefined
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -33,22 +33,4 @@ export function Embed(props: EmbedProps) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export class EmbedNode extends Node<EmbedProps> {
|
export class EmbedNode extends Node<EmbedProps> {}
|
||||||
// override modifyMessageOptions(options: MessageOptions): void {
|
|
||||||
// const embed: EmbedOptions = {
|
|
||||||
// ...snakeCaseDeep(omit(this.props, ["children", "timestamp"])),
|
|
||||||
// timestamp: this.props.timestamp
|
|
||||||
// ? new Date(this.props.timestamp).toISOString()
|
|
||||||
// : undefined,
|
|
||||||
// }
|
|
||||||
// for (const child of this.children) {
|
|
||||||
// if (child instanceof EmbedChildNode) {
|
|
||||||
// child.modifyEmbedOptions(embed)
|
|
||||||
// }
|
|
||||||
// if (child instanceof TextNode) {
|
|
||||||
// embed.description = (embed.description || "") + child.props
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// options.embeds.push(embed)
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user