-
Notifications
You must be signed in to change notification settings - Fork 144
feature: Thread for mobile screen #530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
166fc31
2f4b6c9
d15e87b
c77c9c0
1e6a086
156cb98
8cf3b6d
951033e
b0c3b5f
da10fdc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ export const DesktopLayout: React.FC<DesktopLayoutProps> = ( | |
| threadTargetMessage, | ||
| setThreadTargetMessage, | ||
| } = props; | ||
| const [animatedMessageId, setAnimatedMessageId] = useState(null); | ||
| const [animatedMessageId, setAnimatedMessageId] = useState<number | null>(null); | ||
| return ( | ||
| <div className="sendbird-app__wrap"> | ||
| <div className="sendbird-app__channellist-wrap"> | ||
|
|
@@ -44,8 +44,8 @@ export const DesktopLayout: React.FC<DesktopLayoutProps> = ( | |
| onProfileEditSuccess={onProfileEditSuccess} | ||
| disableAutoSelect={disableAutoSelect} | ||
| onChannelSelect={(channel) => { | ||
| setStartingPoint(null); | ||
| setHighlightedMessage(null); | ||
| setStartingPoint?.(null); | ||
| setHighlightedMessage?.(null); | ||
|
Comment on lines
+47
to
+48
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cleander would be to make these two fns. not nullable
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar for other "local setters" than can be shared
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from: |
||
| if (channel) { | ||
| setCurrentChannel(channel); | ||
| } else { | ||
|
|
@@ -93,7 +93,7 @@ export const DesktopLayout: React.FC<DesktopLayoutProps> = ( | |
| setAnimatedMessageId(null); | ||
| }} | ||
| onMessageHighlighted={() => { | ||
| setHighlightedMessage(null); | ||
| setHighlightedMessage?.(null); | ||
| }} | ||
| showSearchIcon={showSearchIcon} | ||
| startingPoint={startingPoint} | ||
|
|
@@ -121,13 +121,13 @@ export const DesktopLayout: React.FC<DesktopLayoutProps> = ( | |
| channelUrl={currentChannel?.url || ''} | ||
| onResultClick={(message) => { | ||
| if (message.messageId === highlightedMessage) { | ||
| setHighlightedMessage(null); | ||
| setHighlightedMessage?.(null); | ||
| setTimeout(() => { | ||
| setHighlightedMessage(message.messageId); | ||
| setHighlightedMessage?.(message.messageId); | ||
| }); | ||
| } else { | ||
| setStartingPoint(message.createdAt); | ||
| setHighlightedMessage(message.messageId); | ||
| setStartingPoint?.(message.createdAt); | ||
| setHighlightedMessage?.(message.messageId); | ||
| } | ||
| }} | ||
| onCloseClick={() => { | ||
|
|
@@ -149,7 +149,7 @@ export const DesktopLayout: React.FC<DesktopLayoutProps> = ( | |
| setCurrentChannel(channel); | ||
| } | ||
| if (message?.messageId !== animatedMessageId) { | ||
| setStartingPoint(message?.createdAt); | ||
| setStartingPoint?.(message?.createdAt); | ||
| } | ||
| setTimeout(() => { | ||
| setAnimatedMessageId(message?.messageId); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,14 @@ | |
| .sb-show-main { | ||
| padding: 0 !important; | ||
| } | ||
|
|
||
| .sb_mobile__panelwrap .sendbird-thread { | ||
| width: 100%; | ||
| height: 100%; | ||
| & .sendbird-thread-ui { | ||
| max-width: 100%; | ||
| & .sendbird-thread-ui__header { | ||
| width: 100%; | ||
| } | ||
| } | ||
| } | ||
|
Comment on lines
+10
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this better be:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally, we have to imagine they should work flawlessly even when used independently (ie.outside App(Mobile)).. Given a proper container |
||
Uh oh!
There was an error while loading. Please reload this page.