Updates button styles for replies and views
This commit is contained in:
parent
300cee2e24
commit
85df5cf1d8
5 changed files with 93 additions and 34 deletions
|
@ -118,6 +118,22 @@ story.add('Multi story', () => {
|
|||
story.add('Caption', () => (
|
||||
<StoryViewer
|
||||
{...getDefaultProps()}
|
||||
group={getDefaultConversation({
|
||||
avatarPath: '/fixtures/kitten-4-112-112.jpg',
|
||||
title: 'Broskis',
|
||||
type: 'group',
|
||||
})}
|
||||
replyState={{
|
||||
messageId: '123',
|
||||
replies: [
|
||||
{
|
||||
...getDefaultConversation(),
|
||||
body: 'Cool',
|
||||
id: 'abc',
|
||||
timestamp: Date.now(),
|
||||
},
|
||||
],
|
||||
}}
|
||||
stories={[
|
||||
{
|
||||
attachment: fakeAttachment({
|
||||
|
|
|
@ -513,36 +513,46 @@ export const StoryViewer = ({
|
|||
type="button"
|
||||
>
|
||||
<>
|
||||
{viewCount > 0 &&
|
||||
(viewCount === 1 ? (
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id="MyStories__views--singular"
|
||||
components={[<strong>{viewCount}</strong>]}
|
||||
/>
|
||||
) : (
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id="MyStories__views--plural"
|
||||
components={[<strong>{viewCount}</strong>]}
|
||||
/>
|
||||
))}
|
||||
{viewCount > 0 && replyCount > 0 && ' '}
|
||||
{replyCount > 0 &&
|
||||
(replyCount === 1 ? (
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id="MyStories__replies--singular"
|
||||
components={[<strong>{replyCount}</strong>]}
|
||||
/>
|
||||
) : (
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id="MyStories__replies--plural"
|
||||
components={[<strong>{replyCount}</strong>]}
|
||||
/>
|
||||
))}
|
||||
{!viewCount && !replyCount && i18n('StoryViewer__reply')}
|
||||
{viewCount > 0 || replyCount > 0 ? (
|
||||
<span className="StoryViewer__reply__chevron">
|
||||
{viewCount > 0 &&
|
||||
(viewCount === 1 ? (
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id="MyStories__views--singular"
|
||||
components={[<strong>{viewCount}</strong>]}
|
||||
/>
|
||||
) : (
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id="MyStories__views--plural"
|
||||
components={[<strong>{viewCount}</strong>]}
|
||||
/>
|
||||
))}
|
||||
{viewCount > 0 && replyCount > 0 && ' '}
|
||||
{replyCount > 0 &&
|
||||
(replyCount === 1 ? (
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id="MyStories__replies--singular"
|
||||
components={[<strong>{replyCount}</strong>]}
|
||||
/>
|
||||
) : (
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id="MyStories__replies--plural"
|
||||
components={[<strong>{replyCount}</strong>]}
|
||||
/>
|
||||
))}
|
||||
</span>
|
||||
) : null}
|
||||
{!viewCount && !replyCount && (
|
||||
<span className="StoryViewer__reply__arrow">
|
||||
{isGroupStory
|
||||
? i18n('StoryViewer__reply-group')
|
||||
: i18n('StoryViewer__reply')}
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
</button>
|
||||
)}
|
||||
|
|
|
@ -168,7 +168,11 @@ export const StoryViewsNRepliesModal = ({
|
|||
onReply(...args);
|
||||
}}
|
||||
onTextTooLong={onTextTooLong}
|
||||
placeholder={i18n('StoryViewsNRepliesModal__placeholder')}
|
||||
placeholder={
|
||||
isGroupStory
|
||||
? i18n('StoryViewer__reply-group')
|
||||
: i18n('StoryViewer__reply')
|
||||
}
|
||||
theme={ThemeType.dark}
|
||||
>
|
||||
<EmojiButton
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue