Update storybook for Sidebar
This commit is contained in:
@@ -22,14 +22,27 @@ import {
|
||||
SidebarDivider,
|
||||
SidebarSearchField,
|
||||
SidebarSpace,
|
||||
<<<<<<< HEAD
|
||||
SidebarUserSettings,
|
||||
ProviderSettingsItem,
|
||||
=======
|
||||
>>>>>>> a4e66bae0... Update storybook for Sidebar
|
||||
} from '.';
|
||||
import HomeOutlinedIcon from '@material-ui/icons/HomeOutlined';
|
||||
import AddCircleOutlineIcon from '@material-ui/icons/AddCircleOutline';
|
||||
import Star from '@material-ui/icons/Star';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { githubAuthApiRef } from '@backstage/core-api';
|
||||
import {
|
||||
ApiProvider,
|
||||
ApiRegistry,
|
||||
appThemeApiRef,
|
||||
AppThemeSelector,
|
||||
configApiRef,
|
||||
ConfigReader,
|
||||
FeatureFlags,
|
||||
featureFlagsApiRef,
|
||||
} from '@backstage/core-api';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { UserSettings } from '@backstage/plugin-user-settings';
|
||||
|
||||
export default {
|
||||
title: 'Sidebar',
|
||||
@@ -57,15 +70,45 @@ export const SampleSidebar = () => (
|
||||
<SidebarDivider />
|
||||
<SidebarIntro />
|
||||
<SidebarSpace />
|
||||
<SidebarDivider />
|
||||
<SidebarUserSettings
|
||||
providerSettings={
|
||||
<ProviderSettingsItem
|
||||
title="Github"
|
||||
apiRef={githubAuthApiRef}
|
||||
icon={Star}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</Sidebar>
|
||||
);
|
||||
|
||||
const createConfig = () =>
|
||||
ConfigReader.fromConfigs([
|
||||
{
|
||||
context: '',
|
||||
data: {
|
||||
auth: {
|
||||
providers: {
|
||||
google: { development: {} },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const config = createConfig();
|
||||
|
||||
const apis = ApiRegistry.from([
|
||||
[configApiRef, config],
|
||||
[featureFlagsApiRef, new FeatureFlags()],
|
||||
[appThemeApiRef, AppThemeSelector.createWithStorage([])],
|
||||
]);
|
||||
|
||||
export const WithUserSettingsPlugin = () => (
|
||||
<Sidebar>
|
||||
{/* <SidebarLogo /> */}
|
||||
<SidebarSearchField onSearch={handleSearch} />
|
||||
<SidebarDivider />
|
||||
<SidebarItem icon={HomeOutlinedIcon} to="#" text="Home" />
|
||||
<SidebarItem icon={HomeOutlinedIcon} to="#" text="Plugins" />
|
||||
<SidebarItem icon={AddCircleOutlineIcon} to="#" text="Create..." />
|
||||
<SidebarDivider />
|
||||
<SidebarIntro />
|
||||
<SidebarSpace />
|
||||
<SidebarDivider />
|
||||
<ApiProvider apis={apis}>
|
||||
<UserSettings />
|
||||
</ApiProvider>
|
||||
</Sidebar>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user