diff --git a/stylesheets/components/StoryListItem.scss b/stylesheets/components/StoryListItem.scss index baef66b982a2..8ab16e23c667 100644 --- a/stylesheets/components/StoryListItem.scss +++ b/stylesheets/components/StoryListItem.scss @@ -10,6 +10,12 @@ height: 96px; width: 100%; + @include keyboard-mode { + &:focus { + background: $color-gray-65; + } + } + &:hover { background: $color-gray-65; } diff --git a/stylesheets/components/StoryViewer.scss b/stylesheets/components/StoryViewer.scss index 36d6006df3a8..53d945e6f6b6 100644 --- a/stylesheets/components/StoryViewer.scss +++ b/stylesheets/components/StoryViewer.scss @@ -40,6 +40,12 @@ width: 24px; @include color-svg('../images/icons/v2/more-horiz-24.svg', $color-white); + + @include keyboard-mode { + &:focus { + background-color: $color-ultramarine; + } + } } &__container { @@ -89,6 +95,11 @@ &__reply { @include button-reset; + @include keyboard-mode { + &:focus { + color: $color-ultramarine; + } + } } &__progress { diff --git a/ts/components/StoriesPane.tsx b/ts/components/StoriesPane.tsx index 9ef59635fc8c..e510338ff1e3 100644 --- a/ts/components/StoriesPane.tsx +++ b/ts/components/StoriesPane.tsx @@ -1,6 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only +import FocusTrap from 'focus-trap-react'; import Fuse from 'fuse.js'; import React, { useEffect, useState } from 'react'; import classNames from 'classnames'; @@ -82,51 +83,54 @@ export const StoriesPane = ({ }, [searchTerm, stories]); return ( - <> -
-
+ { + setSearchTerm(event.target.value); + }} + placeholder={i18n('search')} + value={searchTerm} /> -
- {i18n('Stories__title')} +
+ {renderedStories.map(story => ( + { + onStoryClicked(story.conversationId); + }} + onHideStory={() => { + toggleHideStories(getNewestStory(story).sender.id); + }} + onGoToConversation={conversationId => { + openConversationInternal({ conversationId }); + }} + queueStoryDownload={queueStoryDownload} + story={getNewestStory(story)} + /> + ))} + {!stories.length && i18n('Stories__list-empty')}
- { - setSearchTerm(event.target.value); - }} - placeholder={i18n('search')} - value={searchTerm} - /> -
- {renderedStories.map(story => ( - { - onStoryClicked(story.conversationId); - }} - onHideStory={() => { - toggleHideStories(getNewestStory(story).sender.id); - }} - onGoToConversation={conversationId => { - openConversationInternal({ conversationId }); - }} - queueStoryDownload={queueStoryDownload} - story={getNewestStory(story)} - /> - ))} - {!stories.length && i18n('Stories__list-empty')} -
- + ); }; diff --git a/ts/components/StoryListItem.tsx b/ts/components/StoryListItem.tsx index 28a238e8986b..b6d219a4c21d 100644 --- a/ts/components/StoryListItem.tsx +++ b/ts/components/StoryListItem.tsx @@ -124,6 +124,7 @@ export const StoryListItem = ({ } }} ref={setReferenceElement} + tabIndex={0} type="button" > -
-
- + )} +
-
- {isMe ? ( - <> - {views && - (views === 1 ? ( - {views}]} - /> - ) : ( - {views}]} - /> - ))} - {views && replies && ' '} - {replies && - (replies === 1 ? ( - {replies}]} - /> - ) : ( - {replies}]} - /> - ))} - - ) : ( - - )} -
+ {hasReplyModal && ( + setHasReplyModal(false)} + onReact={emoji => { + onReactToStory(emoji, visibleStory); + }} + onReply={(message, mentions, replyTimestamp) => { + setHasReplyModal(false); + onReplyToStory(message, mentions, replyTimestamp, visibleStory); + }} + onSetSkinTone={onSetSkinTone} + onTextTooLong={onTextTooLong} + onUseEmoji={onUseEmoji} + preferredReactionEmoji={preferredReactionEmoji} + recentEmojis={recentEmojis} + renderEmojiPicker={renderEmojiPicker} + replies={[]} + skinTone={skinTone} + storyPreviewAttachment={attachment} + views={[]} + /> + )} - {hasReplyModal && ( - setHasReplyModal(false)} - onReact={emoji => { - onReactToStory(emoji, visibleStory); - }} - onReply={(message, mentions, replyTimestamp) => { - setHasReplyModal(false); - onReplyToStory(message, mentions, replyTimestamp, visibleStory); - }} - onSetSkinTone={onSetSkinTone} - onTextTooLong={onTextTooLong} - onUseEmoji={onUseEmoji} - preferredReactionEmoji={preferredReactionEmoji} - recentEmojis={recentEmojis} - renderEmojiPicker={renderEmojiPicker} - replies={[]} - skinTone={skinTone} - storyPreviewAttachment={attachment} - views={[]} - /> - )} - + ); };