* 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>
21 lines
550 B
TypeScript
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,
|
|
};
|
|
}
|