1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-22 13:42:50 +02:00

Add media object pattern

This commit is contained in:
Phuoc Nguyen
2019-11-16 23:21:23 +07:00
parent 5f1ef07da9
commit d010a71161
3 changed files with 70 additions and 1 deletions

View File

@@ -0,0 +1,67 @@
import React from 'react';
import DetailsLayout from '../DetailsLayout';
import Block from '../placeholders/Block';
import BrowserFrame from '../placeholders/BrowserFrame';
import Rectangle from '../placeholders/Rectangle';
import Square from '../placeholders/Square';
import SampleCode from '../SampleCode';
import useDocumentTitle from '../useDocumentTitle';
const MediaObject = () => {
useDocumentTitle('CSS Layout ∙ Media object');
return (
<DetailsLayout>
<h1 className="f1 tc">Media object</h1>
<BrowserFrame
content={
<div className="h-100 flex items-start pa3">
<div className="w4 h4 mr3">
<Square />
</div>
<div className="flex-auto">
<div className="w-80 mb4">
<Rectangle />
</div>
<div className="mb4"><Block numberOfBlocks={20} /></div>
<div className="mb4"><Block numberOfBlocks={15} /></div>
</div>
</div>
}
source={
<SampleCode
lang="html"
code={`
<div style="
/* Align sub-items to top */
align-items: start;
display: flex;
">
<!-- Media object -->
<div style="
margin-right: 16px;
/* Set the width for the media object */
width: 200px;
">
...
</div>
<!-- Main content -->
<div style="
/* Take the remaining width */
flex: 1;
">
...
</div>
</div>
`}
/>
}
/>
</DetailsLayout>
);
};
export default MediaObject;