Skip to content
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
16 changes: 6 additions & 10 deletions packages/react-core/src/components/AboutModal/AboutModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { AboutModalBoxCloseButton } from './AboutModalBoxCloseButton';
import { AboutModalBox } from './AboutModalBox';
import { Modal, ModalVariant } from '../Modal';
import { GenerateId } from '../../helpers/GenerateId/GenerateId';
// eslint-disable-next-line camelcase
// import c_about_modal_box_BackgroundImage from '@patternfly/react-tokens/dist/esm/c_about_modal_box_BackgroundImage';

export interface AboutModalProps extends React.HTMLProps<HTMLDivElement> {
/** Content rendered inside the about modal */
Expand Down Expand Up @@ -48,7 +46,7 @@ export const AboutModal: React.FunctionComponent<AboutModalProps> = ({
onClose = (_e): any => undefined,
productName,
trademark,
// backgroundImageSrc,
backgroundImageSrc,
brandImageSrc,
brandImageAlt,
hasNoContentContainer = false,
Expand Down Expand Up @@ -89,13 +87,11 @@ export const AboutModal: React.FunctionComponent<AboutModalProps> = ({
hasNoBodyWrapper
>
<AboutModalBox
// style={
/* eslint-disable camelcase */
// backgroundImageSrc
// ? { [c_about_modal_box_BackgroundImage.name as string]: `url(${backgroundImageSrc})` }
// : {}
/* eslint-enable camelcase */
// }
style={
backgroundImageSrc
? { ['--pf-v5-c-about-modal-box--BackgroundImage']: `url(${backgroundImageSrc})` } as React.CSSProperties
: {}
}
className={css(className)}
>
<AboutModalBoxBrand src={brandImageSrc} alt={brandImageAlt} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,3 @@ import bgImg from './patternfly-orb.svg';
```ts file="./AboutModalComplexUserPositionedContent.tsx"
```

### Custom background image
```ts file="./AboutModalCustomBackgroundImage.tsx"
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import brandImg from './brandImg.svg';
export const AboutModalBasic: React.FunctionComponent = () => {
const [isModalOpen, setIsModalOpen] = React.useState(false);

const toggleModal = (_event: React.MouseEvent) => {
const toggleModal = (_event: React.MouseEvent<Element, MouseEvent> | KeyboardEvent | MouseEvent) => {
setIsModalOpen(!isModalOpen);
};

Expand All @@ -16,10 +16,11 @@ export const AboutModalBasic: React.FunctionComponent = () => {
</Button>
<AboutModal
isOpen={isModalOpen}
onClose={(e: React.MouseEvent<Element, MouseEvent>) => toggleModal(e)}
onClose={(e: React.MouseEvent<Element, MouseEvent> | KeyboardEvent | MouseEvent) => toggleModal(e)}
trademark="Trademark and copyright information here"
brandImageSrc={brandImg}
brandImageAlt="Patternfly Logo"
backgroundImageSrc='/assets/images/pfbg-icon.svg'
productName="Product Name"
>
<TextContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import brandImg from './brandImg.svg';
export const AboutModalComplexUserPositionedContent: React.FunctionComponent = () => {
const [isModalOpen, setIsModalOpen] = React.useState(false);

const toggleModal = (_event: React.MouseEvent) => {
const toggleModal = (_event: React.MouseEvent<Element, MouseEvent> | KeyboardEvent | MouseEvent) => {
setIsModalOpen(!isModalOpen);
};

Expand All @@ -16,10 +16,11 @@ export const AboutModalComplexUserPositionedContent: React.FunctionComponent = (
</Button>
<AboutModal
isOpen={isModalOpen}
onClose={(e: React.MouseEvent<Element, MouseEvent>) => toggleModal(e)}
onClose={(e: React.MouseEvent<Element, MouseEvent> | KeyboardEvent | MouseEvent) => toggleModal(e)}
trademark="Trademark and copyright information here"
brandImageSrc={brandImg}
brandImageAlt="Patternfly Logo"
backgroundImageSrc='/assets/images/pfbg-icon.svg'
hasNoContentContainer={true}
productName="Product Name"
>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import brandImg from './brandImg.svg';
export const AboutModalWithoutProductName: React.FunctionComponent = () => {
const [isModalOpen, setIsModalOpen] = React.useState(false);

const toggleModal = (_event: React.MouseEvent) => {
const toggleModal = (_event: React.MouseEvent<Element, MouseEvent> | KeyboardEvent | MouseEvent) => {
setIsModalOpen(!isModalOpen);
};

Expand All @@ -16,10 +16,11 @@ export const AboutModalWithoutProductName: React.FunctionComponent = () => {
</Button>
<AboutModal
isOpen={isModalOpen}
onClose={(event: any) => toggleModal(event)}
onClose={(e: React.MouseEvent<Element, MouseEvent> | KeyboardEvent | MouseEvent) => toggleModal(e)}
trademark="Trademark and copyright information here"
brandImageSrc={brandImg}
brandImageAlt="Patternfly Logo"
backgroundImageSrc='/assets/images/pfbg-icon.svg'
aria-label="No product name about modal"
>
<TextContent>
Expand Down