mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-11 16:44:57 +02:00
Add heading component
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import CoverCard from './components/CoverCard';
|
import CoverCard from './components/CoverCard';
|
||||||
|
import Heading from './components/Heading';
|
||||||
import useDocumentTitle from './hooks/useDocumentTitle';
|
import useDocumentTitle from './hooks/useDocumentTitle';
|
||||||
import Layout from './layouts/Layout';
|
import Layout from './layouts/Layout';
|
||||||
|
|
||||||
@@ -45,8 +46,8 @@ const Home = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="bt b--black-20 relative">
|
<section>
|
||||||
<h3 className="absolute bg-white f4 left-2 lh-copy ma0 ph2 top-0 ttu" style={{ transform: 'translate(0, -50%)' }}>Layouts</h3>
|
<Heading title="Layouts" />
|
||||||
|
|
||||||
<div className="flex flex-wrap items-start pa4">
|
<div className="flex flex-wrap items-start pa4">
|
||||||
<CoverCard pattern="Holy grail" />
|
<CoverCard pattern="Holy grail" />
|
||||||
@@ -55,10 +56,10 @@ const Home = () => {
|
|||||||
<CoverCard pattern="Sticky footer" />
|
<CoverCard pattern="Sticky footer" />
|
||||||
<CoverCard pattern="Sticky header" />
|
<CoverCard pattern="Sticky header" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
|
|
||||||
<div className="bt b--black-20 relative">
|
<section>
|
||||||
<h3 className="absolute bg-white f4 left-2 lh-copy ma0 ph2 top-0 ttu" style={{ transform: 'translate(0, -50%)' }}>Patterns</h3>
|
<Heading title="Patterns" />
|
||||||
|
|
||||||
<div className="flex flex-wrap items-start pa4">
|
<div className="flex flex-wrap items-start pa4">
|
||||||
<CoverCard pattern="Badge" />
|
<CoverCard pattern="Badge" />
|
||||||
@@ -93,7 +94,7 @@ const Home = () => {
|
|||||||
<CoverCard pattern="Toggle password visibility" />
|
<CoverCard pattern="Toggle password visibility" />
|
||||||
<CoverCard pattern="Wizard" />
|
<CoverCard pattern="Wizard" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
|
11
client/components/Heading.jsx
Normal file
11
client/components/Heading.jsx
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
const Heading = ({ title }) => {
|
||||||
|
return (
|
||||||
|
<div className="bt b--black-20 relative">
|
||||||
|
<h3 className="absolute bg-white f4 left-2 lh-copy ma0 ph2 top-0 ttu" style={{ transform: 'translate(0, -50%)' }}>{title}</h3>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Heading;
|
@@ -1,18 +1,19 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
|
|
||||||
import CoverCard from './CoverCard';
|
import CoverCard from './CoverCard';
|
||||||
|
import Heading from './Heading';
|
||||||
|
|
||||||
const RelatedPatterns = ({ patterns }) => {
|
const RelatedPatterns = ({ patterns }) => {
|
||||||
return (
|
return (
|
||||||
<div className="bt b--black-20 relative">
|
<section>
|
||||||
<h3 className="absolute bg-white f4 left-2 lh-copy ma0 ph2 top-0 ttu" style={{ transform: 'translate(0px, -50%)' }}>Related patterns</h3>
|
<Heading title="Related patterns" />
|
||||||
|
|
||||||
<div className="flex flex-wrap items-start pa4">
|
<div className="flex flex-wrap items-start pa4">
|
||||||
{
|
{
|
||||||
patterns.map(pattern => <CoverCard key={pattern} pattern={pattern} />)
|
patterns.map(pattern => <CoverCard key={pattern} pattern={pattern} />)
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,10 +1,12 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import Heading from '../components/Heading';
|
||||||
|
|
||||||
const Footer = () => {
|
const Footer = () => {
|
||||||
return (
|
return (
|
||||||
<div className="bl br bb b--black-20 flex justify-between br4 br--bottom">
|
<div className="bl br bb b--black-20 flex justify-between br4 br--bottom">
|
||||||
<div className="bt br b--black-20 relative" style={{ flex: 1 }}>
|
<div className="br b--black-20" style={{ flex: 1 }}>
|
||||||
<h3 className="absolute bg-white f4 left-2 lh-copy ma0 ph2 top-0 ttu" style={{ transform: 'translate(0, -50%)' }}>Products</h3>
|
<Heading title="Products" />
|
||||||
|
|
||||||
<ul className="list ma0 pa0 lh-copy fw5 pa4">
|
<ul className="list ma0 pa0 lh-copy fw5 pa4">
|
||||||
<li>
|
<li>
|
||||||
@@ -25,8 +27,8 @@ const Footer = () => {
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="bt b--black-20 relative" style={{ flex: 1 }}>
|
<div style={{ flex: 1 }}>
|
||||||
<h3 className="absolute bg-white f4 left-2 lh-copy ma0 ph2 top-0 ttu" style={{ transform: 'translate(0, -50%)' }}>About</h3>
|
<Heading title="About" />
|
||||||
|
|
||||||
<div className="pa4">
|
<div className="pa4">
|
||||||
<div className="pb2 lh-copy">© 2019 Nguyen Huu Phuoc and contributors</div>
|
<div className="pb2 lh-copy">© 2019 Nguyen Huu Phuoc and contributors</div>
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import Heading from '../../components/Heading';
|
||||||
import DetailsLayout from '../../layouts/DetailsLayout';
|
import DetailsLayout from '../../layouts/DetailsLayout';
|
||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
import Rectangle from '../../placeholders/Rectangle';
|
import Rectangle from '../../placeholders/Rectangle';
|
||||||
@@ -44,8 +45,8 @@ const Details = () => {
|
|||||||
`}
|
`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="bt b--black-20 relative">
|
<section>
|
||||||
<h3 className="absolute bg-white f4 left-2 lh-copy ma0 ph2 top-0" style={{ transform: 'translate(0px, -50%)' }}>Use cases</h3>
|
<Heading title="Use cases" />
|
||||||
|
|
||||||
<div className="pa4">
|
<div className="pa4">
|
||||||
<div className="mb4 w4 pa2 relative ba b--black-30 br2">
|
<div className="mb4 w4 pa2 relative ba b--black-30 br2">
|
||||||
@@ -67,7 +68,7 @@ const Details = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
</DetailsLayout>
|
</DetailsLayout>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
|
||||||
|
import Heading from '../../components/Heading';
|
||||||
import RelatedPatterns from '../../components/RelatedPatterns';
|
import RelatedPatterns from '../../components/RelatedPatterns';
|
||||||
import DetailsLayout from '../../layouts/DetailsLayout';
|
import DetailsLayout from '../../layouts/DetailsLayout';
|
||||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
@@ -56,8 +57,8 @@ const Details = () => {
|
|||||||
`}
|
`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="bt b--black-20 relative">
|
<section>
|
||||||
<h3 className="absolute bg-white f4 left-2 lh-copy ma0 ph2 top-0 ttu" style={{ transform: 'translate(0px, -50%)' }}>Use cases</h3>
|
<Heading title="Use cases" />
|
||||||
|
|
||||||
<div className="pa4">
|
<div className="pa4">
|
||||||
<div className="inline-flex br-pill bg-black-10 pa1">
|
<div className="inline-flex br-pill bg-black-10 pa1">
|
||||||
@@ -71,7 +72,7 @@ const Details = () => {
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
<RelatedPatterns patterns={['Switch']} />
|
<RelatedPatterns patterns={['Switch']} />
|
||||||
</DetailsLayout>
|
</DetailsLayout>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user