1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-11 08:34:27 +02:00

Add Feature comparison pattern

This commit is contained in:
Phuoc Nguyen
2019-12-11 20:51:26 +07:00
parent 7554ea8e87
commit b170a518a7
8 changed files with 243 additions and 3 deletions

View File

@@ -0,0 +1,54 @@
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
style={{
display: 'flex',
flexDirection: 'column',
height: '100%',
justifyContent: 'center',
padding: '8px',
width: '100%',
}}
>
<div style={{ display: 'flex', marginBottom: '8px', width: '100%' }}>
<div style={{ flex: 1, marginRight: '8px' }}>
<Rectangle height={4} />
</div>
<div style={{ display: 'flex', justifyContent: 'center', width: '16px' }}>
<Circle size={4} />
</div>
<div style={{ display: 'flex', justifyContent: 'center', width: '16px' }}>
<Circle size={4} />
</div>
</div>
<div style={{ display: 'flex', marginBottom: '8px', width: '100%' }}>
<div style={{ flex: 1, marginRight: '8px' }}>
<Rectangle height={4} />
</div>
<div style={{ display: 'flex', justifyContent: 'center', width: '16px' }} />
<div style={{ display: 'flex', justifyContent: 'center', width: '16px' }}>
<Circle size={4} />
</div>
</div>
<div style={{ display: 'flex', marginBottom: '8px', width: '100%' }}>
<div style={{ flex: 1, marginRight: '8px' }}>
<Rectangle height={4} />
</div>
<div style={{ display: 'flex', justifyContent: 'center', width: '16px' }}>
<Circle size={4} />
</div>
<div style={{ display: 'flex', justifyContent: 'center', width: '16px' }} />
</div>
</div>
</Frame>
);
};
export default Cover;

View File

@@ -0,0 +1,175 @@
import React from 'react';
import RelatedPatterns from '../../components/RelatedPatterns';
import Pattern from '../../constants/Pattern';
import DetailsLayout from '../../layouts/DetailsLayout';
import Block from '../../placeholders/Block';
import BrowserFrame from '../../placeholders/BrowserFrame';
import Circle from '../../placeholders/Circle';
import Rectangle from '../../placeholders/Rectangle';
const Details: React.FC<{}> = () => {
return (
<DetailsLayout title="Feature comparison">
<div style={{ padding: '64px 32px' }}>
<BrowserFrame
content={(
<div
style={{
alignItems: 'center',
display: 'flex',
height: '100%',
justifyContent: 'center',
}}
>
<div style={{ width: '60%' }}>
<div
style={{
alignItems: 'center',
borderBottom: '1px solid rgba(0, 0, 0, 0.3)',
display: 'flex',
padding: '12px 0',
width: '100%',
}}
>
<div style={{ flex: 1, marginRight: '16px' }}>
<Rectangle />
</div>
<div style={{ display: 'flex', justifyContent: 'center', marginRight: '16px', width: '75px' }}>
<Rectangle />
</div>
<div style={{ display: 'flex', justifyContent: 'center', width: '50px' }}>
<Rectangle />
</div>
</div>
<div
style={{
alignItems: 'center',
borderBottom: '1px solid rgba(0, 0, 0, 0.3)',
display: 'flex',
padding: '8px 0',
width: '100%',
}}
>
<div style={{ flex: 1, marginRight: '16px' }}>
<Block numberOfBlocks={4} />
</div>
<div style={{ display: 'flex', justifyContent: 'center', marginRight: '16px', width: '75px' }}>
<Circle size={8} />
</div>
<div style={{ display: 'flex', justifyContent: 'center', width: '50px' }}>
<Circle size={8} />
</div>
</div>
<div
style={{
alignItems: 'center',
borderBottom: '1px solid rgba(0, 0, 0, 0.3)',
display: 'flex',
padding: '8px 0',
width: '100%',
}}
>
<div style={{ flex: 1, marginRight: '16px' }}>
<Block numberOfBlocks={5} />
</div>
<div style={{ display: 'flex', justifyContent: 'center', marginRight: '16px', width: '75px' }} />
<div style={{ display: 'flex', justifyContent: 'center', width: '50px' }}>
<Circle size={8} />
</div>
</div>
<div
style={{
alignItems: 'center',
borderBottom: '1px solid rgba(0, 0, 0, 0.3)',
display: 'flex',
padding: '8px 0',
width: '100%',
}}
>
<div style={{ flex: 1, marginRight: '16px' }}>
<Block numberOfBlocks={4} />
</div>
<div style={{ display: 'flex', justifyContent: 'center', marginRight: '16px', width: '75px' }}>
<Circle size={8} />
</div>
<div style={{ display: 'flex', justifyContent: 'center', width: '50px' }} />
</div>
<div
style={{
alignItems: 'center',
borderBottom: '1px solid rgba(0, 0, 0, 0.3)',
display: 'flex',
padding: '8px 0',
width: '100%',
}}
>
<div style={{ flex: 1, marginRight: '16px' }}>
<Block numberOfBlocks={6} />
</div>
<div style={{ display: 'flex', justifyContent: 'center', marginRight: '16px', width: '75px' }}>
<Circle size={8} />
</div>
<div style={{ display: 'flex', justifyContent: 'center', width: '50px' }} />
</div>
</div>
</div>
)}
source={`
<div style="
align-items: center;
display: flex;
/* Bottom border */
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
/* Spacing */
padding: 12px 0px;
">
<!-- Feature name -->
<div style="
/* Take available width */
flex: 1;
/* Spacing */
margin-right: 16px;
">
...
</div>
<!-- The model -->
<div style="
/* Center the content */
display: flex;
justify-content: center;
/* Spacing */
margin-right: 16px;
">
<!--
For the first row: display the model name (Basic, Pro, etc.)
From the second row: display a yes/no icon indicating the feature is available or not
-->
...
</div>
<!-- Repeated other models -->
...
</div>
<!-- Repeated items -->
...
`}
/>
</div>
<RelatedPatterns patterns={[Pattern.FeatureList, Pattern.PricingTable]} />
</DetailsLayout>
);
};
export default Details;

View File

@@ -1,5 +1,7 @@
import React from 'react';
import RelatedPatterns from '../../components/RelatedPatterns';
import Pattern from '../../constants/Pattern';
import DetailsLayout from '../../layouts/DetailsLayout';
import Block from '../../placeholders/Block';
import BrowserFrame from '../../placeholders/BrowserFrame';
@@ -70,6 +72,8 @@ const Details: React.FC<{}> = () => {
`}
/>
</div>
<RelatedPatterns patterns={[Pattern.FeatureComparison]} />
</DetailsLayout>
);
};

View File

@@ -1,6 +1,8 @@
import React from 'react';
import { Link } from 'react-router-dom';
import RelatedPatterns from '../../components/RelatedPatterns';
import Pattern from '../../constants/Pattern';
import DetailsLayout from '../../layouts/DetailsLayout';
import Block from '../../placeholders/Block';
import BrowserFrame from '../../placeholders/BrowserFrame';
@@ -141,6 +143,8 @@ const Details: React.FC<{}> = () => {
`}
/>
</div>
<RelatedPatterns patterns={[Pattern.FeatureComparison]} />
</DetailsLayout>
);
};