diff --git a/stylesheets/components/MyStories.scss b/stylesheets/components/MyStories.scss index 866bb967aa..c006e8137c 100644 --- a/stylesheets/components/MyStories.scss +++ b/stylesheets/components/MyStories.scss @@ -101,4 +101,31 @@ ); } } + + &__avatar-container { + position: relative; + } + + &__avatar__add-story { + @include button-reset; + @include rounded-corners; + align-items: center; + background: $color-ultramarine-dawn; + border: 2px solid $color-gray-80; + bottom: -2px; + display: flex; + height: 20px; + justify-content: center; + position: absolute; + right: -4px; + width: 20px; + z-index: $z-index-base; + + &::after { + content: ''; + @include color-svg('../images/icons/v2/plus-20.svg', $color-white); + height: 10px; + width: 10px; + } + } } diff --git a/stylesheets/components/StoryListItem.scss b/stylesheets/components/StoryListItem.scss index d29c526aff..2282d86bf0 100644 --- a/stylesheets/components/StoryListItem.scss +++ b/stylesheets/components/StoryListItem.scss @@ -22,10 +22,28 @@ } } + &__click-container { + align-items: center; + display: flex; + height: 100%; + width: 100%; + + &:focus { + outline: none; + } + + @include keyboard-mode { + &:focus { + outline: 1px solid $color-ultramarine; + } + } + } + &__info { display: flex; - flex: 1; flex-direction: column; + flex: 1; + justify-content: center; margin-left: 12px; margin-right: 12px; diff --git a/ts/components/MyStoriesButton.stories.tsx b/ts/components/MyStoriesButton.stories.tsx index fc30695a39..2be178cf55 100644 --- a/ts/components/MyStoriesButton.stories.tsx +++ b/ts/components/MyStoriesButton.stories.tsx @@ -33,12 +33,9 @@ export default { newestStory: { defaultValue: getFakeStoryView(), }, - onClick: { - action: true, - }, - queueStoryDownload: { - action: true, - }, + onAddStory: { action: true }, + onClick: { action: true }, + queueStoryDownload: { action: true }, }, } as Meta; @@ -49,6 +46,10 @@ const interactionTest: PlayFunction = async ({ canvasElement, }) => { const canvas = within(canvasElement); + const [btnAddStory] = canvas.getAllByLabelText('Add a story'); + await userEvent.click(btnAddStory); + await expect(args.onAddStory).toHaveBeenCalled(); + const [btnStory] = canvas.getAllByLabelText('Story'); await userEvent.click(btnStory); await expect(args.onClick).toHaveBeenCalled(); diff --git a/ts/components/MyStoriesButton.tsx b/ts/components/MyStoriesButton.tsx index 7fbaeadebf..249697a639 100644 --- a/ts/components/MyStoriesButton.tsx +++ b/ts/components/MyStoriesButton.tsx @@ -15,6 +15,7 @@ export type PropsType = { i18n: LocalizerType; me: ConversationType; newestStory?: StoryViewType; + onAddStory: () => unknown; onClick: () => unknown; queueStoryDownload: (storyId: string) => unknown; }; @@ -24,6 +25,7 @@ export const MyStoriesButton = ({ i18n, me, newestStory, + onAddStory, onClick, queueStoryDownload, }: PropsType): JSX.Element => { @@ -40,66 +42,96 @@ export const MyStoriesButton = ({ return (
- +
); }; diff --git a/ts/components/StoriesPane.tsx b/ts/components/StoriesPane.tsx index bdc305f9dd..e9791397bf 100644 --- a/ts/components/StoriesPane.tsx +++ b/ts/components/StoriesPane.tsx @@ -187,6 +187,7 @@ export const StoriesPane = ({ newestStory={ myStories.length ? getNewestMyStory(myStories[0]) : undefined } + onAddStory={onAddStory} onClick={onMyStoriesClicked} queueStoryDownload={queueStoryDownload} />