Updated status search functionality, Added search/statuses route

• Updated:
- status search functionality

• Added:
- search/statuses route
This commit is contained in:
mgabdev 2020-10-26 01:08:31 -05:00
parent 4bfe7d63bb
commit c1b4a6f034
2 changed files with 6 additions and 5 deletions

View File

@ -132,7 +132,7 @@ class Search extends ImmutablePureComponent {
</PanelLayout>
)
}
if (results.get('statuses') && results.get('statuses').size > 0 && me && (isTop || showStatuses)) {
const size = isTop ? Math.min(results.get('statuses').size, theLimit) : results.get('statuses').size;
const isMax = size === results.get('statuses').size
@ -152,10 +152,10 @@ class Search extends ImmutablePureComponent {
</Text>
</div>
{
results.get('statuses').slice(0, size).map((status) => (
<StatusContainer
key={`status-${status.get('id')}`}
id={status.get('id')}
results.get('statuses').slice(0, size).map((statusId) => (
<StatusContainer
key={`status-${statusId}`}
id={statusId}
contextType='search'
commentsLimited
/>

View File

@ -229,6 +229,7 @@ class SwitchingArea extends React.PureComponent {
<WrappedRoute path='/search/people' exact publicRoute page={SearchPage} component={Search} content={children} />
<WrappedRoute path='/search/hashtags' exact publicRoute page={SearchPage} component={Search} content={children} />
<WrappedRoute path='/search/groups' exact publicRoute page={SearchPage} component={Search} content={children} />
<WrappedRoute path='/search/statuses' exact publicRoute page={SearchPage} component={Search} content={children} />
<WrappedRoute path='/settings/blocks' exact page={SettingsPage} component={BlockedAccounts} content={children} componentParams={{ title: 'Blocked Users' }} />
<WrappedRoute path='/settings/mutes' exact page={SettingsPage} component={Mutes} content={children} componentParams={{ title: 'Muted Users' }} />