kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Revert cute greeting
rodzic
a68df6fd1a
commit
a1972c8a76
|
@ -7,36 +7,36 @@ import Stack from 'soapbox/components/ui/stack.tsx';
|
||||||
import Text from 'soapbox/components/ui/text.tsx';
|
import Text from 'soapbox/components/ui/text.tsx';
|
||||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||||
import { useAppSelector } from 'soapbox/hooks/useAppSelector.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';
|
import { useRegistrationStatus } from 'soapbox/hooks/useRegistrationStatus.ts';
|
||||||
|
|
||||||
const SignUpPanel = () => {
|
const SignUpPanel = () => {
|
||||||
|
const { instance } = useInstance();
|
||||||
|
const { nostrSignup } = useFeatures();
|
||||||
const { isOpen } = useRegistrationStatus();
|
const { isOpen } = useRegistrationStatus();
|
||||||
const me = useAppSelector((state) => state.me);
|
const me = useAppSelector((state) => state.me);
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
if (me || !isOpen) return null;
|
if (me || !isOpen) return null;
|
||||||
|
|
||||||
function getGreeting() {
|
|
||||||
const hours = new Date().getHours();
|
|
||||||
return hours < 12 ? <FormattedMessage id='signup_panel.greeting.gm' defaultMessage='GM' /> : <FormattedMessage id='signup_panel.greeting.hey' defaultMessage='Hey there' />;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack space={2} data-testid='sign-up-panel'>
|
<Stack space={2} data-testid='sign-up-panel'>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Text size='lg' weight='bold'>
|
<Text size='lg' weight='bold'>
|
||||||
<FormattedMessage id='signup_panel.greeting_title' defaultMessage='{greeting}! Welcome aboard!' values={{ greeting: getGreeting() }} />
|
<FormattedMessage id='signup_panel.title' defaultMessage='New to {site_title}?' values={{ site_title: instance.title }} />
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Text size='sm' theme='muted'>
|
<Text size='sm' theme='muted'>
|
||||||
<FormattedMessage id='login_panel.subtitle' defaultMessage='Dive into the best of social media!' />
|
<FormattedMessage id='signup_panel.subtitle' defaultMessage="Sign up now to discuss what's happening." />
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<HStack space={2}>
|
<HStack space={2}>
|
||||||
<Button
|
<Button
|
||||||
theme='tertiary'
|
theme='tertiary'
|
||||||
onClick={() => dispatch(openModal('NOSTR_LOGIN'))}
|
onClick={nostrSignup ? () => dispatch(openModal('NOSTR_LOGIN')) : undefined}
|
||||||
|
to={nostrSignup ? undefined : '/login'}
|
||||||
block
|
block
|
||||||
>
|
>
|
||||||
<FormattedMessage id='account.login' defaultMessage='Log in' />
|
<FormattedMessage id='account.login' defaultMessage='Log in' />
|
||||||
|
@ -44,7 +44,8 @@ const SignUpPanel = () => {
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
theme='primary'
|
theme='primary'
|
||||||
onClick={() => dispatch(openModal('NOSTR_SIGNUP'))}
|
onClick={nostrSignup ? () => dispatch(openModal('NOSTR_SIGNUP')) : undefined}
|
||||||
|
to={nostrSignup ? undefined : '/signup'}
|
||||||
block
|
block
|
||||||
>
|
>
|
||||||
<FormattedMessage id='account.register' defaultMessage='Sign up' />
|
<FormattedMessage id='account.register' defaultMessage='Sign up' />
|
||||||
|
|
|
@ -1028,7 +1028,6 @@
|
||||||
"login_external.errors.instance_fail": "The instance returned an error.",
|
"login_external.errors.instance_fail": "The instance returned an error.",
|
||||||
"login_external.errors.network_fail": "Connection failed. Is a browser extension blocking it?",
|
"login_external.errors.network_fail": "Connection failed. Is a browser extension blocking it?",
|
||||||
"login_form.header": "Sign In",
|
"login_form.header": "Sign In",
|
||||||
"login_panel.subtitle": "Dive into the best of social media!",
|
|
||||||
"manage.zap_split.add": "Add",
|
"manage.zap_split.add": "Add",
|
||||||
"manage.zap_split.add_new_account": "Add New Account",
|
"manage.zap_split.add_new_account": "Add New Account",
|
||||||
"manage.zap_split.fail_request": "Failed to update fees.",
|
"manage.zap_split.fail_request": "Failed to update fees.",
|
||||||
|
@ -1467,9 +1466,6 @@
|
||||||
"settings.sessions": "Active sessions",
|
"settings.sessions": "Active sessions",
|
||||||
"settings.settings": "Settings",
|
"settings.settings": "Settings",
|
||||||
"shared.tos": "Terms of Service",
|
"shared.tos": "Terms of Service",
|
||||||
"signup_panel.greeting.gm": "GM",
|
|
||||||
"signup_panel.greeting.hey": "Hey there",
|
|
||||||
"signup_panel.greeting_title": "{greeting}! Welcome aboard!",
|
|
||||||
"signup_panel.subtitle": "Sign up now to discuss what's happening.",
|
"signup_panel.subtitle": "Sign up now to discuss what's happening.",
|
||||||
"signup_panel.title": "New to {site_title}?",
|
"signup_panel.title": "New to {site_title}?",
|
||||||
"site_preview.preview": "Preview",
|
"site_preview.preview": "Preview",
|
||||||
|
|
Ładowanie…
Reference in New Issue