Skip to content

Commit b91f157

Browse files
committed
feat: replace rc-footer with rc-segmented
1 parent c93e265 commit b91f157

15 files changed

+217
-231
lines changed

.gitpod.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This configuration file was automatically generated by Gitpod.
2+
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
3+
# and commit this file to your remote git repository to share the goodness with others.
4+
5+
tasks:
6+
- init: npm install && npm run compile
7+
command: npm run start
8+
vscode:
9+
extensions:
10+
- dbaeumer.vscode-eslint

.umirc.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
import { defineConfig } from 'dumi';
33

44
export default defineConfig({
5-
title: 'rc-footer',
5+
title: 'rc-segmented',
66
favicon: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
77
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
88
outputPath: '.doc',
99
exportStatic: {},
10-
base: '/footer/',
11-
publicPath: '/footer/',
10+
base: '/segmented/',
11+
publicPath: '/segmented/',
1212
hash: true,
1313
styles: [
1414
`

CHANGELOG.md

-26
Original file line numberDiff line numberDiff line change
@@ -1,27 +1 @@
11
# Changelog
2-
3-
## 0.6.0
4-
5-
- support `maxColumnsPerRow`.
6-
7-
## 0.5.0
8-
9-
- support `theme="dark|light"`.
10-
11-
## 0.4.0
12-
13-
- support `columnLayout`.
14-
- support `backgroundColor`.
15-
16-
## 0.3.0
17-
18-
- support `style` and `className` for footer column and footer item.
19-
- support `LinkComponent` for footer item.
20-
21-
## 0.2.0
22-
23-
- Fix `lib` and `es` folders missing.
24-
25-
## 0.1.0
26-
27-
- First release.

README.md

+43-43
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
# rc-footer 🐾
1+
# rc-segmented 🐾
22

33
[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![Dependencies][david-image]](david-url) [![DevDependencies][david-dev-image]][david-dev-url] [![bundle size][bundlephobia-image]][bundlephobia-url]
44

5-
[npm-image]: http://img.shields.io/npm/v/rc-footer.svg?style=flat-square
6-
[npm-url]: http://npmjs.org/package/rc-footer
7-
[github-actions-image]: https://github.com/react-component/footer/workflows/CI/badge.svg
8-
[github-actions-url]: https://github.com/react-component/footer/actions
9-
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/footer/master.svg?style=flat-square
10-
[codecov-url]: https://codecov.io/gh/react-component/footer/branch/master
11-
[david-url]: https://david-dm.org/react-component/footer
12-
[david-image]: https://david-dm.org/react-component/footer/status.svg?style=flat-square
13-
[david-dev-url]: https://david-dm.org/react-component/footer?type=dev
14-
[david-dev-image]: https://david-dm.org/react-component/footer/dev-status.svg?style=flat-square
15-
[download-image]: https://img.shields.io/npm/dm/rc-footer.svg?style=flat-square
16-
[download-url]: https://npmjs.org/package/rc-footer
17-
[bundlephobia-url]: https://bundlephobia.com/result?p=rc-footer
18-
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-footer
19-
20-
Pretty Footer react component used in [ant.design](https://ant.design) and [antv.vision](https://antv.vision).
5+
[npm-image]: http://img.shields.io/npm/v/rc-segmented.svg?style=flat-square
6+
[npm-url]: http://npmjs.org/package/rc-segmented
7+
[github-actions-image]: https://github.com/react-component/segmented/workflows/CI/badge.svg
8+
[github-actions-url]: https://github.com/react-component/segmented/actions
9+
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/segmented/master.svg?style=flat-square
10+
[codecov-url]: https://codecov.io/gh/react-component/segmented/branch/master
11+
[david-url]: https://david-dm.org/react-component/segmented
12+
[david-image]: https://david-dm.org/react-component/segmented/status.svg?style=flat-square
13+
[david-dev-url]: https://david-dm.org/react-component/segmented?type=dev
14+
[david-dev-image]: https://david-dm.org/react-component/segmented/dev-status.svg?style=flat-square
15+
[download-image]: https://img.shields.io/npm/dm/rc-segmented.svg?style=flat-square
16+
[download-url]: https://npmjs.org/package/rc-segmented
17+
[bundlephobia-url]: https://bundlephobia.com/result?p=rc-segmented
18+
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-segmented
19+
20+
Pretty segmented react component used in [ant.design](https://ant.design) and [antv.vision](https://antv.vision).
2121

2222
![](https://gw.alipayobjects.com/zos/antfincdn/z4ie3X8x6u/1cb23945-ec67-45a3-b521-f8da62e12255.png)
2323

2424
## Live Demo
2525

26-
https://react-component.github.io/footer/
26+
https://react-component.github.io/segmented/
2727

2828
## Install
2929

30-
[![rc-footer](https://nodei.co/npm/rc-footer.png)](https://npmjs.org/package/rc-footer)
30+
[![rc-segmented](https://nodei.co/npm/rc-segmented.png)](https://npmjs.org/package/rc-segmented)
3131

3232
## Usage
3333

3434
```js
35-
import Footer from 'rc-footer';
36-
import 'rc-footer/assets/index.css'; // import 'rc-footer/asssets/index.less';
35+
import segmented from 'rc-segmented';
36+
import 'rc-segmented/assets/index.css'; // import 'rc-segmented/asssets/index.less';
3737
import { render } from 'react-dom';
3838

3939
render(
40-
<Footer
40+
<segmented
4141
columns={[
4242
{
4343
icon: (
@@ -57,27 +57,27 @@ render(
5757

5858
## API
5959

60-
| Property | Type | Default | Description |
61-
| ---------------- | --------------------------------- | -------------- | ---------------------------------------- |
62-
| prefixCls | string | rc-footer | |
63-
| className | string | '' | additional class name of footer |
64-
| style | React.CSSProperties | | style properties of footer |
65-
| columns | [Column](#Column) Array | [] | columns data inside footer |
66-
| bottom | ReactNode | | extra bottom area beneath footer columns |
67-
| theme | 'light' \| 'dark' | 'dark' | preset theme of footer |
68-
| backgroundColor | string | '#000' | background color of footer |
69-
| columnLayout | 'space-around' or 'space-between' | 'space-around' | justify-content value of columns element |
70-
| maxColumnsPerRow | number | - | max count of columns for each row |
60+
| Property | Type | Default | Description |
61+
| ---------------- | --------------------------------- | -------------- | ------------------------------------------- |
62+
| prefixCls | string | rc-segmented | |
63+
| className | string | '' | additional class name of segmented |
64+
| style | React.CSSProperties | | style properties of segmented |
65+
| columns | [Column](#Column) Array | [] | columns data inside segmented |
66+
| bottom | ReactNode | | extra bottom area beneath segmented columns |
67+
| theme | 'light' \| 'dark' | 'dark' | preset theme of segmented |
68+
| backgroundColor | string | '#000' | background color of segmented |
69+
| columnLayout | 'space-around' or 'space-between' | 'space-around' | justify-content value of columns element |
70+
| maxColumnsPerRow | number | - | max count of columns for each row |
7171

7272
### Column
7373

74-
| Property | Type | Default | Description |
75-
| --------- | -------------------------- | ------- | ------------------------------- |
76-
| icon | ReactNode | | icon that before column title |
77-
| title | ReactNode | | title of column |
78-
| items | [Item](#Column-Item) Array | [] | items data inside each column |
79-
| className | string | '' | additional class name of footer |
80-
| style | React.CSSProperties | | style properties of footer |
74+
| Property | Type | Default | Description |
75+
| --------- | -------------------------- | ------- | ---------------------------------- |
76+
| icon | ReactNode | | icon that before column title |
77+
| title | ReactNode | | title of column |
78+
| items | [Item](#Column-Item) Array | [] | items data inside each column |
79+
| className | string | '' | additional class name of segmented |
80+
| style | React.CSSProperties | | style properties of segmented |
8181

8282
### Column Item
8383

@@ -88,8 +88,8 @@ render(
8888
| description | ReactNode | | description of column, come after title |
8989
| url | string | | link url of item title |
9090
| openExternal | boolean | false | link target would be `_blank` if `openExternal` is ture |
91-
| className | string | '' | additional class name of footer |
92-
| style | React.CSSProperties | | style properties of footer |
91+
| className | string | '' | additional class name of segmented |
92+
| style | React.CSSProperties | | style properties of segmented |
9393
| LinkComponent | React.ReactType | 'a' | the link element to render item |
9494

9595
## Development
@@ -101,4 +101,4 @@ npm start
101101

102102
## License
103103

104-
rc-footer is released under the MIT license.
104+
rc-segmented is released under the MIT license.

assets/index.less

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@footer-prefix-cls: rc-footer;
1+
@segmented-prefix-cls: rc-segmented;
22

3-
.@{footer-prefix-cls} {
3+
.@{segmented-prefix-cls} {
44
position: relative;
55
clear: both;
66
color: rgba(255, 255, 255, 0.4);
@@ -9,9 +9,9 @@
99
background-color: #000;
1010

1111
a {
12-
transition: all 0.3s;
1312
color: rgba(255, 255, 255, 0.9);
1413
text-decoration: none;
14+
transition: all 0.3s;
1515

1616
&:hover {
1717
color: #40a9ff;
@@ -21,8 +21,8 @@
2121
&-container {
2222
width: 100%;
2323
max-width: 1200px;
24-
padding: 80px 0 20px;
2524
margin: auto;
25+
padding: 80px 0 20px;
2626
}
2727

2828
&-columns {
@@ -36,25 +36,25 @@
3636
h2 {
3737
position: relative;
3838
margin: 0 auto 24px;
39+
color: #fff;
3940
font-weight: 500;
4041
font-size: 16px;
41-
color: #fff;
4242
}
4343

4444
&-icon {
45-
margin-right: 0.5em;
46-
width: 22px;
47-
display: inline-block;
48-
vertical-align: middle;
49-
top: -1px;
5045
position: relative;
46+
top: -1px;
47+
display: inline-block;
48+
width: 22px;
49+
margin-right: 0.5em;
5150
text-align: center;
51+
vertical-align: middle;
5252

5353
> span,
5454
> svg,
5555
img {
56-
width: 100%;
5756
display: block;
57+
width: 100%;
5858
}
5959
}
6060
}
@@ -63,19 +63,19 @@
6363
margin: 12px 0;
6464

6565
&-icon {
66-
margin-right: 0.4em;
67-
width: 16px;
68-
display: inline-block;
69-
vertical-align: middle;
70-
top: -1px;
7166
position: relative;
67+
top: -1px;
68+
display: inline-block;
69+
width: 16px;
70+
margin-right: 0.4em;
7271
text-align: center;
72+
vertical-align: middle;
7373

7474
> span,
7575
> svg,
7676
img {
77-
width: 100%;
7877
display: block;
78+
width: 100%;
7979
}
8080
}
8181

@@ -86,20 +86,20 @@
8686

8787
&-bottom {
8888
&-container {
89-
border-top: 1px solid rgba(255, 255, 255, 0.25);
9089
width: 100%;
9190
max-width: 1200px;
92-
text-align: center;
9391
margin: 0 auto;
9492
padding: 16px 0;
95-
line-height: 32px;
9693
font-size: 16px;
94+
line-height: 32px;
95+
text-align: center;
96+
border-top: 1px solid rgba(255, 255, 255, 0.25);
9797
}
9898
}
9999

100100
&-light {
101-
background-color: transparent;
102101
color: rgba(0, 0, 0, 0.85);
102+
background-color: transparent;
103103

104104
h2,
105105
a {
@@ -118,7 +118,7 @@
118118
}
119119

120120
@media only screen and (max-width: 767.99px) {
121-
.@{footer-prefix-cls} {
121+
.@{segmented-prefix-cls} {
122122
text-align: center;
123123

124124
&-container {

docs/examples/rows.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import '../../assets/index.less';
22
import React from 'react';
3-
import Footer from 'rc-footer';
3+
import segmented from 'rc-segmented';
44

55
export default function App() {
66
return (
77
<div>
8-
<Footer
8+
<segmented
99
maxColumnsPerRow={4}
1010
columns={[
1111
{

docs/examples/simple.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import '../../assets/index.less';
22
import React from 'react';
3-
import Footer from 'rc-footer';
3+
import segmented from 'rc-segmented';
44

55
export default function App() {
66
return (
77
<div>
8-
<Footer
8+
<segmented
99
columns={[
1010
{
1111
title: '相关资源',

docs/examples/theme.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import '../../assets/index.less';
22
import React, { useState } from 'react';
3-
import Footer from 'rc-footer';
3+
import segmented from 'rc-segmented';
44

55
export default function App() {
66
const [theme, setTheme] = useState('light');
77
return (
88
<div>
9-
<Footer
9+
<segmented
1010
theme={theme}
1111
columns={[
1212
{

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: rc-footer
2+
title: rc-segmented
33
---
44

55
<embed src="../README.md"></embed>

package.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"name": "rc-footer",
3-
"version": "0.6.6",
4-
"description": "Pretty Footer react component used in used in ant.design",
2+
"name": "rc-segmented",
3+
"version": "0.0.1",
4+
"description": "React segmented controls used in ant.design",
55
"keywords": [
66
"react",
77
"react-component",
8-
"react-footer",
9-
"footer",
8+
"react-segmented",
9+
"react-segmented-controls",
10+
"segmented controls",
1011
"antd",
1112
"ant-design"
1213
],
@@ -19,13 +20,13 @@
1920
"lib",
2021
"dist"
2122
],
22-
"homepage": "https://react-component.github.io/footer",
23+
"homepage": "https://react-component.github.io/segmented",
2324
"repository": {
2425
"type": "git",
25-
"url": "git@github.com:react-component/footer.git"
26+
"url": "git@github.com:react-component/segmented.git"
2627
},
2728
"bugs": {
28-
"url": "http://github.com/react-component/footer/issues"
29+
"url": "http://github.com/react-component/segmented/issues"
2930
},
3031
"license": "MIT",
3132
"scripts": {

0 commit comments

Comments
 (0)