Skip to content

Commit 769b528

Browse files
authored
Merge pull request #8 from RedHat-UX/NGUI-404-update-readme-and-package
chore(NGUI-404): Update package.json and fix README and
2 parents 2a1c880 + 61fe12d commit 769b528

File tree

3 files changed

+120
-97
lines changed

3 files changed

+120
-97
lines changed

README.md

Lines changed: 45 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -39,42 +39,54 @@ npm install @rhngui/patternfly-react-renderer
3939
### OneCard Component
4040

4141
```jsx
42-
import { OneCardWrapper } from "@rhngui/patternfly-react-renderer";
43-
44-
const mockData = {
45-
title: "Movie Details",
46-
image:
47-
"https://image.tmdb.org/t/p/w440_and_h660_face/uXDfjJbdP4ijW5hWSBrPrlKpxab.jpg",
48-
fields: [
49-
{
50-
name: "Title",
51-
data_path: "movie.title",
52-
data: ["Toy Story"],
53-
},
54-
{
55-
name: "Year",
56-
data_path: "movie.year",
57-
data: [1995],
58-
},
59-
{
60-
name: "Genres",
61-
data_path: "movie.genres",
62-
data: ["Animation", "Adventure"],
63-
},
64-
],
65-
imageSize: "md",
66-
id: "movie-card",
67-
};
42+
import DynamicComponent from "@rhngui/patternfly-react-renderer";
43+
44+
const onecardConfig = {
45+
component: "one-card",
46+
image: "https://image.tmdb.org/t/p/w440_and_h660_face/uXDfjJbdP4ijW5hWSBrPrlKpxab.jpg",
47+
id: "one-card-id",
48+
title: "Toy Story Movie",
49+
fields: [
50+
{
51+
"name": "Title",
52+
"data_path": "$..movie.title",
53+
"data": [
54+
"Toy Story"
55+
]
56+
},
57+
{
58+
"name": "Year",
59+
"data_path": "$..movie.year",
60+
"data": [
61+
1995
62+
]
63+
},
64+
{
65+
"name": "Rating",
66+
"data_path": "$..movie.imdbRating",
67+
"data": [
68+
8.3
69+
]
70+
},
71+
{
72+
"name": "Release Date",
73+
"data_path": "$..movie.released",
74+
"data": [
75+
"2022-11-02"
76+
]
77+
}
78+
]
79+
}
6880

6981
function App() {
70-
return <OneCardWrapper {...mockData} />;
82+
return <DynamicComponent {onecardConfig} />;
7183
}
7284
```
7385

7486
### Image Component
7587

7688
```jsx
77-
import { DynamicComponent } from "@rhngui/patternfly-react-renderer";
89+
import DynamicComponent from "@rhngui/patternfly-react-renderer";
7890

7991
const imageConfig = {
8092
component: "image",
@@ -92,7 +104,7 @@ function App() {
92104
### Table Component
93105

94106
```jsx
95-
import { DynamicComponent } from "@rhngui/patternfly-react-renderer";
107+
import DynamicComponent from "@rhngui/patternfly-react-renderer";
96108

97109
const tableConfig = {
98110
component: "table",
@@ -134,24 +146,24 @@ function App() {
134146
### VideoPlayer Component
135147

136148
```jsx
137-
import { VideoPlayerWrapper } from "@rhngui/patternfly-react-renderer";
149+
import DynamicComponent from "@rhngui/patternfly-react-renderer";
138150

139-
const videoData = {
151+
const videoConfig = {
140152
component: "video-player",
141153
video: "https://www.youtube.com/embed/v-PjgYDrg70",
142154
video_img: "https://img.youtube.com/vi/v-PjgYDrg70/maxresdefault.jpg",
143155
title: "Toy Story Trailer",
144156
};
145157

146158
function App() {
147-
return <VideoPlayerWrapper {...videoData} />;
159+
return <DynamicComponent {videoConfig} />;
148160
}
149161
```
150162

151163
### SetOfCards Component
152164

153165
```jsx
154-
import { DynamicComponent } from "@rhngui/patternfly-react-renderer";
166+
import DynamicComponent from "@rhngui/patternfly-react-renderer";
155167

156168
const setOfCardsConfig = {
157169
component: "set-of-cards",

package-lock.json

Lines changed: 64 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@
1212
"LICENSE"
1313
],
1414
"license": "Apache-2.0",
15+
"contributors": [
16+
"Anuj Rajak <arajak@redhat.com>",
17+
"Hrithik Gavankar <hgavanka@redhat.com>",
18+
"Libor Krzyzanek <lkrzyzan@redhat.com>",
19+
"Vlastimil Elias <velias@redhat.com>",
20+
"Ivana Rodriguez <ivrodrig@redhat.com>",
21+
"Sydney Grant <sgrant@redhat.com>",
22+
"Diwanshi Gadgil <dpandey@redhat.com>",
23+
"Ryszard Kozmik <rkozmik@redhat.com>",
24+
"Nachiket Zadap <nzadap@redhat.com>"
25+
],
1526
"exports": {
1627
"import": "./dist/index.es.js",
1728
"require": "./dist/index.cjs.js"

0 commit comments

Comments
 (0)