mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-07 14:46:38 +02:00
Add Wizard
This commit is contained in:
@@ -31,6 +31,7 @@ import StickyFooter from './layouts/sticky-footer/Details';
|
||||
import StickyHeader from './layouts/sticky-header/Details';
|
||||
import Switch from './layouts/switch/Details';
|
||||
import Tab from './layouts/tab/Details';
|
||||
import Wizard from './layouts/wizard/Details';
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
@@ -66,6 +67,7 @@ const App = () => {
|
||||
<Route exact={true} path='/sticky-header'><StickyHeader /></Route>
|
||||
<Route exact={true} path='/switch'><Switch /></Route>
|
||||
<Route exact={true} path='/tab'><Tab /></Route>
|
||||
<Route exact={true} path='/wizard'><Wizard /></Route>
|
||||
</RouteSwitch>
|
||||
</Router>
|
||||
);
|
||||
|
@@ -30,6 +30,7 @@ import StickyFooterCover from './layouts/sticky-footer/Cover';
|
||||
import StickyHeaderCover from './layouts/sticky-header/Cover';
|
||||
import SwitchCover from './layouts/switch/Cover';
|
||||
import TabCover from './layouts/tab/Cover';
|
||||
import WizardCover from './layouts/wizard/Cover';
|
||||
import Layout from './Layout';
|
||||
import useDocumentTitle from './hooks/useDocumentTitle';
|
||||
|
||||
@@ -255,6 +256,12 @@ const Home = () => {
|
||||
<h4 className="f5 mv0 pt3">Tab</h4>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="pa1 w-20">
|
||||
<Link to="/wizard" className="link flex flex-column items-center justify-center tc hover-bg-black-10 br2 pa3">
|
||||
<WizardCover />
|
||||
<h4 className="f5 mv0 pt3">Wizard</h4>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
32
client/layouts/wizard/Cover.jsx
Normal file
32
client/layouts/wizard/Cover.jsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import React from 'react';
|
||||
|
||||
import Frame from '../../placeholders/Frame';
|
||||
import Line from '../../placeholders/Line';
|
||||
|
||||
const Cover = () => {
|
||||
return (
|
||||
<Frame>
|
||||
<div className="h-100 flex flex-column items-center justify-center">
|
||||
<div className="flex w-80">
|
||||
<div className="flex items-center justify-center" style={{ flex: 1 }}>
|
||||
<div style={{ flex: 1 }} />
|
||||
<div className="w1 h1 f7 flex items-center justify-center white br-pill bg-black-30">1</div>
|
||||
<div style={{ flex: 1 }}><Line /></div>
|
||||
</div>
|
||||
<div className="flex items-center justify-center" style={{ flex: 1 }}>
|
||||
<div style={{ flex: 1 }}><Line /></div>
|
||||
<div className="w1 h1 f7 flex items-center justify-center white br-pill bg-black-30">2</div>
|
||||
<div style={{ flex: 1 }}><Line /></div>
|
||||
</div>
|
||||
<div className="flex items-center justify-center" style={{ flex: 1 }}>
|
||||
<div style={{ flex: 1 }}><Line /></div>
|
||||
<div className="w1 h1 f7 flex items-center justify-center white br-pill bg-black-30">3</div>
|
||||
<div style={{ flex: 1 }} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Frame>
|
||||
);
|
||||
};
|
||||
|
||||
export default Cover;
|
119
client/layouts/wizard/Details.jsx
Normal file
119
client/layouts/wizard/Details.jsx
Normal file
@@ -0,0 +1,119 @@
|
||||
import React from 'react';
|
||||
|
||||
import DetailsLayout from '../../DetailsLayout';
|
||||
import Block from '../../placeholders/Block';
|
||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||
import Circle from '../../placeholders/Circle';
|
||||
import Line from '../../placeholders/Line';
|
||||
import SampleCode from '../../SampleCode';
|
||||
|
||||
const Details = () => {
|
||||
return (
|
||||
<DetailsLayout title="Wizard">
|
||||
<BrowserFrame
|
||||
content={
|
||||
<div className="h-100 flex flex-column items-center justify-center">
|
||||
<div className="flex w-80">
|
||||
<div style={{ flex: 1 }}>
|
||||
<div className="mb3 flex items-center justify-center">
|
||||
<div style={{ flex: 1 }} />
|
||||
<div className="flex items-center justify-center mh1"><Circle size={32} /></div>
|
||||
<div style={{ flex: 1 }}><Line /></div>
|
||||
</div>
|
||||
<div className="ph3 flex justify-center"><Block justify='center' numberOfBlocks={5} /></div>
|
||||
</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
<div className="mb3 flex items-center justify-center">
|
||||
<div style={{ flex: 1 }}><Line /></div>
|
||||
<div className="flex items-center justify-center mh1"><Circle size={32} /></div>
|
||||
<div style={{ flex: 1 }}><Line /></div>
|
||||
</div>
|
||||
<div className="ph3 flex justify-center"><Block justify='center' numberOfBlocks={5} /></div>
|
||||
</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
<div className="mb3 flex items-center justify-center">
|
||||
<div style={{ flex: 1 }}><Line /></div>
|
||||
<div className="flex items-center justify-center mh1"><Circle size={32} /></div>
|
||||
<div style={{ flex: 1 }} />
|
||||
</div>
|
||||
<div className="ph3 flex justify-center"><Block justify='center' numberOfBlocks={5} /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
source={
|
||||
<SampleCode
|
||||
lang="html"
|
||||
code={`
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<!-- Step -->
|
||||
<div style="
|
||||
/* Make all steps have the same width */
|
||||
flex: 1;
|
||||
">
|
||||
<div style="
|
||||
/* Content is centered */
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
">
|
||||
<!-- The left connector -->
|
||||
<div style="
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
|
||||
background-color: rgba(0, 0, 0, .3);
|
||||
/*
|
||||
For the first step, you might need to set it to transparent background:
|
||||
background-color: transparent;
|
||||
*/
|
||||
" />
|
||||
|
||||
<!-- The step number -->
|
||||
<div style="
|
||||
/* Content is centered */
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
/* Rounded border */
|
||||
background-color: rgba(0, 0, 0, .3);
|
||||
border-radius: 9999px;
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
|
||||
/* OPTIONAL: Spacing between it and connectors */
|
||||
margin-left: 4px;
|
||||
margin-right: 4px;
|
||||
">
|
||||
...
|
||||
</div>
|
||||
|
||||
<!-- The right connector -->
|
||||
<div style="
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
|
||||
background-color: rgba(0, 0, 0, .3);
|
||||
/*
|
||||
For the last step, you might need to set it to transparent background:
|
||||
background-color: transparent;
|
||||
*/
|
||||
" />
|
||||
</div>
|
||||
|
||||
<!-- Title of step -->
|
||||
...
|
||||
</div>
|
||||
</div>
|
||||
`}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</DetailsLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default Details;
|
Reference in New Issue
Block a user