Skip to content

Commit

Permalink
seperates showCase section from useCase section
Browse files Browse the repository at this point in the history
  • Loading branch information
rep0x committed Apr 6, 2019
1 parent 63cf974 commit e599128
Show file tree
Hide file tree
Showing 14 changed files with 213 additions and 166 deletions.
Binary file modified public/assets/mockups/vendor/cashier.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/mockups/vendor/dashboard.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/mockups/vendor/order.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/mockups/vendor/product.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/mockups/vendor/settings.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/Components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import '../styles/elements/accordion.scss'
// S E C T I O N S
import '../styles/sections/sections.scss'
import '../styles/sections/hero.scss'
import '../styles/sections/showcase.scss'
import '../styles/sections/use-case.scss'
import '../styles/sections/news.scss'

// N A V C O M P O N E N T S
Expand Down
12 changes: 6 additions & 6 deletions src/Components/Pages/Customer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component, Fragment } from 'react'

import HeroSmall from '../Sections/HeroSmall'
import VideoPromo from '../Sections/VideoPromo'
import UseCase from '../Sections/UseCase'
import ShowCase from '../Sections/ShowCase'

export default class extends Component {
render () {
Expand All @@ -11,11 +11,11 @@ export default class extends Component {
<HeroSmall sectionData={heroSmallData} />
<VideoPromo sectionData={videoPromoData} />

<UseCase sectionData={shopData} />
<UseCase sectionData={productData} />
<UseCase sectionData={cartData} />
<UseCase sectionData={paymentData} />
<UseCase sectionData={deliveryData} />
<ShowCase sectionData={shopData} />
<ShowCase sectionData={productData} />
<ShowCase sectionData={cartData} />
<ShowCase sectionData={paymentData} />
<ShowCase sectionData={deliveryData} />
</Fragment>
)
}
Expand Down
12 changes: 6 additions & 6 deletions src/Components/Pages/Supplier.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component, Fragment } from 'react'

import HeroSmall from '../Sections/HeroSmall'
import VideoPromo from '../Sections/VideoPromo'
import UseCase from '../Sections/UseCase'
import ShowCase from '../Sections/ShowCase'

export default class extends Component {
render () {
Expand All @@ -11,11 +11,11 @@ export default class extends Component {
<HeroSmall sectionData={heroSmallData} />
<VideoPromo sectionData={videoPromoData} />

<UseCase sectionData={dashboardData} />
<UseCase sectionData={findPackagesData} />
<UseCase sectionData={pickupData} />
<UseCase sectionData={deliveryData} />
<UseCase sectionData={buddiesData} />
<ShowCase sectionData={dashboardData} />
<ShowCase sectionData={findPackagesData} />
<ShowCase sectionData={pickupData} />
<ShowCase sectionData={deliveryData} />
<ShowCase sectionData={buddiesData} />
</Fragment>
)
}
Expand Down
12 changes: 6 additions & 6 deletions src/Components/Pages/Vendor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component, Fragment } from 'react'

import HeroSmall from '../Sections/HeroSmall'
import VideoPromo from '../Sections/VideoPromo'
import UseCase from '../Sections/UseCase'
import ShowCase from '../Sections/ShowCase'

export default class extends Component {
render () {
Expand All @@ -11,11 +11,11 @@ export default class extends Component {
<HeroSmall sectionData={heroSmallData} />
<VideoPromo sectionData={videoPromoData} />

<UseCase sectionData={dashboardData} />
<UseCase sectionData={productData} />
<UseCase sectionData={orderData} />
<UseCase sectionData={cashierData} />
<UseCase sectionData={settingsData} />
<ShowCase sectionData={dashboardData} />
<ShowCase sectionData={productData} />
<ShowCase sectionData={orderData} />
<ShowCase sectionData={cashierData} />
<ShowCase sectionData={settingsData} />
</Fragment>
)
}
Expand Down
95 changes: 95 additions & 0 deletions src/Components/Sections/ShowCase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import React, { Component, Fragment } from 'react'
import { Layout, Collapse } from 'element-react'
import { NavLink } from 'react-router-dom'
import Fade from 'react-reveal/Fade'
import '../../styles/sections/show-case.scss'

export default class extends Component {
render () {
console.log(this.props.sectionData);
const sectionData = this.props.sectionData

const id = sectionData.id
const border = sectionData.border
const background = sectionData.background
const title = sectionData.title
const description = sectionData.description

const itemsData = sectionData.items
const items = itemsData.map((item, i) =>
<Collapse.Item key={i} title={<h4><span className="counter">{i + 1}</span>{item.title}</h4>} >
<div>{item.description}</div>
</Collapse.Item>
)

const button = sectionData.button
const link_to = sectionData.link_to
const button_text = sectionData.button_text
let buttonElement
if (button === true) {
buttonElement =
<NavLink
to={link_to}
onClick={this.scrollTop}
className="el-button el-button--primary">
{button_text}
</NavLink>
} else {
buttonElement =
<span></span>
}

const image_type = sectionData.image_type
const image_path = sectionData.image_path
const image_right = sectionData.image_right

const imageElement =
<Layout.Col md='16' lg='12' className={`${image_type}`}>
<img
alt={title}
src={image_path}
className={`mockup`}
/>
</Layout.Col>

return (
<Fragment>
<div
id={id}
className={`
section
section__${background}
${border ? 'section__border-top' : ''}
section--show-case
${image_right ? 'image_right' : ''}
`}
>
<div className="container-fluid">
<Layout.Row>
{image_right ? '' : imageElement}
<Layout.Col md='16' lg='12' className="content-column">
<div className="column-wrapper">
<Fade top>
<h2 style={{marginBottom: 10}}>{title}</h2>
<p style={{marginBottom: 30}}>
{description}
</p>
</Fade>
<Fade bottom>
<div>
<Collapse accordion value="0">
{items}
</Collapse>
{buttonElement}
</div>
</Fade>
</div>
</Layout.Col>
{image_right ? imageElement : ''}
</Layout.Row>
</div>
</div>
</Fragment>
)
}
}
50 changes: 12 additions & 38 deletions src/Components/Sections/UseCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Layout, Collapse } from 'element-react'
import { NavLink } from 'react-router-dom'
import Fade from 'react-reveal/Fade'

import '../../styles/sections/use-case.scss'

export default class extends Component {
scrollTop () {
console.log("Scroll top");
Expand Down Expand Up @@ -41,52 +43,24 @@ export default class extends Component {
<span></span>
}

const image_type = sectionData.image_type
const image_path = sectionData.image_path
const image_right = sectionData.image_right
let imageElement
if (image_type === 'circle') {
imageElement =
<Layout.Col sm="24" md="12" lg="12" className={`${image_right ? 'flex-end' : ''} just-center-mobile`}>
<Fade top>
<img alt={title} src={image_path} className="circle"/>
</Fade>
</Layout.Col>
} else if (image_type === 'desktop') {
imageElement =
<Layout.Col sm="24" md="16" lg="12">
<span style={{opacity: 0}}>a</span>
<Fade bottom>
<img
alt={title}
src={image_path}
className={`mockup ${image_right ? 'mockup--right' : 'mockup--left'}`}
/>
</Fade>
</Layout.Col>
} else {
imageElement =
<Layout.Col sm="24" md="12" lg="12">
<span style={{opacity: 0}}>a</span>
<Fade bottom>
<img
alt={title}
src={image_path}
className={`mockup mockup--mobile ${image_right ? 'mockup--right' : 'mockup--left'} `}
/>
</Fade>
</Layout.Col>
}

const imageElement =
<Layout.Col sm="24" md="12" lg="12" className={`${image_right ? 'flex-end' : ''} just-center-mobile`}>
<Fade top>
<img alt={title} src={image_path} className="circle"/>
</Fade>
</Layout.Col>

return (
<div
id={id}
className={`
section
section--use-case section__${background}
section--use-case
section__${background}
${border ? 'section__border-top' : ''}
${image_type === 'desktop' || 'mobile' ? 'section--showcase' : ''}
${image_type === 'mobile' ? 'mobile' : ''}
`}
>
<div className="container">
Expand All @@ -96,7 +70,7 @@ export default class extends Component {
className={`mobile-align-center ${image_right ? 'flex-reverse-mobile' : ''}`}
>
{image_right ? '' : imageElement}
<Layout.Col xs="24" sm="16" md={image_type === 'desktop' ? '8' : '16'} lg="12">
<Layout.Col xs="24" sm="16" md='12' lg="12">
<Fade top>
<h2 style={{marginBottom: 10}}>{title}</h2>
<p style={{marginBottom: 30}}>
Expand Down
25 changes: 25 additions & 0 deletions src/styles/defaults/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
}
}

.container-fluid {
.content-column {
display: flex;
justify-content: flex-end;
.column-wrapper {
width: 600px;
}
}
}

// ------------------------------------------
// M O B I L E
// ------------------------------------------
Expand All @@ -18,10 +28,25 @@
.container {
width: calc(100% - 60px);
}
.container-fluid {
.el-row {
display: flex;
flex-direction: column;
align-items: center;
}
.content-column {
.column-wrapper {
width: 100%;
}
}
}
}

@media only screen and (max-width: 992px ) {
.container {
width: calc(100% - 50px);
}
.container-fluid {
padding: 0 30px;
}
}
63 changes: 63 additions & 0 deletions src/styles/sections/show-case.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// ------------------------------------------
// S E C T I O N S H O W C A S E
// ------------------------------------------

.section--show-case {
.mockup {
width: 100%;
}
.el-col.mobile {
display: flex;
justify-content: flex-end;
.mockup {
width: auto;
max-height: 800px;
}
}
.content-column {
justify-content: flex-start;
}
&.image_right {
.content-column {
justify-content: flex-end;
}
.el-col.mobile {
justify-content: flex-start;
}
}
}

// ------------------------------------------
// M O B I L E
// ------------------------------------------

@media only screen and (max-width: 1200px ) {
.section--show-case {
&.image_right {
.container-fluid {
.el-row {
flex-direction: column-reverse;
}
}
}
.mockup {
margin: 50px 0;
}
.el-col.mobile {
justify-content: center !important;
.mockup {
max-height: 600px;
}
}
}
}

@media only screen and (max-width: 520px) {
.section--show-case {
.el-col.mobile {
.mockup {
max-height: 500px;
}
}
}
}
Loading

0 comments on commit e599128

Please sign in to comment.