Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-19 11:50:00 +02:00
parent c721cfc761
commit 2dd66bfe2b
13 changed files with 82 additions and 59 deletions
@@ -16,16 +16,13 @@
import React from 'react';
type Classes = {
svg: string;
path: string;
};
type TemplateBackstageLogoProps = {
classes: Classes;
};
export const TemplateBackstageLogo = (props: TemplateBackstageLogoProps) => {
/** @public */
export const TemplateBackstageLogo = (props: {
classes: {
svg: string;
path: string;
};
}) => {
return (
<svg
className={props.classes.svg}
@@ -27,6 +27,7 @@ const useStyles = makeStyles({
},
});
/** @public */
export const TemplateBackstageLogoIcon = () => {
const classes = useStyles();
@@ -23,6 +23,7 @@ import {
DialogTitle,
} from '@material-ui/core';
/** @public */
export const SettingsModal = (props: {
open: boolean;
close: Function;
+12 -3
View File
@@ -28,16 +28,25 @@ export type ComponentRenderer = {
Renderer?: (props: RendererProps) => JSX.Element;
};
type ComponentParts = {
/**
* @public
*/
export type ComponentParts = {
Content: (props?: any) => JSX.Element;
Actions?: () => JSX.Element;
Settings?: () => JSX.Element;
ContextProvider?: (props: any) => JSX.Element;
};
type RendererProps = { title: string } & ComponentParts;
/**
* @public
*/
export type RendererProps = { title: string } & ComponentParts;
type CardExtensionProps<T> = ComponentRenderer & { title?: string } & T;
/**
* @public
*/
export type CardExtensionProps<T> = ComponentRenderer & { title?: string } & T;
/**
* An extension creator to create card based components for the homepage
@@ -27,6 +27,7 @@ type TimeObj = {
label: string;
};
/** @public */
export type ClockConfig = {
label: string;
timeZone: string;
@@ -52,15 +52,6 @@ const useStyles = makeStyles(theme => ({
},
}));
/**
* Props for Toolkit content component {@link Content}.
*
* @public
*/
export type ToolkitContentProps = {
tools: Tool[];
};
/**
* A component to display a list of tools for the user.
*
@@ -85,3 +76,12 @@ export const Content = (props: ToolkitContentProps) => {
</List>
);
};
/**
* Props for Toolkit Content component.
*
* @public
*/
export type ToolkitContentProps = {
tools: Tool[];
};
@@ -16,6 +16,7 @@
import React, { createContext } from 'react';
/** @public */
export type Tool = {
label: string;
url: string;
@@ -17,3 +17,4 @@
export { Content } from './Content';
export type { ToolkitContentProps } from './Content';
export { ContextProvider } from './Context';
export type { Tool } from './Context';
+1 -2
View File
@@ -14,6 +14,5 @@
* limitations under the License.
*/
export * from './CompanyLogo';
export * from './Toolkit';
export type { ToolkitContentProps, Tool } from './Toolkit';
export type { ClockConfig } from './HeaderWorldClock';
+7 -2
View File
@@ -35,6 +35,11 @@ export {
} from './plugin';
export { SettingsModal } from './components';
export * from './assets';
export type { ClockConfig } from './homePageComponents';
export * from './homePageComponents';
export { createCardExtension } from './extensions';
export type { ComponentRenderer } from './extensions';
export type {
CardExtensionProps,
ComponentParts,
ComponentRenderer,
RendererProps,
} from './extensions';
+1 -1
View File
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
createComponentExtension,
createPlugin,
@@ -20,7 +21,6 @@ import {
} from '@backstage/core-plugin-api';
import { createCardExtension } from './extensions';
import { ToolkitContentProps } from './homePageComponents';
import { rootRouteRef } from './routes';
/** @public */