Skip to content

Commit

Permalink
implement ProductConfigurator in example
Browse files Browse the repository at this point in the history
  • Loading branch information
mbpictures committed Sep 29, 2020
1 parent cee20b4 commit a747e7f
Show file tree
Hide file tree
Showing 17 changed files with 114 additions and 2 deletions.
116 changes: 114 additions & 2 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,122 @@
import React from 'react'

import { ExampleComponent } from 'react-product-configurator'
import { ProductConfigurator } from 'react-product-configurator'
import 'react-product-configurator/dist/index.css'
import {Category} from "../../src";

import CaseDefault from "./img/thumbnail-case.png";
import CaseRed from "./img/case/case-red.png";
import CaseBlue from "./img/case/case-blue.png";
import CaseGreen from "./img/case/case-green.png";
import BeltDefault from "./img/belt/belt-default.png";
import BeltRed from "./img/belt/belt-red.png";
import BeltBlue from "./img/belt/belt-blue.png";
import BeltGreen from "./img/belt/belt-green.png";
import HandleDefault from "./img/handle/handle-default.png";
import HandleRed from "./img/handle/handle-red.png";
import HandleBlue from "./img/handle/handle-blue.png";
import HandleGreen from "./img/handle/handle-green.png";

const App = () => {
return <ExampleComponent text="Create React Library Example 😄" />
let cats: Category[] = [
{
name: "Case",
thumbnail: CaseDefault,
layer: 1,
items: [
{
name: "Default",
thumbnail: CaseDefault,
price: 10.99,
image: CaseDefault,
default: true
},
{
name: "Red",
thumbnail: CaseRed,
price: 15.99,
image: CaseRed
},
{
name: "Blue",
thumbnail: CaseBlue,
price: 15.99,
image: CaseBlue
},
{
name: "Green",
thumbnail: CaseGreen,
price: 15.99,
image: CaseGreen
}
]
},
{
name: "Belt",
thumbnail: BeltDefault,
layer: 0,
items: [
{
name: "Default",
thumbnail: BeltDefault,
price: 10.99,
default: true,
image: BeltDefault
},
{
name: "Red",
thumbnail: BeltRed,
price: 15.99,
image: BeltRed
},
{
name: "Blue",
thumbnail: BeltBlue,
price: 15.99,
image: BeltBlue
},
{
name: "Green",
thumbnail: BeltGreen,
price: 15.99,
image: BeltGreen
}
]
},
{
name: "Handle",
thumbnail: HandleDefault,
layer: 2,
items: [
{
name: "Default",
thumbnail: HandleDefault,
price: 10.99,
default: true,
image: HandleDefault
},
{
name: "Red",
thumbnail: HandleRed,
price: 15.99,
image: HandleRed
},
{
name: "Blue",
thumbnail: HandleBlue,
price: 15.99,
image: HandleBlue
},
{
name: "Green",
thumbnail: HandleGreen,
price: 15.99,
image: HandleGreen
}
]
},
];
return <ProductConfigurator name="Hi!" categories={cats} />
}

export default App
Binary file added example/src/img/belt/belt-blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/belt/belt-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/belt/belt-green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/belt/belt-red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/case/case-blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/case/case-green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/case/case-red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/handle/handle-blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/handle/handle-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/handle/handle-green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/handle/handle-red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/thumbnail-case.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/thumbnails/blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/thumbnails/default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/thumbnails/green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/src/img/thumbnails/red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a747e7f

Please sign in to comment.