From af16e48ce3b63af4537b8c6fa5f029fb73a30ed5 Mon Sep 17 00:00:00 2001 From: danidfra Date: Tue, 25 Feb 2025 20:28:27 -0300 Subject: [PATCH 1/4] Implement login button and friendly greeting --- .../ui/components/panels/sign-up-panel.tsx | 43 +++++++++++++------ src/locales/en.json | 2 + 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/features/ui/components/panels/sign-up-panel.tsx b/src/features/ui/components/panels/sign-up-panel.tsx index d3dbd1c64..ea646a87a 100644 --- a/src/features/ui/components/panels/sign-up-panel.tsx +++ b/src/features/ui/components/panels/sign-up-panel.tsx @@ -2,16 +2,15 @@ import { FormattedMessage } from 'react-intl'; import { openModal } from 'soapbox/actions/modals.ts'; import Button from 'soapbox/components/ui/button.tsx'; +import HStack from 'soapbox/components/ui/hstack.tsx'; import Stack from 'soapbox/components/ui/stack.tsx'; import Text from 'soapbox/components/ui/text.tsx'; import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts'; import { useAppSelector } from 'soapbox/hooks/useAppSelector.ts'; import { useFeatures } from 'soapbox/hooks/useFeatures.ts'; -import { useInstance } from 'soapbox/hooks/useInstance.ts'; import { useRegistrationStatus } from 'soapbox/hooks/useRegistrationStatus.ts'; const SignUpPanel = () => { - const { instance } = useInstance(); const { nostrSignup } = useFeatures(); const { isOpen } = useRegistrationStatus(); const me = useAppSelector((state) => state.me); @@ -19,26 +18,44 @@ const SignUpPanel = () => { if (me || !isOpen) return null; + function getGreeting() { + const hours = new Date().getHours(); + return hours < 12 ? 'GM' : 'Hey There'; + } + return ( - + - - + + - + + + + + + + ); }; diff --git a/src/locales/en.json b/src/locales/en.json index aca5adb3c..d4423aeeb 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1467,6 +1467,8 @@ "settings.settings": "Settings", "shared.tos": "Terms of Service", "signup_panel.subtitle": "Sign up now to discuss what's happening.", + "login_panel.subtitle": "Dive into the best of social media!", + "signup_panel.greeting_title": "{greeting}! Welcome aboard!", "signup_panel.title": "New to {site_title}?", "site_preview.preview": "Preview", "soapbox_config.authenticated_profile_hint": "Users must be logged-in to view replies and media on user profiles.", From 6a76bca7ff7e17327ea2d7430358893f3bd5c777 Mon Sep 17 00:00:00 2001 From: danidfra Date: Tue, 25 Feb 2025 20:49:38 -0300 Subject: [PATCH 2/4] Remove unnecessary line --- src/features/ui/components/panels/sign-up-panel.tsx | 8 ++------ src/locales/en.json | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/features/ui/components/panels/sign-up-panel.tsx b/src/features/ui/components/panels/sign-up-panel.tsx index ea646a87a..5d57ab95c 100644 --- a/src/features/ui/components/panels/sign-up-panel.tsx +++ b/src/features/ui/components/panels/sign-up-panel.tsx @@ -7,11 +7,9 @@ import Stack from 'soapbox/components/ui/stack.tsx'; import Text from 'soapbox/components/ui/text.tsx'; import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts'; import { useAppSelector } from 'soapbox/hooks/useAppSelector.ts'; -import { useFeatures } from 'soapbox/hooks/useFeatures.ts'; import { useRegistrationStatus } from 'soapbox/hooks/useRegistrationStatus.ts'; const SignUpPanel = () => { - const { nostrSignup } = useFeatures(); const { isOpen } = useRegistrationStatus(); const me = useAppSelector((state) => state.me); const dispatch = useAppDispatch(); @@ -38,8 +36,7 @@ const SignUpPanel = () => {