wip
This commit is contained in:
parent
9e52a3f082
commit
b9f76b85c0
|
@ -42,7 +42,7 @@ import { computed } from 'vue';
|
|||
import * as Misskey from 'misskey-js';
|
||||
import MkImgWithBlurhash from '../MkImgWithBlurhash.vue';
|
||||
import EmA from './EmA.vue';
|
||||
import { userPage } from '@/filters/user.js';
|
||||
import { userPage } from '@/utils.js';
|
||||
import MkUserOnlineIndicator from '@/components/MkUserOnlineIndicator.vue';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
|
|
19
packages/frontend-embed/src/utils.ts
Normal file
19
packages/frontend-embed/src/utils.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { url } from '@/config.js';
|
||||
|
||||
export const acct = (user: Misskey.Acct) => {
|
||||
return Misskey.acct.toString(user);
|
||||
};
|
||||
|
||||
export const userName = (user: Misskey.entities.User) => {
|
||||
return user.name || user.username;
|
||||
};
|
||||
|
||||
export const userPage = (user: Misskey.Acct, path?: string, absolute = false) => {
|
||||
return `${absolute ? url : ''}/@${acct(user)}${(path ? `/${path}` : '')}`;
|
||||
};
|
Loading…
Reference in a new issue