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