Skip to content

Commit

Permalink
feat: discord setup command
Browse files Browse the repository at this point in the history
  • Loading branch information
Stormix committed Dec 10, 2023
1 parent 79068ab commit 12a984c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .vscode/riftmaker.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
],
"settings": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": false
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
"typescript.tsdk": "node_modules/typescript/lib",
}
Expand Down
53 changes: 37 additions & 16 deletions components/molecules/invite-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,48 @@ import { Input } from '../ui/input';

const InviteLink = ({ tournament }: { tournament: Tournament }) => {
const inviteLink = `${env.NEXT_PUBLIC_BASE_URL}/tournament/${tournament.id}`;
const setupCommand = `/setup tournament:${tournament.id}`;

const { toast } = useToast();
const { copy } = useCopyToClipboard();

return (
<div className="flex flex-col gap-4">
<h3 className="text-3xl font-semibold">Invite link:</h3>
<div className="flex flex-row gap-4">
<Input value={inviteLink} readOnly />
<Button
variant={'outline'}
onClick={() => {
copy(inviteLink);
toast({
description: 'Copied invite link to clipboard',
});
}}
>
<FaRegCopy className="w-4 h-4 mr-2" title="Copy invite link" />
Copy link
</Button>
<div className="flex flex-col gap-8">
<div className="flex flex-col gap-4">
<h3 className="text-3xl font-semibold">Invite link:</h3>
<div className="flex flex-row gap-4">
<Input value={inviteLink} readOnly />
<Button
variant={'outline'}
onClick={() => {
copy(inviteLink);
toast({
description: 'Copied invite link to clipboard',
});
}}
>
<FaRegCopy className="w-4 h-4 mr-2" title="Copy invite link" />
Copy link
</Button>
</div>
</div>
<div className="flex flex-col gap-4">
<h3 className="text-3xl font-semibold">Discord command:</h3>
<div className="flex flex-row gap-4">
<Input value={setupCommand} readOnly />
<Button
variant={'outline'}
onClick={() => {
copy(setupCommand);
toast({
description: 'Copied setup command to clipboard',
});
}}
>
<FaRegCopy className="w-4 h-4 mr-2" title="Copy command" />
Copy command
</Button>
</div>
</div>
</div>
);
Expand Down

0 comments on commit 12a984c

Please sign in to comment.