chore: fixing api-docs and simplifying types a little
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -238,9 +238,13 @@ export type ErrorBoundaryFallbackProps = {
|
||||
export const FeatureFlagged: (props: FeatureFlaggedProps) => JSX.Element | null;
|
||||
|
||||
// @public (undocumented)
|
||||
export type FeatureFlaggedProps = FeatureFlaggedSelector & {
|
||||
export type FeatureFlaggedProps = {
|
||||
children: JSX.Element | null;
|
||||
};
|
||||
} & ({
|
||||
with: string;
|
||||
} | {
|
||||
without: string;
|
||||
});
|
||||
|
||||
// @public (undocumented)
|
||||
export const FlatRoutes: (props: FlatRoutesProps) => JSX.Element | null;
|
||||
|
||||
@@ -37,6 +37,7 @@ describe('index', () => {
|
||||
ConfigReader: expect.any(Function),
|
||||
ErrorAlerter: expect.any(Function),
|
||||
ErrorApiForwarder: expect.any(Function),
|
||||
FeatureFlagged: expect.any(Function),
|
||||
GithubAuth: expect.any(Function),
|
||||
GitlabAuth: expect.any(Function),
|
||||
GoogleAuth: expect.any(Function),
|
||||
|
||||
@@ -20,19 +20,10 @@ import {
|
||||
attachComponentData,
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
export type FeatureFlaggedWith = {
|
||||
with: string;
|
||||
};
|
||||
|
||||
export type FeatureFlaggedWithout = {
|
||||
without: string;
|
||||
};
|
||||
|
||||
export type FeatureFlaggedSelector = FeatureFlaggedWith | FeatureFlaggedWithout;
|
||||
export type FeatureFlaggedProps = FeatureFlaggedSelector & {
|
||||
children: JSX.Element | null;
|
||||
};
|
||||
|
||||
export type FeatureFlaggedProps = { children: JSX.Element | null } & (
|
||||
| { with: string }
|
||||
| { without: string }
|
||||
);
|
||||
export const FeatureFlagged = (props: FeatureFlaggedProps) => {
|
||||
const { children } = props;
|
||||
const featureFlagApi = useApi(featureFlagsApiRef);
|
||||
|
||||
Reference in New Issue
Block a user