refactor: source

pull/13/head
moonrailgun 4 years ago
parent d69df1c622
commit 1a98d52cb0

@ -84,7 +84,7 @@ const QuickSwitcher: React.FC = React.memo(() => {
'opacity-100': selectedIndex === i, 'opacity-100': selectedIndex === i,
})} })}
> >
{action.key} {action.source}
</div> </div>
</div> </div>
))} ))}

@ -12,6 +12,7 @@ import { getDMConverseName } from 'tailchat-shared';
interface QuickAction { interface QuickAction {
key: string; key: string;
source: string;
label: string; label: string;
action: (context: QuickActionContext) => void; action: (context: QuickActionContext) => void;
} }
@ -19,6 +20,7 @@ interface QuickAction {
const builtinActions: QuickAction[] = [ const builtinActions: QuickAction[] = [
{ {
key: 'personal', key: 'personal',
source: 'core',
label: t('个人主页'), label: t('个人主页'),
action({ navigate }) { action({ navigate }) {
navigate('/main/personal/friends'); navigate('/main/personal/friends');
@ -26,6 +28,7 @@ const builtinActions: QuickAction[] = [
}, },
{ {
key: 'plugins', key: 'plugins',
source: 'core',
label: t('插件中心'), label: t('插件中心'),
action({ navigate }) { action({ navigate }) {
navigate('/main/personal/plugins'); navigate('/main/personal/plugins');
@ -49,6 +52,7 @@ function usePersonalConverseActions(): QuickAction[] {
(converseName): QuickAction => ({ (converseName): QuickAction => ({
key: `qs#converse#${converse._id}`, key: `qs#converse#${converse._id}`,
label: `${t('私信')} ${converseName}`, label: `${t('私信')} ${converseName}`,
source: 'core',
action: ({ navigate }) => { action: ({ navigate }) => {
navigate(`/main/personal/converse/${converse._id}`); navigate(`/main/personal/converse/${converse._id}`);
}, },

Loading…
Cancel
Save