{error.message}
13 | {props.text}
37 |
31 | The React Spacebar client is no longer actively maintained. Because of growing issues, the client has been
32 | taken offline.
33 | Please check out Fermi as an alternative client which is actively
34 | maintained and offers way more features than this client ever did.
35 |
- Puyodead1
37 | 38 | 39 | -------------------------------------------------------------------------------- /src/contexts/ContextMenuContext.ts: -------------------------------------------------------------------------------- 1 | import { useFloating } from "@floating-ui/react"; 2 | import { Channel, Guild, GuildMember, MessageLike, User } from "@structures"; 3 | import React from "react"; 4 | 5 | export type ContextMenuProps = 6 | | { 7 | type: "user"; 8 | user: User; 9 | member?: GuildMember; 10 | } 11 | | { 12 | type: "message"; 13 | message: MessageLike; 14 | } 15 | | { 16 | type: "channel"; 17 | channel: Channel; 18 | } 19 | | { 20 | type: "channelMention"; 21 | channel: Channel; 22 | } 23 | | { 24 | type: "guild"; 25 | guild: Guild; 26 | }; 27 | 28 | export type ContextMenuContextType = { 29 | setReferenceElement: ReturnType{stack}
56 | {error}
35 |60 |75 | ); 76 | } 77 | 78 | export default CodeBlock; 79 | -------------------------------------------------------------------------------- /src/components/contextMenus/MessageContextMenu.tsx: -------------------------------------------------------------------------------- 1 | import { modalController } from "@/controllers/modals"; 2 | import { useAppStore } from "@hooks/useAppStore"; 3 | import { Message } from "@structures"; 4 | import { ContextMenu, ContextMenuButton, ContextMenuDivider } from "./ContextMenu"; 5 | 6 | interface MenuProps { 7 | message: Message; 8 | } 9 | 10 | function MessageContextMenu({ message }: MenuProps) { 11 | const app = useAppStore(); 12 | 13 | function copyRaw() { 14 | navigator.clipboard.writeText(message.content); 15 | } 16 | 17 | async function deleteMessage(e: MouseEvent) { 18 | if (e.shiftKey) { 19 | await message.delete(); 20 | } else { 21 | modalController.push({ 22 | type: "delete_message", 23 | target: message as Message, 24 | }); 25 | } 26 | } 27 | 28 | function copyId() { 29 | navigator.clipboard.writeText(message.id); 30 | } 31 | 32 | return ( 33 |61 | 73 | {props.children} 74 |"Copy to Clipboard, 66 | }} 67 | > 68 | 72 |69 | {text} 70 | 71 |
[\w-]{2,255})(?:$|\b)/gi;
45 | // matches :host/invite/:code
46 | export const SPACEBAR_INVITE_REGEX = /(?:^|\b)[\w\\.-]+(?:\/invite|\.gg(?:\/invite)?)\/(?[\w-]{2,255})(?:$|\b)/gi;
47 |
--------------------------------------------------------------------------------