mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-06 14:16:50 +02:00
Add notification
This commit is contained in:
@@ -11,6 +11,7 @@ import HolyGrail from './layouts/holy-grail/Details';
|
||||
import InputAddon from './layouts/input-add-on/Details';
|
||||
import MediaObject from './layouts/media-object/Details';
|
||||
import Menu from './layouts/menu/Details';
|
||||
import Notification from './layouts/notification/Details';
|
||||
import PreviousNextButtons from './layouts/previous-next-buttons/Details';
|
||||
import ProgressBar from './layouts/progress-bar/Details';
|
||||
import SameHeightColumns from './layouts/same-height-columns/Details';
|
||||
@@ -34,6 +35,7 @@ const App = () => {
|
||||
<Route exact={true} path='/input-add-on'><InputAddon /></Route>
|
||||
<Route exact={true} path='/media-object'><MediaObject /></Route>
|
||||
<Route exact={true} path='/menu'><Menu /></Route>
|
||||
<Route exact={true} path='/notification'><Notification /></Route>
|
||||
<Route exact={true} path='/previous-next-buttons'><PreviousNextButtons /></Route>
|
||||
<Route exact={true} path='/progress-bar'><ProgressBar /></Route>
|
||||
<Route exact={true} path='/same-height-columns'><SameHeightColumns /></Route>
|
||||
|
@@ -10,6 +10,7 @@ import HolyGrailCover from './layouts/holy-grail/Cover';
|
||||
import InputAddonCover from './layouts/input-add-on/Cover';
|
||||
import MediaObjectCover from './layouts/media-object/Cover';
|
||||
import MenuCover from './layouts/menu/Cover';
|
||||
import NotificationCover from './layouts/notification/Cover';
|
||||
import PreviousNextButtonCover from './layouts/previous-next-buttons/Cover';
|
||||
import ProgressBarCover from './layouts/progress-bar/Cover';
|
||||
import SameHeightColumnsCover from './layouts/same-height-columns/Cover';
|
||||
@@ -127,6 +128,12 @@ const Home = () => {
|
||||
<h4 className="f4 mv0 pt3">Menu</h4>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="pa1 w-20">
|
||||
<Link to="/notification" className="link flex flex-column items-center justify-center tc hover-bg-black-10 br2 pa3">
|
||||
<NotificationCover />
|
||||
<h4 className="f4 mv0 pt3">Notification</h4>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="pa1 w-20">
|
||||
<Link to="/previous-next-buttons" className="link flex flex-column items-center justify-center tc hover-bg-black-10 br2 pa3">
|
||||
<PreviousNextButtonCover />
|
||||
|
19
client/layouts/notification/Cover.jsx
Normal file
19
client/layouts/notification/Cover.jsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from 'react';
|
||||
|
||||
import Frame from '../../placeholders/Frame';
|
||||
import Rectangle from '../../placeholders/Rectangle';
|
||||
|
||||
const Cover = () => {
|
||||
return (
|
||||
<Frame>
|
||||
<div className="h-100 flex flex-column items-center justify-center">
|
||||
<div className="flex items-center justify-between ba b--black-30 br2 w-80 pa2">
|
||||
<div className="w-60"><Rectangle /></div>
|
||||
<div className="black-70">×</div>
|
||||
</div>
|
||||
</div>
|
||||
</Frame>
|
||||
);
|
||||
};
|
||||
|
||||
export default Cover;
|
60
client/layouts/notification/Details.jsx
Normal file
60
client/layouts/notification/Details.jsx
Normal file
@@ -0,0 +1,60 @@
|
||||
import React from 'react';
|
||||
|
||||
import DetailsLayout from '../../DetailsLayout';
|
||||
import Block from '../../placeholders/Block';
|
||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||
import SampleCode from '../../SampleCode';
|
||||
import useDocumentTitle from '../../hooks/useDocumentTitle';
|
||||
|
||||
const Details = () => {
|
||||
useDocumentTitle('CSS Layout ∙ Notification');
|
||||
|
||||
return (
|
||||
<DetailsLayout>
|
||||
<h1 className="f1 tc">Notification</h1>
|
||||
<BrowserFrame
|
||||
content={
|
||||
<div className="h-100 flex flex-column items-center justify-center">
|
||||
<div className="b--black-30 ba br2 flex justify-between w-60">
|
||||
<div className="pa3 w-80"><Block numberOfBlocks={5} /></div>
|
||||
<button className="black-30 bn f2 flex h2 items-center justify-center w2" style={{ marginRight: '1px' }}>
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
style={{
|
||||
stroke: 'rgb(0, 0, 0)',
|
||||
fill: 'none',
|
||||
strokeWidth: 1,
|
||||
strokeLinecap: 'round',
|
||||
strokeLinejoin: 'round',
|
||||
height: '16px',
|
||||
width: '16px'
|
||||
}}>
|
||||
<path d="M12,0.5c6.351,0,11.5,5.149,11.5,11.5S18.351,23.5,12,23.5S0.5,18.351,0.5,12S5.649,0.5,12,0.5z M7,7l10,10 M17,7L7,17" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
source={
|
||||
<SampleCode
|
||||
lang="html"
|
||||
code={`
|
||||
<div style="
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
">
|
||||
<!-- Content -->
|
||||
...
|
||||
|
||||
<!-- Close button sticks to the right -->
|
||||
...
|
||||
</div>
|
||||
`}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</DetailsLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default Details;
|
Reference in New Issue
Block a user