-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(fuselage): Messages's components incorrect types (#1336)
- Loading branch information
1 parent
cef61fd
commit baea129
Showing
15 changed files
with
45 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 2 additions & 6 deletions
8
packages/fuselage/src/components/Message/MessageContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
import type { ReactNode } from 'react'; | ||
import type { HTMLAttributes } from 'react'; | ||
import React from 'react'; | ||
|
||
type MessageContainerProps = { | ||
children?: ReactNode; | ||
}; | ||
|
||
export const MessageContainer = (props: MessageContainerProps) => ( | ||
export const MessageContainer = (props: HTMLAttributes<HTMLDivElement>) => ( | ||
<div className='rcx-box rcx-box--full rcx-message-container' {...props} /> | ||
); |
10 changes: 4 additions & 6 deletions
10
packages/fuselage/src/components/Message/MessageContainerFixed.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 5 additions & 7 deletions
12
packages/fuselage/src/components/Message/MessageEmojiBase.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
import type { ReactNode } from 'react'; | ||
import type { HTMLAttributes } from 'react'; | ||
import React from 'react'; | ||
|
||
type MessageEmojiBaseProps = { | ||
name: string; | ||
className?: string; | ||
children?: ReactNode; | ||
image?: string; | ||
}; | ||
} & HTMLAttributes<HTMLSpanElement>; | ||
|
||
export const MessageEmojiBase = ({ | ||
name, | ||
className, | ||
image, | ||
children, | ||
className, | ||
...props | ||
}: MessageEmojiBaseProps) => ( | ||
<span | ||
className={`${className || ''} ${name}`} | ||
style={image && image.length ? { backgroundImage: image } : undefined} | ||
children={children} | ||
{...props} | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 2 additions & 6 deletions
8
packages/fuselage/src/components/Message/MessageLeftContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import type { AllHTMLAttributes } from 'react'; | ||
import type { HTMLAttributes } from 'react'; | ||
import React from 'react'; | ||
|
||
type MessageNameProps = AllHTMLAttributes<HTMLSpanElement>; | ||
|
||
export const MessageName = (props: MessageNameProps) => ( | ||
export const MessageName = (props: HTMLAttributes<HTMLSpanElement>) => ( | ||
<span className='rcx-box rcx-box--full rcx-message-header__name' {...props} /> | ||
); |
6 changes: 2 additions & 4 deletions
6
packages/fuselage/src/components/Message/MessageNameContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 4 additions & 15 deletions
19
packages/fuselage/src/components/Message/MessageReactions/MessageReactionEmoji.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,14 @@ | ||
import type { ReactNode } from 'react'; | ||
import type { ComponentProps } from 'react'; | ||
import React from 'react'; | ||
|
||
import { MessageEmojiBase } from '../MessageEmojiBase'; | ||
|
||
type MessageReactionEmojiProps = { | ||
name: string; | ||
className?: string; | ||
children?: ReactNode; | ||
image?: string; | ||
}; | ||
|
||
export const MessageReactionEmoji = ({ | ||
name, | ||
className, | ||
image, | ||
children, | ||
}: MessageReactionEmojiProps) => ( | ||
...props | ||
}: ComponentProps<typeof MessageEmojiBase>) => ( | ||
<MessageEmojiBase | ||
className={`rcx-message-reactions__emoji ${className || ''}`} | ||
name={name} | ||
image={image} | ||
children={children} | ||
{...props} | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
import type { ReactNode } from 'react'; | ||
import type { ComponentProps } from 'react'; | ||
import React from 'react'; | ||
|
||
import { Tag } from '../Tag'; | ||
|
||
type MessageRoleProps = { | ||
children?: ReactNode; | ||
}; | ||
|
||
export const MessageRole = (props: MessageRoleProps) => ( | ||
export const MessageRole = (props: ComponentProps<typeof Tag>) => ( | ||
<Tag className='rcx-box rcx-box--full rcx-message-header__role' {...props} /> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
import type { ReactNode } from 'react'; | ||
import type { HTMLAttributes } from 'react'; | ||
import React from 'react'; | ||
|
||
type MessageRolesProps = { | ||
children?: ReactNode; | ||
}; | ||
|
||
export const MessageRoles = (props: MessageRolesProps) => ( | ||
export const MessageRoles = (props: HTMLAttributes<HTMLDivElement>) => ( | ||
<div className='rcx-box rcx-box--full rcx-message-header__roles' {...props} /> | ||
); |
6 changes: 2 additions & 4 deletions
6
packages/fuselage/src/components/Message/MessageTimestamp.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import type { ReactNode } from 'react'; | ||
import type { HTMLAttributes } from 'react'; | ||
import React from 'react'; | ||
|
||
type MessageTimestampProps = { children: ReactNode; title?: string }; | ||
|
||
export const MessageTimestamp = (props: MessageTimestampProps) => ( | ||
export const MessageTimestamp = (props: HTMLAttributes<HTMLSpanElement>) => ( | ||
<span className='rcx-box rcx-box--full rcx-message-header__time' {...props} /> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 4 additions & 15 deletions
19
packages/fuselage/src/components/Message/ThreadMessage/ThreadMessageEmoji.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,14 @@ | ||
import type { ReactNode } from 'react'; | ||
import type { ComponentProps } from 'react'; | ||
import React from 'react'; | ||
|
||
import { MessageEmojiBase } from '../MessageEmojiBase'; | ||
|
||
type ThreadMessageEmojiProps = { | ||
name: string; | ||
className?: string; | ||
image?: string; | ||
children?: ReactNode; | ||
}; | ||
|
||
export const ThreadMessageEmoji = ({ | ||
name, | ||
className, | ||
image, | ||
children, | ||
}: ThreadMessageEmojiProps) => ( | ||
...props | ||
}: ComponentProps<typeof MessageEmojiBase>) => ( | ||
<MessageEmojiBase | ||
className={`rcx-message-thread__emoji ${className || ''}`} | ||
name={name} | ||
image={image} | ||
children={children} | ||
{...props} | ||
/> | ||
); |