Skip to main content

UserPreferences API

The UserPreferences component renders the user preferences menu. The default user preferences comes with a daily restart menu item and a workspace menu item. You can also implement and add your own customized menu items. User preference component

Props​

PropTypeRequiredDefault valueDescription
sectionsobjectYes{"General": General, "Workspaces": Workspaces}The entry names and the corresponding components to render for that entry.

Usage​

You can add your own customized entry name and the component to render for that entry to the sections prop for it to show up in the user preference window:

import { MyCustomizedPreference } from "./MyCustomizedPreference";

const sections = {
General: General,
Workspaces: Workspaces,
"My Entry": MyCustomizedPreference,
};

Here's how the <UserPreferences> component is used in the default seed project:

import { UserPreferences, General, Workspaces } from "@finsemble/finsemble-core";

const sections = {
General: General,
Workspaces: Workspaces,
};

ReactDOM.render(<UserPreferences sections={sections} />, document.getElementById("UserPreferences-component-wrapper"));