From 6da72d874e5267ae532ef75f2d7060b94adda1cd Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 3 Jun 2022 12:34:30 -0500 Subject: [PATCH] TimelineQueueButtonHeader --> ScrollTopButton --- ..._header.test.js => scroll-top-button.test.js} | 16 ++++++++-------- ...e_button_header.tsx => scroll-top-button.tsx} | 6 +++--- app/soapbox/features/notifications/index.js | 4 ++-- app/soapbox/features/ui/components/timeline.tsx | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) rename app/soapbox/components/__tests__/{timeline_queue_button_header.test.js => scroll-top-button.test.js} (79%) rename app/soapbox/components/{timeline_queue_button_header.tsx => scroll-top-button.tsx} (93%) diff --git a/app/soapbox/components/__tests__/timeline_queue_button_header.test.js b/app/soapbox/components/__tests__/scroll-top-button.test.js similarity index 79% rename from app/soapbox/components/__tests__/timeline_queue_button_header.test.js rename to app/soapbox/components/__tests__/scroll-top-button.test.js index bc011d309..c23a733ef 100644 --- a/app/soapbox/components/__tests__/timeline_queue_button_header.test.js +++ b/app/soapbox/components/__tests__/scroll-top-button.test.js @@ -3,17 +3,17 @@ import React from 'react'; import { defineMessages } from 'react-intl'; import { render, screen } from '../../jest/test-helpers'; -import TimelineQueueButtonHeader from '../timeline_queue_button_header'; +import ScrollTopButton from '../scroll-top-button'; const messages = defineMessages({ queue: { id: 'status_list.queue_label', defaultMessage: 'Click to see {count} new {count, plural, one {post} other {posts}}' }, }); -describe('', () => { +describe('', () => { it('renders correctly', async() => { render( - {}} // eslint-disable-line react/jsx-no-bind timelineId='home' message={messages.queue} @@ -24,8 +24,8 @@ describe('', () => { expect(screen.queryAllByRole('link')).toHaveLength(0); render( - {}} // eslint-disable-line react/jsx-no-bind timelineId='home' message={messages.queue} @@ -36,8 +36,8 @@ describe('', () => { expect(screen.getByText(/Click to see\s+1\s+new post/, { hidden: true })).toBeInTheDocument(); render( - {}} // eslint-disable-line react/jsx-no-bind timelineId='home' message={messages.queue} diff --git a/app/soapbox/components/timeline_queue_button_header.tsx b/app/soapbox/components/scroll-top-button.tsx similarity index 93% rename from app/soapbox/components/timeline_queue_button_header.tsx rename to app/soapbox/components/scroll-top-button.tsx index 292368571..11ceb9e40 100644 --- a/app/soapbox/components/timeline_queue_button_header.tsx +++ b/app/soapbox/components/scroll-top-button.tsx @@ -8,7 +8,7 @@ import { Text } from 'soapbox/components/ui'; import { useAppSelector, useSettings } from 'soapbox/hooks'; import { shortNumberFormat } from 'soapbox/utils/numbers'; -interface ITimelineQueueButtonHeader { +interface IScrollTopButton { onClick: () => void, timelineId: string, message: MessageDescriptor, @@ -16,7 +16,7 @@ interface ITimelineQueueButtonHeader { autoloadThreshold?: number, } -const TimelineQueueButtonHeader: React.FC = ({ +const ScrollTopButton: React.FC = ({ onClick, timelineId, message, @@ -82,4 +82,4 @@ const TimelineQueueButtonHeader: React.FC = ({ ); }; -export default TimelineQueueButtonHeader; +export default ScrollTopButton; diff --git a/app/soapbox/features/notifications/index.js b/app/soapbox/features/notifications/index.js index 8ef05fb73..d3b5cb318 100644 --- a/app/soapbox/features/notifications/index.js +++ b/app/soapbox/features/notifications/index.js @@ -14,8 +14,8 @@ import { dequeueNotifications, } from 'soapbox/actions/notifications'; import { getSettings } from 'soapbox/actions/settings'; +import ScrollTopButton from 'soapbox/components/scroll-top-button'; import ScrollableList from 'soapbox/components/scrollable_list'; -import TimelineQueueButtonHeader from 'soapbox/components/timeline_queue_button_header'; import { Column } from 'soapbox/components/ui'; import PlaceholderNotification from 'soapbox/features/placeholder/components/placeholder_notification'; @@ -195,7 +195,7 @@ class Notifications extends React.PureComponent { return ( {filterBarContainer} - = ({ return ( <> -