pleroma/app/soapbox/features/ui/components/panels/sign-up-panel.tsx

34 lines
1 KiB
TypeScript
Raw Normal View History

2022-05-10 03:16:25 -07:00
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { Button, Stack, Text } from 'soapbox/components/ui';
2023-01-13 17:13:15 -08:00
import { useAppSelector, useInstance, useRegistrationStatus } from 'soapbox/hooks';
2022-05-10 03:16:25 -07:00
const SignUpPanel = () => {
2022-11-26 08:38:16 -08:00
const instance = useInstance();
2023-01-13 17:13:15 -08:00
const { isOpen } = useRegistrationStatus();
2022-05-10 03:16:25 -07:00
const me = useAppSelector((state) => state.me);
2023-01-13 17:13:15 -08:00
if (me || !isOpen) return null;
2022-05-10 03:16:25 -07:00
return (
<Stack space={2} data-testid='sign-up-panel'>
2022-05-10 03:16:25 -07:00
<Stack>
<Text size='lg' weight='bold'>
2022-11-26 08:38:16 -08:00
<FormattedMessage id='signup_panel.title' defaultMessage='New to {site_title}?' values={{ site_title: instance.title }} />
2022-05-10 03:16:25 -07:00
</Text>
<Text theme='muted' size='sm'>
<FormattedMessage id='signup_panel.subtitle' defaultMessage='Sign up now to discuss.' />
</Text>
</Stack>
<Button theme='primary' block to='/signup'>
2022-05-10 03:16:25 -07:00
<FormattedMessage id='account.register' defaultMessage='Sign up' />
</Button>
</Stack>
);
};
export default SignUpPanel;