Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
molvqingtai committed Oct 1, 2024
2 parents 323c9ef + fce64b7 commit 7ba434c
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/app/content/components/MessageInput.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { forwardRef, type ChangeEvent, type KeyboardEvent } from 'react'

import { Textarea } from '@/components/ui/Textarea'
import { Markdown } from '@/components/ui/Markdown'
import { Markdown } from '@/components/Markdown'
import { cn } from '@/utils'
import { ScrollArea } from '@/components/ui/ScrollArea'

Expand Down
2 changes: 1 addition & 1 deletion src/app/content/components/MessageItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import LikeButton from './LikeButton'
import FormatDate from './FormatDate'
import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/Avatar'

import { Markdown } from '@/components/ui/Markdown'
import { Markdown } from '@/components/Markdown'
import { type NormalMessage } from '@/domain/MessageList'
import { cn } from '@/utils'

Expand Down
5 changes: 3 additions & 2 deletions src/app/options/components/BadgeList.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { FC } from 'react'
import { Button } from '@/components/ui/Button'
import { GitHubLogoIcon } from '@radix-ui/react-icons'
import Link from '@/components/Link'

const BadgeList: FC = () => {
return (
<div className="fixed inset-x-1 bottom-6 mx-auto flex w-fit">
<Button asChild size="lg" variant="ghost" className="rounded-full px-3 text-xl font-semibold text-primary">
<a href="https://github.com/molvqingtai/WebChat" target="https://github.com/molvqingtai/WebChat">
<Link href="https://github.com/molvqingtai/WebChat">
<GitHubLogoIcon className="mr-1 size-6"></GitHubLogoIcon>
Github
</a>
</Link>
</Button>
</div>
)
Expand Down
8 changes: 7 additions & 1 deletion src/app/options/components/ProfileForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { MAX_AVATAR_SIZE } from '@/constants/config'
import ToastDomain from '@/domain/Toast'
import BlurFade from '@/components/magicui/BlurFade'
import { Checkbox } from '@/components/ui/checkbox'
import Link from '@/components/Link'

const defaultUserInfo: UserInfo = {
id: nanoid(),
Expand Down Expand Up @@ -149,7 +150,12 @@ const ProfileForm = () => {
</FormLabel>
</div>
</FormControl>
<FormDescription>Danmaku messages will scroll across the screen.</FormDescription>
<FormDescription>
Enabling this will display messages scrolling on the website.
<Link className="ml-2 text-primary" href="https://en.wikipedia.org/wiki/Danmaku_subtitling">
Wikipedia
</Link>
</FormDescription>
<FormMessage />
</FormItem>
)}
Expand Down
19 changes: 19 additions & 0 deletions src/components/Link.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { cn } from '@/utils'
import { forwardRef, ReactNode } from 'react'

export interface LinkProps {
href: string
className?: string
children: ReactNode
}

const Link = forwardRef<HTMLAnchorElement, LinkProps>(({ href, className, children }, ref) => {
return (
<a href={href} target={href} rel="noopener noreferrer" className={cn('hover:underline', className)} ref={ref}>
{children}
</a>
)
})

Link.displayName = 'Link'
export default Link
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'
import remarkBreaks from 'remark-breaks'
import { cn } from '@/utils'
import { ScrollArea, ScrollBar } from './ScrollArea'
import { ScrollArea, ScrollBar } from '@/components/ui/ScrollArea'

export interface MarkdownProps {
children?: string
Expand Down
29 changes: 0 additions & 29 deletions src/components/ui/Sonner.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/domain/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ const RoomDomain = Remesh.domain({
domain.effect({
name: 'Room.OnUnloadEffect',
impl: ({ get }) => {
const beforeUnload$ = fromEvent(window, 'beforedestroy').pipe(
const beforeUnload$ = fromEvent(window, 'beforeunload').pipe(
map(() => {
return get(JoinStatusModule.query.IsFinishedQuery()) ? LeaveRoomCommand() : null
})
Expand Down

0 comments on commit 7ba434c

Please sign in to comment.