Improve direct timeline styles
This commit is contained in:
parent
7a3d027ccc
commit
1470de587a
1 changed files with 4 additions and 13 deletions
|
@ -5,14 +5,13 @@ import { directComposeById } from 'soapbox/actions/compose';
|
||||||
import { connectDirectStream } from 'soapbox/actions/streaming';
|
import { connectDirectStream } from 'soapbox/actions/streaming';
|
||||||
import { expandDirectTimeline } from 'soapbox/actions/timelines';
|
import { expandDirectTimeline } from 'soapbox/actions/timelines';
|
||||||
import AccountSearch from 'soapbox/components/account-search';
|
import AccountSearch from 'soapbox/components/account-search';
|
||||||
import ColumnHeader from 'soapbox/components/column-header';
|
|
||||||
import { Column } from 'soapbox/components/ui';
|
import { Column } from 'soapbox/components/ui';
|
||||||
import { useAppDispatch, useAppSelector } from 'soapbox/hooks';
|
import { useAppDispatch } from 'soapbox/hooks';
|
||||||
|
|
||||||
import Timeline from '../ui/components/timeline';
|
import Timeline from '../ui/components/timeline';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
title: { id: 'column.direct', defaultMessage: 'Direct messages' },
|
heading: { id: 'column.direct', defaultMessage: 'Direct messages' },
|
||||||
searchPlaceholder: { id: 'direct.search_placeholder', defaultMessage: 'Send a message to…' },
|
searchPlaceholder: { id: 'direct.search_placeholder', defaultMessage: 'Send a message to…' },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -20,8 +19,6 @@ const DirectTimeline = () => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
const hasUnread = useAppSelector((state) => (state.timelines.get('direct')?.unread || 0) > 0);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(expandDirectTimeline());
|
dispatch(expandDirectTimeline());
|
||||||
const disconnect = dispatch(connectDirectStream());
|
const disconnect = dispatch(connectDirectStream());
|
||||||
|
@ -40,13 +37,7 @@ const DirectTimeline = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column label={intl.formatMessage(messages.title)} transparent withHeader={false}>
|
<Column label={intl.formatMessage(messages.heading)}>
|
||||||
<ColumnHeader
|
|
||||||
icon='envelope'
|
|
||||||
active={hasUnread}
|
|
||||||
title={intl.formatMessage(messages.title)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<AccountSearch
|
<AccountSearch
|
||||||
placeholder={intl.formatMessage(messages.searchPlaceholder)}
|
placeholder={intl.formatMessage(messages.searchPlaceholder)}
|
||||||
onSelected={handleSuggestion}
|
onSelected={handleSuggestion}
|
||||||
|
@ -57,7 +48,7 @@ const DirectTimeline = () => {
|
||||||
timelineId='direct'
|
timelineId='direct'
|
||||||
onLoadMore={handleLoadMore}
|
onLoadMore={handleLoadMore}
|
||||||
emptyMessage={<FormattedMessage id='empty_column.direct' defaultMessage="You don't have any direct messages yet. When you send or receive one, it will show up here." />}
|
emptyMessage={<FormattedMessage id='empty_column.direct' defaultMessage="You don't have any direct messages yet. When you send or receive one, it will show up here." />}
|
||||||
divideType='space'
|
divideType='border'
|
||||||
/>
|
/>
|
||||||
</Column>
|
</Column>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue