Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OCMUI-1145] PreviewBadge: allow ReactNode content #2560

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libs/ui-lib/lib/common/components/ui/DeveloperPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import React from 'react';
import { useTranslation } from '../../hooks/use-translation-wrapper';
import { PreviewBadge, PreviewBadgeProps } from './PreviewBadge';

export type DeveloperPreviewProps = Omit<PreviewBadgeProps, 'text' | 'popoverText'>;
export type DeveloperPreviewProps = Omit<PreviewBadgeProps, 'text' | 'popoverContent'>;

export const DeveloperPreview: React.FC<DeveloperPreviewProps> = (props) => {
const { t } = useTranslation();
return (
<PreviewBadge
text={t('ai:Developer Preview')}
popoverText={t(
popoverContent={t(
'ai:Developer preview features are not intended to be used in production environments. The clusters deployed with the developer preview features are considered to be development clusters and are not supported through the Red Hat Customer Portal case management system.',
)}
{...props}
Expand Down
6 changes: 3 additions & 3 deletions libs/ui-lib/lib/common/components/ui/PreviewBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export type PreviewBadgeProps = {
className?: string;
text: string;
externalLink?: string;
popoverText: string;
popoverContent: React.ReactNode;
} & WithTestID;

export const PreviewBadge: React.FC<PreviewBadgeProps> = ({
position = PreviewBadgePosition.inline,
className = 'pf-v5-u-ml-md',
text,
popoverText,
popoverContent,
externalLink,
testId,
}) => {
Expand All @@ -39,7 +39,7 @@ export const PreviewBadge: React.FC<PreviewBadgeProps> = ({
}
const bodyContent = (
<>
<div style={{ marginBottom: 'var(--pf-v5-global--spacer--sm)' }}>{popoverText}</div>
<div style={{ marginBottom: 'var(--pf-v5-global--spacer--sm)' }}>{popoverContent}</div>
{externalLink && (
<>
<ExternalLink href={externalLink}>{t('ai:Learn more')}</ExternalLink>
Expand Down
4 changes: 2 additions & 2 deletions libs/ui-lib/lib/common/components/ui/TechnologyPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PreviewBadge, PreviewBadgeProps } from './PreviewBadge';

export type TechnologyPreviewProps = Omit<
PreviewBadgeProps,
'text' | 'popoverText' | 'externalLink'
'text' | 'popoverContent' | 'externalLink'
>;

export const TechnologyPreview: React.FC<TechnologyPreviewProps> = (props) => {
Expand All @@ -14,7 +14,7 @@ export const TechnologyPreview: React.FC<TechnologyPreviewProps> = (props) => {
return (
<PreviewBadge
text={t('ai:Technology Preview')}
popoverText={t(
popoverContent={t(
'ai:Technology preview features provide early access to upcoming product innovations, enabling you to test functionality and provide feedback during the development process.',
)}
externalLink={TECH_SUPPORT_LEVEL_LINK}
Expand Down
Loading