Merge branch 'fix-timeline-spacing' into 'develop'

Fix timeline spacing

See merge request soapbox-pub/soapbox!1968
This commit is contained in:
Alex Gleason 2022-12-01 14:42:58 +00:00
commit 4cafc04ac1
3 changed files with 10 additions and 9 deletions

View file

@ -7,10 +7,10 @@ import { useSoapboxConfig } from 'soapbox/hooks';
import { Card, CardBody, CardHeader, CardTitle } from '../card/card'; import { Card, CardBody, CardHeader, CardTitle } from '../card/card';
type IColumnHeader = Pick<IColumn, 'label' | 'backHref' |'transparent'>; type IColumnHeader = Pick<IColumn, 'label' | 'backHref' |'className'>;
/** Contains the column title with optional back button. */ /** Contains the column title with optional back button. */
const ColumnHeader: React.FC<IColumnHeader> = ({ label, backHref, transparent }) => { const ColumnHeader: React.FC<IColumnHeader> = ({ label, backHref, className }) => {
const history = useHistory(); const history = useHistory();
const handleBackClick = () => { const handleBackClick = () => {
@ -27,10 +27,7 @@ const ColumnHeader: React.FC<IColumnHeader> = ({ label, backHref, transparent })
}; };
return ( return (
<CardHeader <CardHeader className={className} onBackClick={handleBackClick}>
className={classNames({ 'px-4 pt-4 sm:p-0': transparent })}
onBackClick={handleBackClick}
>
<CardTitle title={label} /> <CardTitle title={label} />
</CardHeader> </CardHeader>
); );
@ -72,7 +69,11 @@ const Column: React.FC<IColumn> = React.forwardRef((props, ref: React.ForwardedR
<Card variant={transparent ? undefined : 'rounded'} className={className}> <Card variant={transparent ? undefined : 'rounded'} className={className}>
{withHeader && ( {withHeader && (
<ColumnHeader label={label} backHref={backHref} transparent={transparent} /> <ColumnHeader
label={label}
backHref={backHref}
className={classNames({ 'px-4 pt-4 sm:p-0': transparent })}
/>
)} )}
<CardBody> <CardBody>

View file

@ -40,7 +40,7 @@ const CommunityTimeline = () => {
}, [onlyMedia]); }, [onlyMedia]);
return ( return (
<Column label={intl.formatMessage(messages.title)} transparent> <Column className='-mt-3 sm:mt-0' label={intl.formatMessage(messages.title)} transparent>
<PullToRefresh onRefresh={handleRefresh}> <PullToRefresh onRefresh={handleRefresh}>
<Timeline <Timeline
scrollKey={`${timelineId}_timeline`} scrollKey={`${timelineId}_timeline`}

View file

@ -60,7 +60,7 @@ const CommunityTimeline = () => {
}, [onlyMedia]); }, [onlyMedia]);
return ( return (
<Column label={intl.formatMessage(messages.title)} transparent> <Column className='-mt-3 sm:mt-0' label={intl.formatMessage(messages.title)} transparent>
<PinnedHostsPicker /> <PinnedHostsPicker />
{showExplanationBox && <div className='mb-4'> {showExplanationBox && <div className='mb-4'>