mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-08 15:16:52 +02:00
Add property list
This commit is contained in:
@@ -31,6 +31,7 @@ const App = () => {
|
||||
<DetailsLoader pattern="Previous next buttons" />
|
||||
</Route>
|
||||
<Route exact={true} path='/pricing-table'><DetailsLoader pattern="Pricing table" /></Route>
|
||||
<Route exact={true} path='/property-list'><DetailsLoader pattern="Property list" /></Route>
|
||||
<Route exact={true} path='/progress-bar'><DetailsLoader pattern="Progress bar" /></Route>
|
||||
<Route exact={true} path='/questions-and-answers'>
|
||||
<DetailsLoader pattern="Questions and answers" />
|
||||
|
@@ -87,6 +87,7 @@ const Home = () => {
|
||||
<CoverCard pattern={Pattern.Pagination} />
|
||||
<CoverCard pattern={Pattern.PreviousNextButtons} />
|
||||
<CoverCard pattern={Pattern.PricingTable} />
|
||||
<CoverCard pattern={Pattern.PropertyList} />
|
||||
<CoverCard pattern={Pattern.ProgressBar} />
|
||||
<CoverCard pattern={Pattern.QuestionsAndAnswers} />
|
||||
<CoverCard pattern={Pattern.RadioSwitch} />
|
||||
|
@@ -17,6 +17,7 @@ enum Pattern {
|
||||
Pagination = 'Pagination',
|
||||
PreviousNextButtons = 'Previous next buttons',
|
||||
PricingTable = 'Pricing table',
|
||||
PropertyList = 'Property list',
|
||||
ProgressBar = 'Progress bar',
|
||||
QuestionsAndAnswers = 'Questions and answers',
|
||||
RadioSwitch = 'Radio switch',
|
||||
|
@@ -1,5 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import RelatedPatterns from '../../components/RelatedPatterns';
|
||||
import Pattern from '../../constants/Pattern';
|
||||
import DetailsLayout from '../../layouts/DetailsLayout';
|
||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||
import Circle from '../../placeholders/Circle';
|
||||
@@ -108,6 +110,7 @@ const Details: React.FC<{}> = () => {
|
||||
`}
|
||||
/>
|
||||
</div>
|
||||
<RelatedPatterns patterns={[Pattern.PropertyList]} />
|
||||
</DetailsLayout>
|
||||
);
|
||||
};
|
||||
|
30
client/patterns/property-list/Cover.tsx
Normal file
30
client/patterns/property-list/Cover.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import React from 'react';
|
||||
|
||||
import Circle from '../../placeholders/Circle';
|
||||
import Frame from '../../placeholders/Frame';
|
||||
import Rectangle from '../../placeholders/Rectangle';
|
||||
|
||||
const Cover: React.FC<{}> = () => {
|
||||
return (
|
||||
<Frame>
|
||||
<div className="h-100 flex flex-column items-center justify-center pa3">
|
||||
<div className="w-100">
|
||||
<div className="bb b--black-30 pv1 flex items-center justify-between">
|
||||
<div className="w-60"><Rectangle height={8} /></div>
|
||||
<Circle size={12} />
|
||||
</div>
|
||||
<div className="bb b--black-30 pv1 flex items-center justify-between">
|
||||
<div className="w-20"><Rectangle height={8} /></div>
|
||||
<Circle size={12} />
|
||||
</div>
|
||||
<div className="bb b--black-30 pv1 flex items-center justify-between">
|
||||
<div className="w-40"><Rectangle height={8} /></div>
|
||||
<Circle size={12} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Frame>
|
||||
);
|
||||
};
|
||||
|
||||
export default Cover;
|
109
client/patterns/property-list/Details.tsx
Normal file
109
client/patterns/property-list/Details.tsx
Normal file
@@ -0,0 +1,109 @@
|
||||
import React from 'react';
|
||||
|
||||
import Heading from '../../components/Heading';
|
||||
import RelatedPatterns from '../../components/RelatedPatterns';
|
||||
import Pattern from '../../constants/Pattern';
|
||||
import DetailsLayout from '../../layouts/DetailsLayout';
|
||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||
import Circle from '../../placeholders/Circle';
|
||||
import Rectangle from '../../placeholders/Rectangle';
|
||||
|
||||
const Details: React.FC<{}> = () => {
|
||||
const Item: React.FC<{}> = ({ children }) => {
|
||||
return (
|
||||
<dl
|
||||
style={{
|
||||
alignItems: 'center',
|
||||
borderBottom: '1px solid rgba(0, 0, 0, 0.3)',
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
margin: 0,
|
||||
padding: '8px 0',
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</dl>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<DetailsLayout title="Property list">
|
||||
<div className="ph4 pv5">
|
||||
<BrowserFrame
|
||||
content={(
|
||||
<div className="h-100 flex flex-column items-center justify-center">
|
||||
<div style={{ width: '40%' }}>
|
||||
<Item>
|
||||
<dt style={{ width: '80%' }}><Rectangle /></dt>
|
||||
<dd><Circle /></dd>
|
||||
</Item>
|
||||
<Item>
|
||||
<dt style={{ width: '60%' }}><Rectangle /></dt>
|
||||
<dd><Circle /></dd>
|
||||
</Item>
|
||||
<Item>
|
||||
<dt style={{ width: '30%' }}><Rectangle /></dt>
|
||||
<dd><Circle /></dd>
|
||||
</Item>
|
||||
<Item>
|
||||
<dt style={{ width: '50%' }}><Rectangle /></dt>
|
||||
<dd><Circle /></dd>
|
||||
</Item>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
source={`
|
||||
<dl style="
|
||||
/* Content is center horizontally */
|
||||
align-items: center;
|
||||
display: flex;
|
||||
|
||||
/*
|
||||
The property name will stick to the left, and the value
|
||||
will stick to the right
|
||||
*/
|
||||
justify-content: space-between;
|
||||
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
|
||||
|
||||
/* Spacing */
|
||||
margin: 0px;
|
||||
padding: 8px 0px;
|
||||
">
|
||||
<!-- Property name -->
|
||||
<dt>...</dt>
|
||||
|
||||
<!-- Property value -->
|
||||
<dd>...</dd>
|
||||
</dl>
|
||||
`}
|
||||
/>
|
||||
</div>
|
||||
<section>
|
||||
<Heading title="Use cases" />
|
||||
|
||||
<div style={{ padding: '64px', width: '500px' }}>
|
||||
<Item>
|
||||
<dt>Name</dt>
|
||||
<dd>WebAssembly in Action</dd>
|
||||
</Item>
|
||||
<Item>
|
||||
<dt>Author</dt>
|
||||
<dd>Gerard Gallant</dd>
|
||||
</Item>
|
||||
<Item>
|
||||
<dt>Publishing date</dt>
|
||||
<dd>November 2019</dd>
|
||||
</Item>
|
||||
<Item>
|
||||
<dt>ISBN</dt>
|
||||
<dd>9781617295744</dd>
|
||||
</Item>
|
||||
</div>
|
||||
</section>
|
||||
<RelatedPatterns patterns={[Pattern.Menu]} />
|
||||
</DetailsLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default Details;
|
Reference in New Issue
Block a user