From 6a18f81b40dfc825ff3d435602f1db2cf39cd96a Mon Sep 17 00:00:00 2001 From: lyliu Date: Mon, 17 Sep 2018 15:42:50 +0800 Subject: [PATCH 1/5] [lyliu/Fei Xie][#62]: use transfer replace checkbox. --- .../my-design/bootcamp/collaborator-tabs.js | 34 +++++++++++++------ src/mock-data/collaborator-list.js | 26 ++++++++++++-- 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/src/component/bootcamp-background/my-design/bootcamp/collaborator-tabs.js b/src/component/bootcamp-background/my-design/bootcamp/collaborator-tabs.js index fa27501..f46a97f 100755 --- a/src/component/bootcamp-background/my-design/bootcamp/collaborator-tabs.js +++ b/src/component/bootcamp-background/my-design/bootcamp/collaborator-tabs.js @@ -1,26 +1,38 @@ import React, { Component } from 'react' -import { Tabs, Checkbox, Row, Col } from 'antd' +import { Tabs, Transfer } from 'antd' import collaboratorsList from '../../../../mock-data/collaborator-list' const TabPane = Tabs.TabPane export default class CollaboratorTabs extends Component { - render () { + + state = { + targetKeys: [] + } + + filterOption = (inputValue, option) => { + return option.description.indexOf(inputValue) > -1; + } + + handleChange = (targetKeys) => { + this.setState({ targetKeys }); + } + + render() { return ( { collaboratorsList.map((collaborators, key) => { return ( - - - {collaborators.data.map(collaborator => { - return ( - {collaborator} - ) - })} - - + item.name} + /> ) })} diff --git a/src/mock-data/collaborator-list.js b/src/mock-data/collaborator-list.js index d03ca33..6cd4143 100644 --- a/src/mock-data/collaborator-list.js +++ b/src/mock-data/collaborator-list.js @@ -1,10 +1,32 @@ export default [ { name: '主题一团队', - data: ['张三1', '李四1'] + data: [ + { + name: '张三1', + key: 1, + chosen: false + }, + { + name: '李四1', + key: 2, + chosen: false + } + ] }, { name: '主题二团队', - data: ['张三2', '李四2'] + data: [ + { + name: '张三2', + key: 3, + chosen: false + }, + { + name: '李四2', + key: 4, + chosen: false + } + ] } ] -- Gitee From f16ae56c312a2b0112b4111e242f7585b461b07c Mon Sep 17 00:00:00 2001 From: lyliu Date: Tue, 18 Sep 2018 00:20:07 +0800 Subject: [PATCH 2/5] [lyliu/Fei Xie][#62]: change defaultActivekey. --- .vscode/launch.json | 15 +++++++++++++++ .../my-design/bootcamp/collaborator-tabs.js | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..f6b35a0 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:3000", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/src/component/bootcamp-background/my-design/bootcamp/collaborator-tabs.js b/src/component/bootcamp-background/my-design/bootcamp/collaborator-tabs.js index f46a97f..c02a086 100755 --- a/src/component/bootcamp-background/my-design/bootcamp/collaborator-tabs.js +++ b/src/component/bootcamp-background/my-design/bootcamp/collaborator-tabs.js @@ -20,7 +20,7 @@ export default class CollaboratorTabs extends Component { render() { return ( - + { collaboratorsList.map((collaborators, key) => { return ( -- Gitee From ebabd76f0dd9ad9abc0af2ff965490036b3ac5ec Mon Sep 17 00:00:00 2001 From: feixie-liam Date: Tue, 18 Sep 2018 10:11:50 +0800 Subject: [PATCH 3/5] [Fei XIE/Yunzhi LIU][42]: align center for transfer component. --- .../my-design/bootcamp/collaborator-tabs.js | 2 ++ src/style/common.css | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/component/bootcamp-background/my-design/bootcamp/collaborator-tabs.js b/src/component/bootcamp-background/my-design/bootcamp/collaborator-tabs.js index c02a086..476ebca 100755 --- a/src/component/bootcamp-background/my-design/bootcamp/collaborator-tabs.js +++ b/src/component/bootcamp-background/my-design/bootcamp/collaborator-tabs.js @@ -1,6 +1,7 @@ import React, { Component } from 'react' import { Tabs, Transfer } from 'antd' import collaboratorsList from '../../../../mock-data/collaborator-list' +import '../../../../style/common.css' const TabPane = Tabs.TabPane @@ -26,6 +27,7 @@ export default class CollaboratorTabs extends Component { return ( Date: Tue, 18 Sep 2018 10:15:52 +0800 Subject: [PATCH 4/5] [Fei XIE/Yunzhi LIU][42]: modify margin right to fit tws style. --- src/style/common.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/style/common.css b/src/style/common.css index e9cf818..58c00cb 100644 --- a/src/style/common.css +++ b/src/style/common.css @@ -1,5 +1,5 @@ .margin--right { - margin-right: 6px; + margin-right: 8px; } .margin--bottom { -- Gitee From 91318350de67b1554b893a94f3e4008ff0ed28c4 Mon Sep 17 00:00:00 2001 From: feixie-liam Date: Tue, 18 Sep 2018 13:27:48 +0800 Subject: [PATCH 5/5] [Fei XIE/Yunzhi LIU][42]: delete .vscode --- .gitignore | 1 + .vscode/launch.json | 15 --------------- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 .vscode/launch.json diff --git a/.gitignore b/.gitignore index bfeee6f..0a3b5a7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ # dependencies /node_modules .idea +.vscode # testing /coverage build diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index f6b35a0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "chrome", - "request": "launch", - "name": "Launch Chrome against localhost", - "url": "http://localhost:3000", - "webRoot": "${workspaceFolder}" - } - ] -} \ No newline at end of file -- Gitee