Files
outline/server/presenters/publicTeam.ts
Hemachandar 3edaf4f8ea feat: TOC position for publicly shared docs (#7057)
* feat: TOC position for publicly shared docs

* remove preferences object

* comment

* fix: Allow sidebar position preference without public branding switch

---------

Co-authored-by: Tom Moor <tom.moor@gmail.com>
2024-06-16 17:26:29 -04:00

21 lines
550 B
TypeScript

import { TOCPosition, TeamPreference } from "@shared/types";
import { Team } from "@server/models";
export default function presentPublicTeam(
/** The team to present */
team: Team,
/** Whether the branding is public */
isBrandingPublic: boolean
) {
return {
...(isBrandingPublic
? {
name: team.name,
avatarUrl: team.avatarUrl,
customTheme: team.getPreference(TeamPreference.CustomTheme),
}
: {}),
tocPosition: team.getPreference(TeamPreference.TocPosition) as TOCPosition,
};
}