Skip to content

Commit

Permalink
Merge pull request #57 from cloudflare/partyserver
Browse files Browse the repository at this point in the history
partyserver and friends
  • Loading branch information
threepointone authored Jul 3, 2024
2 parents 040b350 + 9eb67e8 commit af79f7b
Show file tree
Hide file tree
Showing 25 changed files with 1,841 additions and 3,908 deletions.
89 changes: 0 additions & 89 deletions app/api/roomsApi.server.ts

This file was deleted.

12 changes: 7 additions & 5 deletions app/components/MuteUserButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FC } from 'react'
import { useRoomContext } from '~/hooks/useRoomContext'
import { useUserMetadata } from '~/hooks/useUserMetadata'
import type { User } from '~/types/Messages'
import type { ClientMessage, User } from '~/types/Messages'
import AlertDialog from './AlertDialog'
import type { ButtonProps } from './Button'
import { Button } from './Button'
Expand Down Expand Up @@ -62,10 +62,12 @@ export const MuteUserButton: FC<MuteUserButtonProps> = ({
<AlertDialog.Action asChild>
<Button
onClick={() => {
room.signal.sendMessage({
type: 'muteUser',
id: user.id,
})
room.websocket.send(
JSON.stringify({
type: 'muteUser',
id: user.id,
} satisfies ClientMessage)
)
}}
className="text-sm"
displayType="danger"
Expand Down
4 changes: 3 additions & 1 deletion app/components/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
} from 'react'
import { style } from '~/utils/style'

import { nanoid } from 'nanoid'

export const Root = style(
Toast.Root,
'bg-white rounded dark:bg-zinc-500 shadow p-3 text-zinc-800 dark:text-zinc-50'
Expand All @@ -33,7 +35,7 @@ export const NotificationToastsProvider = (props: { children?: ReactNode }) => {
...ms,
{
...options,
id: crypto.randomUUID(),
id: nanoid(14),
content,
},
]),
Expand Down
Loading

0 comments on commit af79f7b

Please sign in to comment.