From 52c4cfc257ae25c04056427db4c84fefc2362aff Mon Sep 17 00:00:00 2001 From: Marcus Eide Date: Wed, 7 Oct 2020 11:30:43 +0200 Subject: [PATCH] Update Readme --- plugins/user-settings/README.md | 35 ++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/plugins/user-settings/README.md b/plugins/user-settings/README.md index 72da278b1e..db0b01681f 100644 --- a/plugins/user-settings/README.md +++ b/plugins/user-settings/README.md @@ -6,27 +6,41 @@ _This plugin was created through the Backstage CLI_ ## About the plugin -This plugin is intended to be used within the [``](https://backstage.io/storybook/?path=/story/sidebar--sample-sidebar). It provides an item to the sidebar that will render an Avatar of the current signed in user, and when clicked display a settings UI where the user can control different settings across the App. +This plugin provides two components, `` is intended to be used within the [``](https://backstage.io/storybook/?path=/story/sidebar--sample-sidebar) and displays the signed-in users profile picture and name. + +The second component is a settings page where the user can control different settings across the App. ## Usage -Add the component to the sidebar: +Add the item to the Sidebar: ```ts -import { UserSettings } from '@backstage/plugin-user-settings'; +import { Settings as SidebarSettings } from '@backstage/plugin-user-settings'; - + ; ``` +Add the page to the App routing: + +```ts +import { Router as SettingsRouter } from '@backstage/plugin-user-settings'; + +const AppRoutes = () => ( + + } /> + +); +``` + ### Props **Auth Providers** -By default, the plugin provides a list of configured authentication providers is fetched from `app-config.yaml` and displayed in the "Auth Providers" tab. +By default, the plugin provides a list of configured authentication providers fetched from `app-config.yaml` and displayed in the "Authentication Providers" tab. If you want to supply your own custom list of Authentication Providers, use the `providerSettings` prop: @@ -34,11 +48,18 @@ If you want to supply your own custom list of Authentication Providers, use the const MyAuthProviders = () => ( - + {someAction} ); -} /> +const AppRoutes = () => ( + + } />} + /> + +); ``` > **Note that the list of providers expects to be rendered within a MUI [``](https://material-ui.com/components/lists/)**