mirror of
https://github.com/Shadowfita/docmost.git
synced 2025-11-21 04:01:03 +10:00
refactor layout
* ui polishing * frontend and backend fixes
This commit is contained in:
@ -4,6 +4,18 @@ const APP_ROUTE = {
|
||||
LOGIN: "/login",
|
||||
SIGNUP: "/signup",
|
||||
},
|
||||
SETTINGS: {
|
||||
ACCOUNT: {
|
||||
PROFILE: "/settings/account/profile",
|
||||
PREFERENCES: "/settings/account/preferences",
|
||||
},
|
||||
WORKSPACE: {
|
||||
GENERAL: "/settings/workspace",
|
||||
MEMBERS: "/settings/members",
|
||||
GROUPS: "/settings/groups",
|
||||
SPACES: "/settings/spaces",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default APP_ROUTE;
|
||||
|
||||
@ -28,9 +28,17 @@ export function getCollaborationUrl(): string {
|
||||
}
|
||||
|
||||
export function getAvatarUrl(avatarUrl: string) {
|
||||
if (!avatarUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (avatarUrl.startsWith("http")) {
|
||||
return avatarUrl;
|
||||
}
|
||||
|
||||
return getBackendUrl() + "/attachments/img/avatar/" + avatarUrl;
|
||||
}
|
||||
|
||||
export function getSpaceUrl(spaceSlug: string) {
|
||||
return "/s/" + spaceSlug;
|
||||
}
|
||||
|
||||
1
apps/client/src/lib/index.ts
Normal file
1
apps/client/src/lib/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from "./utils";
|
||||
15
apps/client/src/lib/utils.ts
Normal file
15
apps/client/src/lib/utils.ts
Normal file
@ -0,0 +1,15 @@
|
||||
export function formatMemberCount(memberCount: number): string {
|
||||
if (memberCount === 1) {
|
||||
return "1 member";
|
||||
} else {
|
||||
return `${memberCount} members`;
|
||||
}
|
||||
}
|
||||
|
||||
export function extractPageSlugId(input: string): string {
|
||||
if (!input) {
|
||||
return undefined;
|
||||
}
|
||||
const parts = input.split("-");
|
||||
return parts.length > 1 ? parts[parts.length - 1] : input;
|
||||
}
|
||||
Reference in New Issue
Block a user