Skip to content

Commit

Permalink
example code updates..
Browse files Browse the repository at this point in the history
  • Loading branch information
carloluis committed Dec 26, 2017
1 parent 7d4b0cf commit 2a24e36
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
5 changes: 1 addition & 4 deletions example/components/ExUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ class ExUpdate extends React.Component {

return (
<div style={{ padding: '10px 0 160px' }}>
<Section
title="Suggestor Props"
description="Updating props (value, suggestions list)"
>
<Section title="Suggestor Props" description="Updating props (value, suggestions list)">
<SSuggestor
value={value}
list={suggestions}
Expand Down
1 change: 1 addition & 0 deletions example/components/Example.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const Example = () => (
<div>
<Section title="Code Example">
<pre>{`<Suggestor list={['list', 'of', 'suggestions', ...]} style={{width:'100%'}} />`}</pre>
<a href="https://codepen.io/carloluis/pen/rjpLYw">CodePen</a>
</Section>

<Section
Expand Down
19 changes: 4 additions & 15 deletions example/components/Section.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';

const PADDING_STYLE = { padding: '10px 0' };

const Section = ({ title, description = '', children }) => (
<div style={PADDING_STYLE}>
<h4>
{title}
</h4>
<div>
{children}
</div>
{
!!description &&
<p style={PADDING_STYLE}>
{description}
</p>
}
<div style={{ padding: '10px 0' }}>
<h4>{title}</h4>
<div>{children}</div>
{!!description && <p style={{ padding: '10px' }}>{description}</p>}
</div>
);

Expand Down
7 changes: 4 additions & 3 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<style>
:root {
--light-blue: #5EBDF7;
--blue: #1187B9;
--grey: #eaeaea;
--white: #FFF;
}
Expand All @@ -23,7 +24,7 @@
}

header {
background-color: var(--light-blue);
background-color: var(--blue);
}

header .container {
Expand All @@ -39,10 +40,10 @@
padding: 10px;
}

@media only screen and (max-width: 640px) {
@media only screen and (max-width: 720px) {
.container {
padding: 24px 4px 0;
max-width: 95%;
max-width: 90%;
}
}
</style>
Expand Down

0 comments on commit 2a24e36

Please sign in to comment.