Skip to content

Commit

Permalink
Add preview
Browse files Browse the repository at this point in the history
  • Loading branch information
BrainMaestro committed Mar 20, 2017
1 parent fd738bd commit 37dce96
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
'use strict';

import React from 'react'
import Preview from './preview'

export const fn = ({ term, display }) => {
display({
title: `Weather in ${term}`,
subtitle: 'Cloudy with a chance of meatballs',
getPreview: () => <Preview city={term} />
})
}
17 changes: 17 additions & 0 deletions src/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { Component, PropTypes } from 'react'

export default class Preview extends Component {
render() {
const { city } = this.props

return (
<div>
{city == 'london' ? 'Endless Rain' : 'Look Outside'}
</div>
)
}
}

Preview.propTypes = {
city: PropTypes.string.isRequired,
}

0 comments on commit 37dce96

Please sign in to comment.