Merge branch 'hide-profile-tabs' into 'develop'

Hide tabs on Followers, Following… pages

See merge request soapbox-pub/soapbox-fe!1630
environments/review-develop-3zknud/deployments/571
marcin mikołajczak 2022-07-18 15:41:01 +00:00
commit 9de46333b2
16 zmienionych plików z 29 dodań i 34 usunięć

Wyświetl plik

@ -35,7 +35,7 @@ const Card = React.forwardRef<HTMLDivElement, ICard>(({ children, variant, size
className={classNames({ className={classNames({
'space-y-4': true, 'space-y-4': true,
'bg-white dark:bg-slate-800 text-black dark:text-white shadow-lg dark:shadow-inset overflow-hidden': variant === 'rounded', 'bg-white dark:bg-slate-800 text-black dark:text-white shadow-lg dark:shadow-inset overflow-hidden': variant === 'rounded',
[sizes[size]]: true, [sizes[size]]: variant === 'rounded',
}, className)} }, className)}
> >
{children} {children}

Wyświetl plik

@ -1,4 +1,3 @@
import classNames from 'classnames';
import React from 'react'; import React from 'react';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
@ -42,25 +41,19 @@ const Column: React.FC<IColumn> = React.forwardRef((props, ref: React.ForwardedR
} }
}; };
const renderChildren = () => { const renderChildren = () => (
if (transparent) { <Card variant={transparent ? undefined : 'rounded'} className={className}>
return <div className={classNames('text-black dark:text-white', className)}>{children}</div>; {withHeader ? (
} <CardHeader onBackClick={handleBackClick}>
<CardTitle title={label} />
</CardHeader>
) : null}
return ( <CardBody>
<Card variant='rounded' className={className}> {children}
{withHeader ? ( </CardBody>
<CardHeader onBackClick={handleBackClick}> </Card>
<CardTitle title={label} /> );
</CardHeader>
) : null}
<CardBody>
{children}
</CardBody>
</Card>
);
};
return ( return (
<div role='region' className='relative' ref={ref} aria-label={label} column-type={transparent ? 'transparent' : 'filled'}> <div role='region' className='relative' ref={ref} aria-label={label} column-type={transparent ? 'transparent' : 'filled'}>

Wyświetl plik

@ -36,7 +36,7 @@ const Bookmarks: React.FC = () => {
const emptyMessage = <FormattedMessage id='empty_column.bookmarks' defaultMessage="You don't have any bookmarks yet. When you add one, it will show up here." />; const emptyMessage = <FormattedMessage id='empty_column.bookmarks' defaultMessage="You don't have any bookmarks yet. When you add one, it will show up here." />;
return ( return (
<Column transparent> <Column transparent withHeader={false}>
<div className='px-4 pt-4 sm:p-0'> <div className='px-4 pt-4 sm:p-0'>
<SubNavigation message={intl.formatMessage(messages.heading)} /> <SubNavigation message={intl.formatMessage(messages.heading)} />
</div> </div>

Wyświetl plik

@ -43,7 +43,7 @@ const CommunityTimeline = () => {
}, [onlyMedia]); }, [onlyMedia]);
return ( return (
<Column label={intl.formatMessage(messages.title)} transparent> <Column label={intl.formatMessage(messages.title)} transparent withHeader={false}>
<SubNavigation message={intl.formatMessage(messages.title)} settings={ColumnSettings} /> <SubNavigation message={intl.formatMessage(messages.title)} settings={ColumnSettings} />
<PullToRefresh onRefresh={handleRefresh}> <PullToRefresh onRefresh={handleRefresh}>
<Timeline <Timeline

Wyświetl plik

@ -40,7 +40,7 @@ const DirectTimeline = () => {
}; };
return ( return (
<Column label={intl.formatMessage(messages.title)} transparent> <Column label={intl.formatMessage(messages.title)} transparent withHeader={false}>
<ColumnHeader <ColumnHeader
icon='envelope' icon='envelope'
active={hasUnread} active={hasUnread}

Wyświetl plik

@ -118,7 +118,7 @@ class Followers extends ImmutablePureComponent {
} }
return ( return (
<Column label={intl.formatMessage(messages.heading)} withHeader={false} transparent> <Column label={intl.formatMessage(messages.heading)} transparent>
<ScrollableList <ScrollableList
scrollKey='followers' scrollKey='followers'
hasMore={hasMore} hasMore={hasMore}

Wyświetl plik

@ -118,7 +118,7 @@ class Following extends ImmutablePureComponent {
} }
return ( return (
<Column label={intl.formatMessage(messages.heading)} withHeader={false} transparent> <Column label={intl.formatMessage(messages.heading)} transparent>
<ScrollableList <ScrollableList
scrollKey='following' scrollKey='following'
hasMore={hasMore} hasMore={hasMore}

Wyświetl plik

@ -112,7 +112,7 @@ class HashtagTimeline extends React.PureComponent {
const { id } = this.props.params; const { id } = this.props.params;
return ( return (
<Column label={`#${id}`} transparent> <Column label={`#${id}`} transparent withHeader={false}>
<ColumnHeader active={hasUnread} title={this.title()} /> <ColumnHeader active={hasUnread} title={this.title()} />
<Timeline <Timeline
scrollKey='hashtag_timeline' scrollKey='hashtag_timeline'

Wyświetl plik

@ -59,7 +59,7 @@ const HomeTimeline: React.FC = () => {
}, [isPartial]); }, [isPartial]);
return ( return (
<Column label={intl.formatMessage(messages.title)} transparent> <Column label={intl.formatMessage(messages.title)} transparent withHeader={false}>
<PullToRefresh onRefresh={handleRefresh}> <PullToRefresh onRefresh={handleRefresh}>
<Timeline <Timeline
scrollKey='home_timeline' scrollKey='home_timeline'

Wyświetl plik

@ -85,7 +85,7 @@ const ListTimeline: React.FC = () => {
); );
return ( return (
<Column label={title} heading={title} transparent> <Column label={title} heading={title} transparent withHeader={false}>
{/* <HomeColumnHeader activeItem='lists' activeSubItem={id} active={hasUnread}> {/* <HomeColumnHeader activeItem='lists' activeSubItem={id} active={hasUnread}>
<div className='column-header__links'> <div className='column-header__links'>
<button className='text-btn column-header__setting-btn' tabIndex='0' onClick={handleEditClick}> <button className='text-btn column-header__setting-btn' tabIndex='0' onClick={handleEditClick}>

Wyświetl plik

@ -36,7 +36,7 @@ const PinnedStatuses = () => {
} }
return ( return (
<Column label={intl.formatMessage(messages.heading)}> <Column label={intl.formatMessage(messages.heading)} transparent withHeader={false}>
<StatusList <StatusList
statusIds={statusIds} statusIds={statusIds}
scrollKey='pinned_statuses' scrollKey='pinned_statuses'

Wyświetl plik

@ -64,7 +64,7 @@ const CommunityTimeline = () => {
}, [onlyMedia]); }, [onlyMedia]);
return ( return (
<Column label={intl.formatMessage(messages.title)} transparent> <Column label={intl.formatMessage(messages.title)} transparent withHeader={false}>
<SubNavigation message={intl.formatMessage(messages.title)} settings={ColumnSettings} /> <SubNavigation message={intl.formatMessage(messages.title)} settings={ColumnSettings} />
<PinnedHostsPicker /> <PinnedHostsPicker />
{showExplanationBox && <div className='mb-4'> {showExplanationBox && <div className='mb-4'>

Wyświetl plik

@ -65,7 +65,7 @@ const RemoteTimeline: React.FC<IRemoteTimeline> = ({ params }) => {
}, [onlyMedia]); }, [onlyMedia]);
return ( return (
<Column label={intl.formatMessage(messages.title)} heading={instance} transparent> <Column label={intl.formatMessage(messages.title)} heading={instance} transparent withHeader={false}>
{instance && <PinnedHostsPicker host={instance} />} {instance && <PinnedHostsPicker host={instance} />}
{!pinned && <HStack className='mb-4 px-2' space={2}> {!pinned && <HStack className='mb-4 px-2' space={2}>
<IconButton iconClassName='h-5 w-5' src={require('@tabler/icons/x.svg')} onClick={handleCloseClick} /> <IconButton iconClassName='h-5 w-5' src={require('@tabler/icons/x.svg')} onClick={handleCloseClick} />

Wyświetl plik

@ -792,7 +792,7 @@ class Status extends ImmutablePureComponent<IStatus, IStatusState> {
} }
return ( return (
<Column label={intl.formatMessage(titleMessage, { username })} transparent> <Column label={intl.formatMessage(titleMessage, { username })} transparent withHeader={false}>
<div className='px-4 pt-4 sm:p-0'> <div className='px-4 pt-4 sm:p-0'>
<SubNavigation message={intl.formatMessage(titleMessage, { username })} /> <SubNavigation message={intl.formatMessage(titleMessage, { username })} />
</div> </div>

Wyświetl plik

@ -38,7 +38,7 @@ const TestTimeline: React.FC = () => {
}, []); }, []);
return ( return (
<Column label={intl.formatMessage(messages.title)} transparent> <Column label={intl.formatMessage(messages.title)} transparent withHeader={false}>
<SubNavigation message={intl.formatMessage(messages.title)} /> <SubNavigation message={intl.formatMessage(messages.title)} />
<Timeline <Timeline
scrollKey={`${timelineId}_timeline`} scrollKey={`${timelineId}_timeline`}

Wyświetl plik

@ -116,6 +116,8 @@ const ProfilePage: React.FC<IProfilePage> = ({ params, children }) => {
activeItem = 'profile'; activeItem = 'profile';
} }
const showTabs = !['following', 'followers', 'pins'].some(path => pathname.includes(path));
return ( return (
<> <>
<Layout.Main> <Layout.Main>
@ -128,7 +130,7 @@ const ProfilePage: React.FC<IProfilePage> = ({ params, children }) => {
{Component => <Component username={username} account={account} />} {Component => <Component username={username} account={account} />}
</BundleContainer> </BundleContainer>
{account && ( {account && showTabs && (
<Tabs items={tabItems} activeItem={activeItem} /> <Tabs items={tabItems} activeItem={activeItem} />
)} )}