FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(Gallery): Convert gallery to typescript by jessiehuff · Pull Request #2432 · patternfly/patternfly-react · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .js  (3) .md  (1) .snap  (1) .ts  (7) .tsx  (4) All 5 file types selected
Deleted files Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
      • Gallery.d.ts
      • Gallery.js
      • Gallery.test.tsx
      • Gallery.tsx
      • GalleryItem.d.ts
      • GalleryItem.js
      • GalleryItem.tsx
        • Gallery.md
      • index.d.ts
      • index.js
      • index.ts
        • gallery.spec.ts
        • Demos.ts
            • GalleryDemo.tsx
          • index.ts

This file was deleted.

This file was deleted.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Gallery from './Gallery';
import * as React from 'react';
import { Gallery } from './Gallery';
import { GutterSize } from '../../styles/gutters';
import { shallow } from 'enzyme';

Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as React from 'react';
import { css } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/layouts/Gallery/gallery';

export interface GalleryProps extends React.HTMLProps<HTMLDivElement> {
/** content rendered inside the Gallery layout */
children?: React.ReactNode;
/** additional classes added to the Gallery layout */
className?: string;
/** Adds space between children. */
gutter?: 'sm' | 'md' | 'lg';
}
export const Gallery: React.FunctionComponent<GalleryProps> = ({
children = null,
className = '',
gutter = null,
...props
}: GalleryProps) => (
<div
className={css(styles.gallery, gutter && styles.modifiers.gutter, className)}
{...props}
>
{children}
</div>
);

This file was deleted.

This file was deleted.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as React from 'react';

export interface GalleryItemProps extends React.HTMLProps<HTMLDivElement> {
/** content rendered inside the Gallery Item */
children?: React.ReactNode;
}

export const GalleryItem: React.FunctionComponent<GalleryItemProps> = ({
children = null,
...props
}: GalleryItemProps) => (
<div {...props}>{children}</div>
);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: 'Gallery'
cssPrefix: 'pf-l-gallery'
section: 'layouts'
propComponents: ['Gallery', 'GalleryItem']
typescript: true
---

import { Gallery, GalleryItem } from '@patternfly/react-core';
Expand Down

This file was deleted.

This file was deleted.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './Gallery';
export * from './GalleryItem';
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
describe('Gallery Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/');
cy.get('#gallery-demo-nav-item-link').click();
cy.url().should('eq', 'http://localhost:3000/gallery-demo-nav-link');
});
it('Verify gallery item', () => {
cy.get('.pf-c-page__main-section').find('div').first().should('have.class', 'pf-l-gallery');
})

it('Verify gutters', () => {
cy.get('.pf-l-gallery').should('have.class', 'pf-m-gutter');
});
});
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ export const Demos: DemoInterface[] = [
name: 'Form Select Demo',
componentType: Examples.FormSelectDemo
},
{
id: 'gallery-demo',
name: 'Gallery Demo',
componentType: Examples.GalleryDemo
},
{
id: 'input-group-demo',
name: 'Input Group Demo',
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { Gallery, GalleryItem } from '@patternfly/react-core';

export class GalleryDemo extends React.Component {
render() {
return (
<Gallery gutter="md">
<GalleryItem>Gallery Item</GalleryItem>
<GalleryItem>Gallery Item</GalleryItem>
<GalleryItem>Gallery Item</GalleryItem>
<GalleryItem>Gallery Item</GalleryItem>
<GalleryItem>Gallery Item</GalleryItem>
<GalleryItem>Gallery Item</GalleryItem>
</Gallery>
)
}
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ export * from './ClipboardCopyDemo/ClipboardCopyDemo';
export * from './ContextSelectorDemo/ContextSelectorDemo';
export * from './DataListDemo/DataListDemo';
export * from './EmptyStateDemo/EmptyStateDemo';
export * from './FormDemo/FormDemo';
export * from './FormSelectDemo/FormSelectDemo';
export * from './InputGroupDemo/InputGroupDemo';
export * from './FormDemo/FormDemo';
export * from './FormSelectDemo/FormSelectDemo';
export * from './GalleryDemo/GalleryDemo';
export * from './InputGroupDemo/InputGroupDemo';
export * from './LabelDemo/LabelDemo';
export * from './ListDemo/ListDemo';
export * from './LoginPageDemo/LoginPageDemo';
Expand Down

Back | FazBrowse Home | New Git URL