Skip to content

Commit

Permalink
feat: #2174 coming soon section in marketplace
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuong Vu committed Jul 27, 2020
1 parent 345140f commit 9250288
Show file tree
Hide file tree
Showing 14 changed files with 1,054 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ComingSoonApps should match a snapshot 1`] = `
<Component
isMultiLine={true}
>
<Component
key=""
>
<div
className="card"
>
<div
className="card-image"
>
<img
className="image"
onError={[Function]}
src=""
/>
</div>
</div>
</Component>
<Component
key=""
>
<div
className="card"
>
<div
className="card-image"
>
<img
className="image"
onError={[Function]}
src=""
/>
</div>
</div>
</Component>
<Component
key=""
>
<div
className="card"
>
<div
className="card-image"
>
<img
className="image"
onError={[Function]}
src=""
/>
</div>
</div>
</Component>
<Component
key=""
>
<div
className="card"
>
<div
className="card-image"
>
<img
className="image"
onError={[Function]}
src=""
/>
</div>
</div>
</Component>
<Component
key=""
>
<div
className="card"
>
<div
className="card-image"
>
<img
className="image"
onError={[Function]}
src=""
/>
</div>
</div>
</Component>
<Component
key=""
>
<div
className="card"
>
<div
className="card-image"
>
<img
className="image"
onError={[Function]}
src=""
/>
</div>
</div>
</Component>
<Component
key=""
>
<div
className="card"
>
<div
className="card-image"
>
<img
className="image"
onError={[Function]}
src=""
/>
</div>
</div>
</Component>
<Component
key=""
>
<div
className="card"
>
<div
className="card-image"
>
<img
className="image"
onError={[Function]}
src=""
/>
</div>
</div>
</Component>
<Component
key=""
>
<div
className="card"
>
<div
className="card-image"
>
<img
className="image"
onError={[Function]}
src=""
/>
</div>
</div>
</Component>
</Component>
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as React from 'react'
import { shallow } from 'enzyme'

import ComingSoonApps from '../coming-soon'

describe('ComingSoonApps', () => {
it('should match a snapshot', () => {
expect(shallow(<ComingSoonApps />)).toMatchSnapshot()
})
})
2 changes: 2 additions & 0 deletions packages/marketplace/src/components/pages/apps/apps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { clientFetchAppSummary } from '@/actions/apps'
import styles from '@/styles/pages/apps.scss?mod'
import qs from 'query-string'
import { getNumberOfItems } from '@/utils/browse-app'
import ComingSoonApps from './coming-soon'

export const handleAfterClose = ({ setVisible }) => () => setVisible(false)
export const handleOnChange = history => (page: number) => {
Expand Down Expand Up @@ -105,6 +106,7 @@ export const Apps: React.FunctionComponent = () => {
</>
</TransitionGroup>
</InfiniteScroll>
<ComingSoonApps />
</Section>
</ErrorBoundary>
)
Expand Down
45 changes: 45 additions & 0 deletions packages/marketplace/src/components/pages/apps/coming-soon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import * as React from 'react'
import { GridThreeColItem, Grid } from '@reapit/elements'
import placeHolderImage from '@/assets/images/default-feature-image.jpg'
import comingSoonImage1 from '@/assets/images/coming-soon/1Area.jpg'
import comingSoonImage2 from '@/assets/images/coming-soon/2Starberry.jpg'
import comingSoonImage3 from '@/assets/images/coming-soon/3IAMProperty.jpg'
import comingSoonImage4 from '@/assets/images/coming-soon/4SMS.jpg'
import comingSoonImage5 from '@/assets/images/coming-soon/5Vyomm.jpg'
import comingSoonImage6 from '@/assets/images/coming-soon/6Spectre.jpg'
import comingSoonImage7 from '@/assets/images/coming-soon/7Twentyci.jpg'
import comingSoonImage8 from '@/assets/images/coming-soon/8Zero.jpg'
import comingSoonImage9 from '@/assets/images/coming-soon/9Yomdel.jpg'

export const onImageError = (event: React.SyntheticEvent<HTMLImageElement>) =>
(event.currentTarget.src = placeHolderImage)

const comingSoonImagesList = [
comingSoonImage1,
comingSoonImage2,
comingSoonImage3,
comingSoonImage4,
comingSoonImage5,
comingSoonImage6,
comingSoonImage7,
comingSoonImage8,
comingSoonImage9,
]

const ComingSoonApps: React.FC = () => {
return (
<Grid isMultiLine>
{comingSoonImagesList.map(imgSrc => (
<GridThreeColItem key={imgSrc}>
<div className="card">
<div className="card-image">
<img className="image" src={imgSrc} onError={onImageError} />
</div>
</div>
</GridThreeColItem>
))}
</Grid>
)
}

export default ComingSoonApps

0 comments on commit 9250288

Please sign in to comment.