Merge branch 'fork' into frontend-rw
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
commit
3284a1e2db
9 changed files with 70 additions and 43 deletions
|
@ -20,13 +20,15 @@ interface IListItem {
|
|||
label: React.ReactNode;
|
||||
hint?: React.ReactNode;
|
||||
to?: string;
|
||||
href?: string;
|
||||
onClick?(): void;
|
||||
onSelect?(): void;
|
||||
isSelected?: boolean;
|
||||
children?: React.ReactNode;
|
||||
size?: 'sm' | 'md';
|
||||
}
|
||||
|
||||
const ListItem: React.FC<IListItem> = ({ className, label, hint, children, to, onClick, onSelect, isSelected }) => {
|
||||
const ListItem: React.FC<IListItem> = ({ className, label, hint, children, to, href, onClick, onSelect, isSelected, size = 'md' }) => {
|
||||
const id = uuidv4();
|
||||
const domId = `list-group-${id}`;
|
||||
|
||||
|
@ -36,7 +38,7 @@ const ListItem: React.FC<IListItem> = ({ className, label, hint, children, to, o
|
|||
}
|
||||
};
|
||||
|
||||
const LabelComp = to || onClick || onSelect ? 'span' : 'label';
|
||||
const LabelComp = to || href || onClick || onSelect ? 'span' : 'label';
|
||||
|
||||
const renderChildren = React.useCallback(() => React.Children.map(children, (child) => {
|
||||
if (React.isValidElement(child)) {
|
||||
|
@ -54,9 +56,14 @@ const ListItem: React.FC<IListItem> = ({ className, label, hint, children, to, o
|
|||
return null;
|
||||
}), [children, domId]);
|
||||
|
||||
const classNames = clsx('from-gradient-start/20 to-gradient-end/20 dark:from-gradient-start/10 dark:to-gradient-end/10 flex items-center justify-between overflow-hidden bg-gradient-to-r px-4 py-2 first:rounded-t-lg last:rounded-b-lg', className, {
|
||||
'cursor-pointer hover:from-gradient-start/30 hover:to-gradient-end/30 dark:hover:from-gradient-start/5 dark:hover:to-gradient-end/5': typeof to !== 'undefined' || typeof onClick !== 'undefined' || typeof onSelect !== 'undefined',
|
||||
});
|
||||
const classNames = clsx('from-gradient-start/20 to-gradient-end/20 dark:from-gradient-start/10 dark:to-gradient-end/10 flex items-center justify-between overflow-hidden bg-gradient-to-r first:rounded-t-lg last:rounded-b-lg',
|
||||
className,
|
||||
{
|
||||
'px-4 py-2': size === 'md',
|
||||
'px-2 py-0.5': size === 'sm',
|
||||
'cursor-pointer hover:from-gradient-start/30 hover:to-gradient-end/30 dark:hover:from-gradient-start/5 dark:hover:to-gradient-end/5': typeof to !== 'undefined' || typeof onClick !== 'undefined' || typeof onSelect !== 'undefined',
|
||||
},
|
||||
);
|
||||
|
||||
const body = (
|
||||
<>
|
||||
|
@ -68,7 +75,7 @@ const ListItem: React.FC<IListItem> = ({ className, label, hint, children, to, o
|
|||
) : null}
|
||||
</div>
|
||||
|
||||
{(to || onClick) ? (
|
||||
{(to || href || onClick) ? (
|
||||
<HStack space={1} alignItems='center' className='overflow-hidden text-gray-700 dark:text-gray-600'>
|
||||
{children}
|
||||
|
||||
|
@ -113,8 +120,8 @@ const ListItem: React.FC<IListItem> = ({ className, label, hint, children, to, o
|
|||
</Link>
|
||||
);
|
||||
|
||||
const Comp = onClick ? 'a' : 'div';
|
||||
const linkProps = onClick || onSelect ? { onClick: onClick || onSelect, onKeyDown, tabIndex: 0, role: 'link' } : {};
|
||||
const Comp = onClick || href ? 'a' : 'div';
|
||||
const linkProps = onClick || onSelect || href ? { onClick: onClick || onSelect, onKeyDown, tabIndex: 0, role: 'link', ...(href && { href, target: '_blank' }) } : {};
|
||||
|
||||
return (
|
||||
<Comp
|
||||
|
|
|
@ -21,8 +21,8 @@ interface LayoutComponent extends React.FC<ILayout> {
|
|||
|
||||
/** Layout container, to hold Sidebar, Main, and Aside. */
|
||||
const Layout: LayoutComponent = ({ children }) => (
|
||||
<div className='black:pt-0 relative flex grow flex-col sm:pt-2'>
|
||||
<div className='mx-auto w-full max-w-3xl grow sm:px-6 md:grid md:max-w-7xl md:grid-cols-12 md:gap-8 md:px-8'>
|
||||
<div className='black:pt-0 relative flex grow flex-col sm:pt-4'>
|
||||
<div className='mx-auto w-full max-w-3xl grow sm:px-6 md:grid md:max-w-7xl md:grid-cols-12 md:gap-8 md:px-8 xl:max-w-[1440px]'>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -17,9 +17,9 @@ const messages = defineMessages({
|
|||
blockedYou: { id: 'chat_list_item.blocked_you', defaultMessage: 'This user has blocked you' },
|
||||
blocking: { id: 'chat_list_item.blocking', defaultMessage: 'You have blocked this user' },
|
||||
leaveMessage: { id: 'chat_settings.leave.message', defaultMessage: 'Are you sure you want to leave this chat? Messages will be deleted for you and this chat will be removed from your inbox.' },
|
||||
leaveHeading: { id: 'chat_settings.leave.heading', defaultMessage: 'Leave Chat' },
|
||||
leaveConfirm: { id: 'chat_settings.leave.confirm', defaultMessage: 'Leave Chat' },
|
||||
leaveChat: { id: 'chat_settings.options.leave_chat', defaultMessage: 'Leave Chat' },
|
||||
leaveHeading: { id: 'chat_settings.leave.heading', defaultMessage: 'Leave chat' },
|
||||
leaveConfirm: { id: 'chat_settings.leave.confirm', defaultMessage: 'Leave chat' },
|
||||
leaveChat: { id: 'chat_settings.options.leave_chat', defaultMessage: 'Leave chat' },
|
||||
});
|
||||
|
||||
interface IChatListItemInterface {
|
||||
|
|
|
@ -23,11 +23,11 @@ const messages = defineMessages({
|
|||
unblockHeading: { id: 'chat_settings.unblock.heading', defaultMessage: 'Unblock @{acct}' },
|
||||
unblockConfirm: { id: 'chat_settings.unblock.confirm', defaultMessage: 'Unblock' },
|
||||
leaveMessage: { id: 'chat_settings.leave.message', defaultMessage: 'Are you sure you want to leave this chat? Messages will be deleted for you and this chat will be removed from your inbox.' },
|
||||
leaveHeading: { id: 'chat_settings.leave.heading', defaultMessage: 'Leave Chat' },
|
||||
leaveConfirm: { id: 'chat_settings.leave.confirm', defaultMessage: 'Leave Chat' },
|
||||
leaveHeading: { id: 'chat_settings.leave.heading', defaultMessage: 'Leave chat' },
|
||||
leaveConfirm: { id: 'chat_settings.leave.confirm', defaultMessage: 'Leave chat' },
|
||||
blockUser: { id: 'chat_settings.options.block_user', defaultMessage: 'Block @{acct}' },
|
||||
unblockUser: { id: 'chat_settings.options.unblock_user', defaultMessage: 'Unblock @{acct}' },
|
||||
leaveChat: { id: 'chat_settings.options.leave_chat', defaultMessage: 'Leave Chat' },
|
||||
leaveChat: { id: 'chat_settings.options.leave_chat', defaultMessage: 'Leave chat' },
|
||||
});
|
||||
|
||||
const ChatPageMain = () => {
|
||||
|
|
|
@ -18,12 +18,12 @@ const messages = defineMessages({
|
|||
unblockHeading: { id: 'chat_settings.unblock.heading', defaultMessage: 'Unblock @{acct}' },
|
||||
unblockConfirm: { id: 'chat_settings.unblock.confirm', defaultMessage: 'Unblock' },
|
||||
leaveMessage: { id: 'chat_settings.leave.message', defaultMessage: 'Are you sure you want to leave this chat? Messages will be deleted for you and this chat will be removed from your inbox.' },
|
||||
leaveHeading: { id: 'chat_settings.leave.heading', defaultMessage: 'Leave Chat' },
|
||||
leaveConfirm: { id: 'chat_settings.leave.confirm', defaultMessage: 'Leave Chat' },
|
||||
leaveHeading: { id: 'chat_settings.leave.heading', defaultMessage: 'Leave chat' },
|
||||
leaveConfirm: { id: 'chat_settings.leave.confirm', defaultMessage: 'Leave chat' },
|
||||
title: { id: 'chat_settings.title', defaultMessage: 'Chat Details' },
|
||||
blockUser: { id: 'chat_settings.options.block_user', defaultMessage: 'Block @{acct}' },
|
||||
unblockUser: { id: 'chat_settings.options.unblock_user', defaultMessage: 'Unblock @{acct}' },
|
||||
leaveChat: { id: 'chat_settings.options.leave_chat', defaultMessage: 'Leave Chat' },
|
||||
leaveChat: { id: 'chat_settings.options.leave_chat', defaultMessage: 'Leave chat' },
|
||||
});
|
||||
|
||||
const ChatSettings = () => {
|
||||
|
|
|
@ -7,8 +7,10 @@ import { fetchInstance } from 'soapbox/actions/instance';
|
|||
import { Button, Stack, Text } from 'soapbox/components/ui';
|
||||
import LoginForm from 'soapbox/features/auth-login/components/login-form';
|
||||
import OtpAuthForm from 'soapbox/features/auth-login/components/otp-auth-form';
|
||||
import ExternalLoginForm from 'soapbox/features/external-login/components/external-login-form';
|
||||
import { useAppDispatch, useAppSelector, useInstance, useRegistrationStatus } from 'soapbox/hooks';
|
||||
import { getRedirectUrl } from 'soapbox/utils/redirect';
|
||||
import { isStandalone } from 'soapbox/utils/state';
|
||||
|
||||
import type { PlfeResponse } from 'soapbox/api';
|
||||
|
||||
|
@ -18,6 +20,7 @@ const SignUpPanel = () => {
|
|||
const instance = useInstance();
|
||||
const { isOpen } = useRegistrationStatus();
|
||||
const me = useAppSelector((state) => state.me);
|
||||
const standalone = useAppSelector(isStandalone);
|
||||
|
||||
const token = new URLSearchParams(window.location.search).get('token');
|
||||
|
||||
|
@ -91,13 +94,26 @@ const SignUpPanel = () => {
|
|||
</>
|
||||
)}
|
||||
|
||||
<Stack>
|
||||
<Text size='lg' weight='bold'>
|
||||
<FormattedMessage id='signup_panel.sign_in.title' defaultMessage='Already have an account?' />
|
||||
</Text>
|
||||
</Stack>
|
||||
{standalone ? (
|
||||
<>
|
||||
<Text size='lg' weight='bold'>
|
||||
<FormattedMessage id='signup_panel.sign_in.title.external' defaultMessage='Sign in to external instance' />
|
||||
</Text>
|
||||
<ExternalLoginForm />
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Text size='lg' weight='bold'>
|
||||
{isOpen ? (
|
||||
<FormattedMessage id='signup_panel.sign_in.title' defaultMessage='Sign in' />
|
||||
) : (
|
||||
<FormattedMessage id='signup_panel.sign_in.title.or' defaultMessage='Already have an account?' />
|
||||
)}
|
||||
</Text>
|
||||
|
||||
<LoginForm handleSubmit={handleSubmit} isLoading={isLoading} />
|
||||
<LoginForm handleSubmit={handleSubmit} isLoading={isLoading} />
|
||||
</>
|
||||
)}
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -109,7 +109,7 @@ const ProfileDropdown: React.FC<IProfileDropdown> = ({ account, children }) => {
|
|||
return (
|
||||
<>
|
||||
<button
|
||||
className='focus:ring-primary-500 dark:focus:ring-primary-500 rounded-full focus:ring-2 focus:ring-offset-2 dark:ring-gray-800 dark:ring-offset-0'
|
||||
className='focus:ring-primary-500 dark:focus:ring-primary-500 w-full rounded-full focus:ring-2 focus:ring-offset-2 dark:ring-gray-800 dark:ring-offset-0'
|
||||
type='button'
|
||||
ref={refs.setReference}
|
||||
onClick={toggleVisible}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import React from 'react';
|
||||
|
||||
import ForkAwesomeIcon from 'soapbox/components/fork-awesome-icon';
|
||||
import { Widget, Stack, Text } from 'soapbox/components/ui';
|
||||
import List, { ListItem } from 'soapbox/components/list';
|
||||
import { Widget, HStack } from 'soapbox/components/ui';
|
||||
import { useInstance, useSettings, useSoapboxConfig } from 'soapbox/hooks';
|
||||
|
||||
const PromoPanel: React.FC = () => {
|
||||
|
@ -15,16 +16,21 @@ const PromoPanel: React.FC = () => {
|
|||
|
||||
return (
|
||||
<Widget title={instance.title}>
|
||||
<Stack space={2}>
|
||||
<List>
|
||||
{promoItems.map((item, i) => (
|
||||
<Text key={i}>
|
||||
<a className='flex items-center' href={item.url} target='_blank'>
|
||||
<ForkAwesomeIcon id={item.icon} className='mr-2 flex-none text-lg rtl:ml-2 rtl:mr-0' fixedWidth />
|
||||
{item.textLocales.get(locale) || item.text}
|
||||
</a>
|
||||
</Text>
|
||||
<ListItem
|
||||
key={i}
|
||||
href={item.url}
|
||||
label={
|
||||
<HStack alignItems='center' space={2}>
|
||||
<ForkAwesomeIcon id={item.icon} className='flex-none text-lg' fixedWidth />
|
||||
<span>{item.textLocales.get(locale) || item.text}</span>
|
||||
</HStack>
|
||||
}
|
||||
size='sm'
|
||||
/>
|
||||
))}
|
||||
</Stack>
|
||||
</List>
|
||||
</Widget>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -280,11 +280,11 @@
|
|||
"chat_settings.block.confirm": "Block",
|
||||
"chat_settings.block.heading": "Block @{acct}",
|
||||
"chat_settings.block.message": "Blocking will prevent this profile from direct messaging you and viewing your content. You can unblock later.",
|
||||
"chat_settings.leave.confirm": "Leave Chat",
|
||||
"chat_settings.leave.heading": "Leave Chat",
|
||||
"chat_settings.leave.confirm": "Leave chat",
|
||||
"chat_settings.leave.heading": "Leave chat",
|
||||
"chat_settings.leave.message": "Are you sure you want to leave this chat? Messages will be deleted for you and this chat will be removed from your inbox.",
|
||||
"chat_settings.options.block_user": "Block @{acct}",
|
||||
"chat_settings.options.leave_chat": "Leave Chat",
|
||||
"chat_settings.options.leave_chat": "Leave chat",
|
||||
"chat_settings.options.unblock_user": "Unblock @{acct}",
|
||||
"chat_settings.title": "Chat Details",
|
||||
"chat_settings.unblock.confirm": "Unblock",
|
||||
|
@ -1035,11 +1035,6 @@
|
|||
"mute_modal.auto_expire": "Automatically expire mute?",
|
||||
"mute_modal.duration": "Duration",
|
||||
"mute_modal.hide_notifications": "Hide notifications from this user?",
|
||||
"navbar.login.action": "Log in",
|
||||
"navbar.login.email.placeholder": "E-mail address",
|
||||
"navbar.login.forgot_password": "Forgot password?",
|
||||
"navbar.login.password.label": "Password",
|
||||
"navbar.login.username.placeholder": "Email or username",
|
||||
"navigation.chats": "Chats",
|
||||
"navigation.compose": "Compose",
|
||||
"navigation.compose_group": "Compose to group",
|
||||
|
@ -1337,6 +1332,9 @@
|
|||
"settings.sessions": "Active sessions",
|
||||
"settings.settings": "Settings",
|
||||
"shared.tos": "Terms of Service",
|
||||
"signup_panel.sign_in.title": "Sign in",
|
||||
"signup_panel.sign_in.title.external": "Sign in to external instance",
|
||||
"signup_panel.sign_in.title.or": "Already have an account?",
|
||||
"signup_panel.subtitle": "Sign up now to discuss what's happening.",
|
||||
"signup_panel.title": "New to {site_title}?",
|
||||
"site_preview.preview": "Preview",
|
||||
|
|
Loading…
Reference in a new issue