mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 01:52:42 +03:00
leap: restore app index, remove from default
This commit is contained in:
parent
8559d9d7de
commit
a2fbf8c51c
@ -4,6 +4,7 @@ import { cite } from '~/logic/lib/util';
|
|||||||
['commands', []],
|
['commands', []],
|
||||||
['subscriptions', []],
|
['subscriptions', []],
|
||||||
['groups', []],
|
['groups', []],
|
||||||
|
['apps', []],
|
||||||
['other', []]
|
['other', []]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -28,6 +29,29 @@ const commandIndex = function (currentGroup) {
|
|||||||
return commands;
|
return commands;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const appIndex = function (apps) {
|
||||||
|
// all apps are indexed from launch data
|
||||||
|
// indexed into 'apps'
|
||||||
|
const applications = [];
|
||||||
|
Object.keys(apps)
|
||||||
|
.filter((e) => {
|
||||||
|
return apps[e]?.type?.basic;
|
||||||
|
})
|
||||||
|
.sort((a, b) => {
|
||||||
|
return a.localeCompare(b);
|
||||||
|
})
|
||||||
|
.map((e) => {
|
||||||
|
const obj = result(
|
||||||
|
apps[e].type.basic.title,
|
||||||
|
apps[e].type.basic.linkedUrl,
|
||||||
|
apps[e].type.basic.title,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
applications.push(obj);
|
||||||
|
});
|
||||||
|
return applications;
|
||||||
|
};
|
||||||
|
|
||||||
const otherIndex = function() {
|
const otherIndex = function() {
|
||||||
const other = [];
|
const other = [];
|
||||||
other.push(result('Home', '/~landscape/home', 'home', null));
|
other.push(result('Home', '/~landscape/home', 'home', null));
|
||||||
@ -91,6 +115,7 @@ export default function index(associations, apps, currentGroup, groups) {
|
|||||||
indexes.set('commands', commandIndex(currentGroup));
|
indexes.set('commands', commandIndex(currentGroup));
|
||||||
indexes.set('subscriptions', subscriptions);
|
indexes.set('subscriptions', subscriptions);
|
||||||
indexes.set('groups', landscape);
|
indexes.set('groups', landscape);
|
||||||
|
indexes.set('apps', appIndex(apps));
|
||||||
indexes.set('other', otherIndex());
|
indexes.set('other', otherIndex());
|
||||||
|
|
||||||
return indexes;
|
return indexes;
|
||||||
|
@ -55,7 +55,7 @@ export class Omnibox extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getSearchedCategories() {
|
getSearchedCategories() {
|
||||||
return ['commands', 'groups', 'subscriptions', 'other'];
|
return ['commands', 'groups', 'subscriptions', 'apps', 'other'];
|
||||||
}
|
}
|
||||||
|
|
||||||
control(evt) {
|
control(evt) {
|
||||||
@ -106,9 +106,6 @@ export class Omnibox extends Component {
|
|||||||
if (!this.state) {
|
if (!this.state) {
|
||||||
return [category, []];
|
return [category, []];
|
||||||
}
|
}
|
||||||
if (category === 'apps') {
|
|
||||||
return ['apps', this.state.index.get('apps')];
|
|
||||||
}
|
|
||||||
if (category === 'other') {
|
if (category === 'other') {
|
||||||
return ['other', this.state.index.get('other')];
|
return ['other', this.state.index.get('other')];
|
||||||
}
|
}
|
||||||
|
@ -31,9 +31,7 @@ export class OmniboxResult extends Component {
|
|||||||
|
|
||||||
let graphic = <div />;
|
let graphic = <div />;
|
||||||
if (defaultApps.includes(icon.toLowerCase()) || icon.toLowerCase() === 'links') {
|
if (defaultApps.includes(icon.toLowerCase()) || icon.toLowerCase() === 'links') {
|
||||||
icon = (icon === 'Dojo') ? 'ChevronEast' : icon;
|
|
||||||
icon = (icon === 'Link') ? 'Links' : icon;
|
icon = (icon === 'Link') ? 'Links' : icon;
|
||||||
|
|
||||||
graphic = <Icon display="inline-block" verticalAlign="middle" icon={icon} mr='2' size='16px' color={iconFill} />;
|
graphic = <Icon display="inline-block" verticalAlign="middle" icon={icon} mr='2' size='16px' color={iconFill} />;
|
||||||
} else if (icon === 'logout') {
|
} else if (icon === 'logout') {
|
||||||
graphic = <Icon display="inline-block" verticalAlign="middle" icon='ArrowWest' mr='2' size='16px' color={iconFill} />;
|
graphic = <Icon display="inline-block" verticalAlign="middle" icon='ArrowWest' mr='2' size='16px' color={iconFill} />;
|
||||||
@ -42,7 +40,7 @@ export class OmniboxResult extends Component {
|
|||||||
} else if (icon === 'home') {
|
} else if (icon === 'home') {
|
||||||
graphic = <Icon display='inline-block' verticalAlign='middle' icon='Circle' mr='2' size='16px' color={iconFill} />;
|
graphic = <Icon display='inline-block' verticalAlign='middle' icon='Circle' mr='2' size='16px' color={iconFill} />;
|
||||||
} else {
|
} else {
|
||||||
graphic = <Icon verticalAlign="middle" mr='2' size="16px" color={iconFill} />;
|
graphic = <Icon icon='NullIcon' verticalAlign="middle" mr='2' size="16px" color={iconFill} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return graphic;
|
return graphic;
|
||||||
|
Loading…
Reference in New Issue
Block a user