diff --git a/app/components/SeatingMap.js b/app/components/SeatingMap.js new file mode 100644 index 0000000..b9b1fe1 --- /dev/null +++ b/app/components/SeatingMap.js @@ -0,0 +1,64 @@ +import React from 'react' + +const buildSectionElements = (sections) => { + return sections.map((section, index) => { + const seatElements = section.seats.map((seat) => ( + + + + )) + + return {seatElements} + }) +} + +export default class extends React.Component { + render() { + const { sections } = this.props + const sectionElements = buildSectionElements(sections) + + return( + + + + + + + + + + + + + { sectionElements } + + ) + } +} diff --git a/app/views/seats/index.js b/app/views/seats/index.js index d4c6d11..87f49ed 100644 --- a/app/views/seats/index.js +++ b/app/views/seats/index.js @@ -1,29 +1,8 @@ import React from 'react' -import Layout from '../../components/Layout' import SeatDialog from '../../components/SeatDialog' import Cart from '../../components/Cart' - -const buildSectionElements = (sections) => { - return sections.map((section, index) => { - const seatElements = section.seats.map((seat) => ( - - - - )) - - return {seatElements} - }) -} +import SeatingMap from '../../components/SeatingMap' +import Layout from '../../components/Layout' export default (props) => { const { @@ -33,8 +12,6 @@ export default (props) => { seat, } = props - const sectionElements = buildSectionElements(sections) - return ( @@ -49,39 +26,8 @@ export default (props) => { className="syos-frame" >
- - - - - - - - - - - - - { sectionElements } - +
-