From dcab2deda132fe810830878b5645992b4c03cebe Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 23 Sep 2023 15:48:44 -0500 Subject: [PATCH 1/3] RegistrationPage: display "registrations closed" message in place of signup form when registrations are closed --- .../components/registration-page.tsx | 19 +++++++++++++++++++ src/hooks/useRegistrationStatus.ts | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/features/auth-login/components/registration-page.tsx b/src/features/auth-login/components/registration-page.tsx index 7f1e81ce5..ea57c9e5e 100644 --- a/src/features/auth-login/components/registration-page.tsx +++ b/src/features/auth-login/components/registration-page.tsx @@ -2,10 +2,29 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; import { BigCard } from 'soapbox/components/big-card'; +import { Text } from 'soapbox/components/ui'; +import { useInstance, useRegistrationStatus } from 'soapbox/hooks'; import RegistrationForm from './registration-form'; const RegistrationPage: React.FC = () => { + const instance = useInstance(); + const { isOpen } = useRegistrationStatus(); + + if (!isOpen) { + return ( + }> + + + + + ); + } + return ( }> diff --git a/src/hooks/useRegistrationStatus.ts b/src/hooks/useRegistrationStatus.ts index 0f1242d1e..aac5efef6 100644 --- a/src/hooks/useRegistrationStatus.ts +++ b/src/hooks/useRegistrationStatus.ts @@ -6,7 +6,7 @@ export const useRegistrationStatus = () => { const features = useFeatures(); return { - /** Registrations are open, either through Pepe or traditional account creation. */ + /** Registrations are open. */ isOpen: features.accountCreation && instance.registrations, }; }; \ No newline at end of file From 20d1880290f47b0ce465f2827d570613d8efe324 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 23 Sep 2023 15:54:20 -0500 Subject: [PATCH 2/3] LandingTimeline: remove unnecessary onlyMedia --- src/features/landing-timeline/index.tsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/features/landing-timeline/index.tsx b/src/features/landing-timeline/index.tsx index f485a831b..ec915cbf7 100644 --- a/src/features/landing-timeline/index.tsx +++ b/src/features/landing-timeline/index.tsx @@ -5,7 +5,7 @@ import { expandCommunityTimeline } from 'soapbox/actions/timelines'; import { useCommunityStream } from 'soapbox/api/hooks'; import PullToRefresh from 'soapbox/components/pull-to-refresh'; import { Column } from 'soapbox/components/ui'; -import { useAppSelector, useAppDispatch, useSettings } from 'soapbox/hooks'; +import { useAppSelector, useAppDispatch } from 'soapbox/hooks'; import Timeline from '../ui/components/timeline'; @@ -13,26 +13,23 @@ import { SiteBanner } from './components/site-banner'; const LandingTimeline = () => { const dispatch = useAppDispatch(); - - const settings = useSettings(); - const onlyMedia = !!settings.getIn(['community', 'other', 'onlyMedia'], false); const next = useAppSelector(state => state.timelines.get('community')?.next); const timelineId = 'community'; const handleLoadMore = (maxId: string) => { - dispatch(expandCommunityTimeline({ url: next, maxId, onlyMedia })); + dispatch(expandCommunityTimeline({ url: next, maxId })); }; const handleRefresh = () => { - return dispatch(expandCommunityTimeline({ onlyMedia })); + return dispatch(expandCommunityTimeline()); }; - useCommunityStream({ onlyMedia }); + useCommunityStream(); useEffect(() => { - dispatch(expandCommunityTimeline({ onlyMedia })); - }, [onlyMedia]); + dispatch(expandCommunityTimeline()); + }, []); return ( @@ -43,7 +40,7 @@ const LandingTimeline = () => { } From cdfb2de33f9aff23cb1333bb33001189adae0a97 Mon Sep 17 00:00:00 2001 From: Soapbox Bot Date: Sat, 23 Sep 2023 21:06:42 +0000 Subject: [PATCH 3/3] fix(deps): update dependency @lexical/code to ^0.12.0 --- package.json | 2 +- yarn.lock | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 05bff6853..b68f5c5ad 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@fontsource/roboto-mono": "^5.0.0", "@gamestdio/websocket": "^0.3.2", "@lexical/clipboard": "^0.11.3", - "@lexical/code": "^0.11.3", + "@lexical/code": "^0.12.0", "@lexical/hashtag": "^0.11.3", "@lexical/html": "^0.11.3", "@lexical/link": "^0.11.3", diff --git a/yarn.lock b/yarn.lock index 24c98a3ed..ebb217897 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1709,7 +1709,7 @@ "@lexical/selection" "0.11.3" "@lexical/utils" "0.11.3" -"@lexical/code@0.11.3", "@lexical/code@^0.11.3": +"@lexical/code@0.11.3": version "0.11.3" resolved "https://registry.yarnpkg.com/@lexical/code/-/code-0.11.3.tgz#4a5ef193655557859c63dd4a54012c78580585fa" integrity sha512-BIMPd2op65iP4N9SkKIUVodZoWeSsnk6skNJ8UHBO/Rg0ZxyAqxLpnBhEgHq2QOoTBbEW6OEFtkc7/+f9LINZg== @@ -1717,6 +1717,14 @@ "@lexical/utils" "0.11.3" prismjs "^1.27.0" +"@lexical/code@^0.12.0": + version "0.12.2" + resolved "https://registry.yarnpkg.com/@lexical/code/-/code-0.12.2.tgz#2484511cb9c3688bb85f477d448444250939986d" + integrity sha512-w2JeJdnMUtYnC/Fx78sL3iJBt9Ug8pFSDOcI9ay/BkMQFQV8oqq1iyuLLBBJSG4FAM8b2DXrVdGklRQ+jTfTVw== + dependencies: + "@lexical/utils" "0.12.2" + prismjs "^1.27.0" + "@lexical/dragon@0.11.3": version "0.11.3" resolved "https://registry.yarnpkg.com/@lexical/dragon/-/dragon-0.11.3.tgz#b4254953b09a68c20277ba0fb125548dd6630921" @@ -1757,6 +1765,13 @@ dependencies: "@lexical/utils" "0.11.3" +"@lexical/list@0.12.2": + version "0.12.2" + resolved "https://registry.yarnpkg.com/@lexical/list/-/list-0.12.2.tgz#7afdd13026f936144ff93d40382f21924e8e6908" + integrity sha512-3CyWtYQC+IlK4cK/oiD8Uz1gSXD8UcKGOF2vVsDXkMU06O6zvHNmHZOnVJqA0JVNgZAoR9dMR1fi2xd4iuCAiw== + dependencies: + "@lexical/utils" "0.12.2" + "@lexical/mark@0.11.3": version "0.11.3" resolved "https://registry.yarnpkg.com/@lexical/mark/-/mark-0.11.3.tgz#7f87a264d44762e275ba7b3d85e18307bbabd9e3" @@ -1825,6 +1840,11 @@ resolved "https://registry.yarnpkg.com/@lexical/selection/-/selection-0.11.3.tgz#f7250fae305a84c6e264a413f5feab056aeabfa3" integrity sha512-15lQpcKT/vd7XZ5pnF1nb+kpKb72e9Yi1dVqieSxTeXkzt1cAZFKP3NB4RlhOKCv1N+glSBnjSxRwgsFfbD+NQ== +"@lexical/selection@0.12.2": + version "0.12.2" + resolved "https://registry.yarnpkg.com/@lexical/selection/-/selection-0.12.2.tgz#87e30b953b02923d1691f61d5189eb1be81a19ae" + integrity sha512-h+g3oOnihHKIyLTyG6uLCEVR/DmUEVdCcZO1iAoGsuW7nwWiWNPWj6oZ3Cw5J1Mk5u62DHnkkVDQsVSZbAwmtg== + "@lexical/table@0.11.3", "@lexical/table@^0.11.3": version "0.11.3" resolved "https://registry.yarnpkg.com/@lexical/table/-/table-0.11.3.tgz#9b1980d828d7a588aaffa4cb8c6bb61401729034" @@ -1832,6 +1852,13 @@ dependencies: "@lexical/utils" "0.11.3" +"@lexical/table@0.12.2": + version "0.12.2" + resolved "https://registry.yarnpkg.com/@lexical/table/-/table-0.12.2.tgz#59be2fd0413a9125017bb119aa950050bf92717b" + integrity sha512-tiAmTq6RKHDVER9v589Ajm9/RL+WTF1WschrH6HHVCtil6cfJfTJeJ+MF45+XEzB9fkqy2LfrScAfWxqLjVePA== + dependencies: + "@lexical/utils" "0.12.2" + "@lexical/text@0.11.3": version "0.11.3" resolved "https://registry.yarnpkg.com/@lexical/text/-/text-0.11.3.tgz#81ce2b5cd0caa9d89372e52c3548173d9395ad3d" @@ -1846,6 +1873,15 @@ "@lexical/selection" "0.11.3" "@lexical/table" "0.11.3" +"@lexical/utils@0.12.2": + version "0.12.2" + resolved "https://registry.yarnpkg.com/@lexical/utils/-/utils-0.12.2.tgz#b8325f1a1a0d043fd2b40d59cd00c4d7c038474b" + integrity sha512-xW4y4l2Yd37+qLwkBvBGyzsKCA9wnh1ljphBJeR2vreT193i2gaIwuku2ZKlER14VHw4192qNJF7vUoAEmwurQ== + dependencies: + "@lexical/list" "0.12.2" + "@lexical/selection" "0.12.2" + "@lexical/table" "0.12.2" + "@lexical/yjs@0.11.3": version "0.11.3" resolved "https://registry.yarnpkg.com/@lexical/yjs/-/yjs-0.11.3.tgz#b7049c0be85945fe0766b614256df8121bb05499"