Merge branch 'discover' into 'main'
Discover See merge request soapbox-pub/soapbox!3031
This commit is contained in:
commit
8a4ca35a2b
|
@ -448,7 +448,7 @@
|
|||
"tabs_bar.news": "News",
|
||||
"tabs_bar.notifications": "Alerts",
|
||||
"tabs_bar.post": "Post",
|
||||
"tabs_bar.search": "Search",
|
||||
"tabs_bar.search": "Discover",
|
||||
"time_remaining.days": "{number, plural, one {# day} other {# days}} left",
|
||||
"time_remaining.hours": "{number, plural, one {# hour} other {# hours}} left",
|
||||
"time_remaining.minutes": "{number, plural, one {# minute} other {# minutes}} left",
|
||||
|
@ -929,7 +929,7 @@
|
|||
"tabs_bar.news": "News",
|
||||
"tabs_bar.notifications": "Alerts",
|
||||
"tabs_bar.post": "Post",
|
||||
"tabs_bar.search": "Search",
|
||||
"tabs_bar.search": "Discover",
|
||||
"time_remaining.days": "{number, plural, one {# day} other {# days}} left",
|
||||
"time_remaining.hours": "{number, plural, one {# hour} other {# hours}} left",
|
||||
"time_remaining.minutes": "{number, plural, one {# minute} other {# minutes}} left",
|
||||
|
|
|
@ -52,7 +52,7 @@ const clearSearchResults = () => ({
|
|||
const submitSearch = (filter?: SearchFilter) =>
|
||||
(dispatch: AppDispatch, getState: () => RootState) => {
|
||||
const value = getState().search.value;
|
||||
const type = filter || getState().search.filter || 'accounts';
|
||||
const type = filter || getState().search.filter || 'statuses';
|
||||
const accountId = getState().search.accountId;
|
||||
|
||||
// An empty search doesn't return any results
|
||||
|
|
|
@ -125,7 +125,7 @@ const SidebarNavigation = () => {
|
|||
<SidebarNavigationLink
|
||||
to='/search'
|
||||
icon={require('@tabler/icons/outline/search.svg')}
|
||||
text={<FormattedMessage id='tabs_bar.search' defaultMessage='Search' />}
|
||||
text={<FormattedMessage id='tabs_bar.search' defaultMessage='Discover' />}
|
||||
/>
|
||||
|
||||
{account && (
|
||||
|
|
|
@ -9,7 +9,7 @@ import { useAppDispatch, useAppSelector } from 'soapbox/hooks';
|
|||
|
||||
const messages = defineMessages({
|
||||
search: { id: 'aliases.search', defaultMessage: 'Search your old account' },
|
||||
searchTitle: { id: 'tabs_bar.search', defaultMessage: 'Search' },
|
||||
searchTitle: { id: 'tabs_bar.search', defaultMessage: 'Discover' },
|
||||
});
|
||||
|
||||
const Search: React.FC = () => {
|
||||
|
|
|
@ -51,16 +51,16 @@ const SearchResults = () => {
|
|||
const renderFilterBar = () => {
|
||||
const items = [];
|
||||
items.push(
|
||||
{
|
||||
text: intl.formatMessage(messages.accounts),
|
||||
action: () => selectFilter('accounts'),
|
||||
name: 'accounts',
|
||||
},
|
||||
{
|
||||
text: intl.formatMessage(messages.statuses),
|
||||
action: () => selectFilter('statuses'),
|
||||
name: 'statuses',
|
||||
},
|
||||
{
|
||||
text: intl.formatMessage(messages.accounts),
|
||||
action: () => selectFilter('accounts'),
|
||||
name: 'accounts',
|
||||
},
|
||||
);
|
||||
|
||||
items.push(
|
||||
|
|
|
@ -9,7 +9,7 @@ import { useAppSelector, useAppDispatch } from 'soapbox/hooks';
|
|||
|
||||
const messages = defineMessages({
|
||||
search: { id: 'lists.search', defaultMessage: 'Search among people you follow' },
|
||||
searchTitle: { id: 'tabs_bar.search', defaultMessage: 'Search' },
|
||||
searchTitle: { id: 'tabs_bar.search', defaultMessage: 'Discover' },
|
||||
});
|
||||
|
||||
const Search = () => {
|
||||
|
|
|
@ -6,7 +6,7 @@ import Search from 'soapbox/features/compose/components/search';
|
|||
import SearchResults from 'soapbox/features/compose/components/search-results';
|
||||
|
||||
const messages = defineMessages({
|
||||
heading: { id: 'column.search', defaultMessage: 'Search' },
|
||||
heading: { id: 'column.search', defaultMessage: 'Discover' },
|
||||
});
|
||||
|
||||
const SearchPage = () => {
|
||||
|
|
|
@ -431,7 +431,7 @@
|
|||
"column.reblogs": "Reposts",
|
||||
"column.registration": "Sign Up",
|
||||
"column.scheduled_statuses": "Scheduled Posts",
|
||||
"column.search": "Search",
|
||||
"column.search": "Discover",
|
||||
"column.settings_store": "Settings store",
|
||||
"column.soapbox_config": "Soapbox config",
|
||||
"column.test": "Test timeline",
|
||||
|
@ -1577,7 +1577,7 @@
|
|||
"tabs_bar.more": "More",
|
||||
"tabs_bar.notifications": "Notifications",
|
||||
"tabs_bar.profile": "Profile",
|
||||
"tabs_bar.search": "Search",
|
||||
"tabs_bar.search": "Discover",
|
||||
"tabs_bar.settings": "Settings",
|
||||
"textarea.counter.label": "{count} characters remaining",
|
||||
"theme_editor.colors.accent": "Accent",
|
||||
|
|
|
@ -45,14 +45,14 @@ const ReducerRecord = ImmutableRecord({
|
|||
submittedValue: '',
|
||||
hidden: false,
|
||||
results: ResultsRecord(),
|
||||
filter: 'accounts' as SearchFilter,
|
||||
filter: 'statuses' as SearchFilter,
|
||||
accountId: null as string | null,
|
||||
next: null as string | null,
|
||||
});
|
||||
|
||||
type State = ReturnType<typeof ReducerRecord>;
|
||||
type APIEntities = Array<APIEntity>;
|
||||
export type SearchFilter = 'accounts' | 'statuses' | 'groups' | 'hashtags';
|
||||
export type SearchFilter = 'statuses' | 'accounts' | 'groups' | 'hashtags';
|
||||
|
||||
const toIds = (items: APIEntities = []) => {
|
||||
return ImmutableOrderedSet(items.map(item => item.id));
|
||||
|
@ -62,8 +62,8 @@ const importResults = (state: State, results: APIEntity, searchTerm: string, sea
|
|||
return state.withMutations(state => {
|
||||
if (state.value === searchTerm && state.filter === searchType) {
|
||||
state.set('results', ResultsRecord({
|
||||
accounts: toIds(results.accounts),
|
||||
statuses: toIds(results.statuses),
|
||||
accounts: toIds(results.accounts),
|
||||
groups: toIds(results.groups),
|
||||
hashtags: ImmutableOrderedSet(results.hashtags.map(normalizeTag)), // it's a list of records
|
||||
accountsHasMore: results.accounts.length >= 20,
|
||||
|
@ -144,7 +144,7 @@ export default function search(state = ReducerRecord(), action: AnyAction) {
|
|||
results: ResultsRecord(),
|
||||
submitted: false,
|
||||
submittedValue: '',
|
||||
filter: 'accounts',
|
||||
filter: 'statuses',
|
||||
accountId: null,
|
||||
});
|
||||
return ReducerRecord({ accountId: action.accountId, filter: 'statuses' });
|
||||
|
|
Loading…
Reference in New Issue