Skip to content

Commit fdacc52

Browse files
committed
[add] Checkout example
1 parent 5956f40 commit fdacc52

File tree

10 files changed

+420
-55
lines changed

10 files changed

+420
-55
lines changed

document/source/components/InputGroup.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ render(
5555
aria-label="Recipient's username"
5656
append="@example.com"
5757
/>
58+
<label for="basic-url">Your vanity URL</label>
5859
<InputGroup
5960
id="basic-url"
6061
placeholder="Username"

source/page/Example/Carousel/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { NavBar } from 'boot-cell/source/Navigator/NavBar';
66
import { Form } from 'boot-cell/source/Form/Form';
77
import { Field } from 'boot-cell/source/Form/Field';
88
import { Button } from 'boot-cell/source/Form/Button';
9-
import { CarouselView } from 'boot-cell/source/Media/Carousel';
9+
import { CarouselView, CarouselItem } from 'boot-cell/source/Media/Carousel';
1010

1111
import { Feature } from './Feature';
1212
import style from './index.less';
@@ -65,7 +65,11 @@ export class CarouselPage extends mixin<{}, CarouselPageState>() {
6565
</Form>
6666
</NavBar>
6767

68-
<CarouselView controls indicators interval={3} list={banners} />
68+
<CarouselView controls indicators interval={3}>
69+
{banners.map(item => (
70+
<CarouselItem {...item} />
71+
))}
72+
</CarouselView>
6973

7074
<div className={classNames('container', style.marketing)}>
7175
<div className="row text-center">
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"cart_list": [
3+
{
4+
"title": "Product name",
5+
"description": "Brief description",
6+
"price": 12
7+
},
8+
{
9+
"title": "Second product",
10+
"description": "Brief description",
11+
"price": 8
12+
},
13+
{
14+
"title": "Third item",
15+
"description": "Brief description",
16+
"price": 5
17+
},
18+
{
19+
"title": "Promo code",
20+
"code": "EXAMPLECODE",
21+
"price": 5
22+
}
23+
],
24+
"foot_links": [
25+
{ "title": "Privacy" },
26+
{ "title": "Terms" },
27+
{ "title": "Support" }
28+
]
29+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.box {
2+
:global {
3+
.container {
4+
max-width: 960px;
5+
}
6+
.lh-condensed {
7+
line-height: 1.25;
8+
}
9+
}
10+
}

source/page/Example/Checkout/index.tsx

Lines changed: 332 additions & 0 deletions
Large diffs are not rendered by default.

source/page/Example/Cover.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createCell } from 'web-cell';
22
import classNames from 'classnames';
3-
import { Nav } from 'boot-cell/source/Navigator/Nav';
3+
import { Nav, NavLink } from 'boot-cell/source/Navigator/Nav';
44
import { Button } from 'boot-cell/source/Form/Button';
55

66
import style from './Cover.less';
@@ -25,12 +25,11 @@ export function CoverPage() {
2525
className="text-white-50 float-md-right"
2626
itemMode="masthead"
2727
align="center"
28-
list={[
29-
{ title: 'Home' },
30-
{ title: 'Features' },
31-
{ title: 'Contact' }
32-
]}
33-
/>
28+
>
29+
<NavLink>Home</NavLink>
30+
<NavLink>Features</NavLink>
31+
<NavLink>Contact</NavLink>
32+
</Nav>
3433
</header>
3534

3635
<main className="mx-auto py-0 px-4">

source/page/Example/Offcanvas.tsx

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createCell, Fragment } from 'web-cell';
22
import classNames from 'classnames';
33

44
import { NavBar } from 'boot-cell/source/Navigator/NavBar';
5-
import { Nav } from 'boot-cell/source/Navigator/Nav';
5+
import { Nav, NavLink } from 'boot-cell/source/Navigator/Nav';
66
import { Form } from 'boot-cell/source/Form/Form';
77
import { Field } from 'boot-cell/source/Form/Field';
88
import { Button } from 'boot-cell/source/Form/Button';
@@ -49,29 +49,20 @@ export function OffcanvasPage() {
4949
</Button>
5050
</Form>
5151
</NavBar>
52-
<Nav
53-
scrollable
54-
list={[
55-
{ title: 'Dashboard' },
56-
{
57-
title: (
58-
<Fragment>
59-
Friends{' '}
60-
<Badge
61-
pill
62-
kind="light"
63-
className="align-text-bottom"
64-
>
65-
27
66-
</Badge>
67-
</Fragment>
68-
)
69-
},
70-
{ title: 'Explore' },
71-
{ title: 'Suggestions' },
72-
...Array.from(new Array(5), () => ({ title: 'Link' }))
73-
]}
74-
/>
52+
<Nav scrollable>
53+
<NavLink>Dashboard</NavLink>
54+
<NavLink>
55+
Friends{' '}
56+
<Badge pill kind="light" className="align-text-bottom">
57+
27
58+
</Badge>
59+
</NavLink>
60+
<NavLink>Explore</NavLink>
61+
<NavLink>Suggestions</NavLink>
62+
{Array.from(new Array(5), () => (
63+
<NavLink>Link</NavLink>
64+
))}
65+
</Nav>
7566
<main className="container">
7667
<div
7768
className={classNames(

source/page/Example/Product/data.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
import { NavProps } from 'boot-cell/source/Navigator';
21
import { FooterListProps } from '../../../component/FooterList';
32
import { CaseProps } from './Case';
43

5-
export const headers: NavProps['list'] = [
6-
{ title: 'Tour' },
7-
{ title: 'Product' },
8-
{ title: 'Features' },
9-
{ title: 'Enterprise' },
10-
{ title: 'Support' },
11-
{ title: 'Pricing' },
12-
{ title: 'Cart' }
4+
export const headers = [
5+
'Tour',
6+
'Product',
7+
'Features',
8+
'Enterprise',
9+
'Support',
10+
'Pricing',
11+
'Cart'
1312
];
1413

1514
export const products: Pick<CaseProps, 'background' | 'color'>[][] = [

source/page/Example/Product/index.tsx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createCell, Fragment } from 'web-cell';
2-
import { Nav } from 'boot-cell/source/Navigator/Nav';
2+
import { Nav, NavLink } from 'boot-cell/source/Navigator/Nav';
33
import { Button } from 'boot-cell/source/Form/Button';
44

55
import { FooterList } from '../../../component/FooterList';
@@ -17,18 +17,14 @@ export function ProductPage() {
1717
);
1818
return (
1919
<Fragment>
20-
<nav className="bg-dark sticky-top py-1">
21-
<Nav
22-
className="container text-light"
23-
align="between"
24-
list={[
25-
{
26-
title: logo
27-
},
28-
...headers
29-
]}
30-
/>
31-
</nav>
20+
<div className="bg-dark sticky-top py-1">
21+
<Nav className="container" align="between">
22+
<NavLink className="text-light">{logo}</NavLink>
23+
{headers.map(header => (
24+
<NavLink className="text-light">{header}</NavLink>
25+
))}
26+
</Nav>
27+
</div>
3228
<header className="position-relative overflow-hidden p-3 p-md-5 m-md-3 text-center bg-light">
3329
<div className="col-md-5 p-lg-5 mx-auto my-5">
3430
<h1 className="display-4 font-weight-normal">

source/page/Example/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ export default [
77
paths: ['example/pricing'],
88
component: async () => (await import('./Pricing')).PricingPage
99
},
10+
{
11+
paths: ['example/checkout'],
12+
component: async () => (await import('./Checkout')).CheckoutPage
13+
},
1014
{
1115
paths: ['example/product'],
1216
component: async () => (await import('./Product')).ProductPage

0 commit comments

Comments
 (0)