Skip to content

Commit

Permalink
Update shared & currentPane use
Browse files Browse the repository at this point in the history
  • Loading branch information
KievDevel committed May 14, 2024
1 parent 75f3e3c commit 04077d0
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 34 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.4.1 - UNRELEASED

### Added

- Support for Apple silicon.

## 2.4.0 - 2024-04-09

### Changed
Expand Down
46 changes: 20 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pc-nrfconnect-dtm",
"version": "2.4.0",
"version": "2.4.1",
"displayName": "Direct Test Mode",
"description": "RF PHY testing of Bluetooth Low Energy devices",
"homepage": "https://github.com/NordicSemiconductor/pc-nrfconnect-dtm",
Expand All @@ -11,7 +11,7 @@
"author": "Nordic Semiconductor ASA",
"license": "SEE LICENSE IN LICENSE",
"engines": {
"nrfconnect": ">=4.4.1"
"nrfconnect": ">=5.0.0"
},
"nrfConnectForDesktop": {
"nrfutil": {
Expand Down Expand Up @@ -45,7 +45,7 @@
"prepare": "husky install"
},
"devDependencies": {
"@nordicsemiconductor/pc-nrfconnect-shared": "^170.0.0",
"@nordicsemiconductor/pc-nrfconnect-shared": "^176.0.0",
"@testing-library/user-event": "^13.1.9",
"chart.js": "^4.0.1",
"chartjs-plugin-datalabels": "2.2.0",
Expand Down
8 changes: 6 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Receiver from './Receiver';
import appReducer from './reducers';
import SidePanel from './SidePanel';
import Transmitter from './Transmitter';
import { Panes } from './utils/panes';

import './index.scss';

Expand All @@ -28,10 +29,13 @@ render(
sidePanel={<SidePanel />}
panes={[
{
name: 'Transmitter',
name: Panes.TRANSMITTER,
Main: Transmitter,
},
{ name: 'Receiver', Main: Receiver },
{
name: Panes.RECEIVER,
Main: Receiver,
},
]}
/>
);
9 changes: 6 additions & 3 deletions src/utils/panes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ import { currentPane } from '@nordicsemiconductor/pc-nrfconnect-shared';

import { RootState } from '../reducers/types';

export const TRANSMITTER = 0;
export const RECEIVER = 1;
// todo: sync with Mode type from 'src/reducers/types.ts'
export enum Panes {
TRANSMITTER = 'Transmitter',
RECEIVER = 'Receiver',
}

export const isTransmitterPane = (state: RootState) =>
currentPane(state) === TRANSMITTER;
currentPane(state) === Panes.TRANSMITTER;

export const paneName = (state: RootState) =>
isTransmitterPane(state) ? 'transmitter' : 'receiver';

0 comments on commit 04077d0

Please sign in to comment.