Skip to content

Commit f2d7140

Browse files
Merge pull request #87 from NordicSemiconductor/enhance_device_selector
Enhance device selector
2 parents a28068f + 40fc285 commit f2d7140

File tree

5 files changed

+47
-7
lines changed

5 files changed

+47
-7
lines changed

Changelog.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Version 4.8.17
2+
### Updated
3+
- New design, device selector: Add PCA number, better alignment for port names,
4+
removed wrong line below port names
5+
16
## Version 4.8.16
27
## Added
38
- Added support for files written in TypeScript

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pc-nrfconnect-shared",
3-
"version": "4.8.16",
3+
"version": "4.8.17",
44
"description": "Shared commodities for developing pc-nrfconnect-* packages",
55
"repository": {
66
"type": "git",

src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.jsx

+31-3
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,34 @@
3535
*/
3636

3737
import React from 'react';
38-
import { arrayOf, shape, string } from 'prop-types';
38+
import { arrayOf, node, shape, string } from 'prop-types';
3939

4040
import { serialports, displayedDeviceName } from '../../deviceInfo/deviceInfo';
4141
import deviceShape from '../deviceShape';
4242

4343
import './more-device-info.scss';
4444

45+
const Row = ({ children }) => (
46+
<div className="info-row">
47+
<div className="flex-space" />
48+
{children}
49+
</div>
50+
);
51+
Row.propTypes = {
52+
children: node.isRequired,
53+
};
54+
55+
const PcaNumber = ({ device }) => {
56+
if (device.boardVersion == null) {
57+
return null;
58+
}
59+
60+
return <div>{device.boardVersion}</div>;
61+
};
62+
PcaNumber.propTypes = {
63+
device: deviceShape.isRequired,
64+
};
65+
4566
const MaybeDeviceName = ({ device }) => {
4667
const hasNickname = device.nickname !== '';
4768
if (!hasNickname) {
@@ -75,8 +96,15 @@ Serialports.propTypes = {
7596

7697
const MoreDeviceInfo = ({ device }) => (
7798
<div className="more-infos">
78-
<MaybeDeviceName device={device} />
79-
<Serialports ports={serialports(device)} />
99+
<Row>
100+
<PcaNumber device={device} />
101+
</Row>
102+
<Row>
103+
<MaybeDeviceName device={device} />
104+
</Row>
105+
<Row>
106+
<Serialports ports={serialports(device)} />
107+
</Row>
80108
</div>
81109
);
82110

src/Device/DeviceSelector/DeviceList/device-list.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
padding: 20px;
2626
}
2727

28-
ul {
28+
> ul {
2929
padding: 0;
3030
margin-bottom: 0;
3131

src/Device/DeviceSelector/DeviceList/more-device-info.scss

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
.core19-device-selector {
44
.more-infos {
5-
padding-left: 68px;
5+
.info-row {
6+
display: flex;
7+
flex-direction: row;
8+
padding-right: 20px;
9+
}
10+
11+
.flex-space {
12+
width: 68px;
13+
}
614

715
.name {
816
margin-top: 1em;
@@ -13,7 +21,6 @@
1321
padding: 0;
1422
text-decoration: underline;
1523
margin-top: 1em;
16-
margin-left: -68px;
1724
text-align: center;
1825
}
1926
}

0 commit comments

Comments
 (0)