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>
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
import { TeamPreference } from "@shared/types";
|
||||
import { TOCPosition, TeamPreference } from "@shared/types";
|
||||
import { Team } from "@server/models";
|
||||
|
||||
export default function presentPublicTeam(team: Team) {
|
||||
export default function presentPublicTeam(
|
||||
/** The team to present */
|
||||
team: Team,
|
||||
/** Whether the branding is public */
|
||||
isBrandingPublic: boolean
|
||||
) {
|
||||
return {
|
||||
name: team.name,
|
||||
avatarUrl: team.avatarUrl,
|
||||
customTheme: team.getPreference(TeamPreference.CustomTheme),
|
||||
...(isBrandingPublic
|
||||
? {
|
||||
name: team.name,
|
||||
avatarUrl: team.avatarUrl,
|
||||
customTheme: team.getPreference(TeamPreference.CustomTheme),
|
||||
}
|
||||
: {}),
|
||||
tocPosition: team.getPreference(TeamPreference.TocPosition) as TOCPosition,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user