HomePhabricator
Diffusion Comm 085f43d75697

[native] Improve device labels on device list screen

Description

[native] Improve device labels on device list screen

Summary:
Resolves ENG-9136

The previous label for current primary device looked weird with two parentheses:

someDeviceID (primary) (this device)

Depends on D13262

Test Plan:

  • Opened devices screen on native and verified they're now displayed correctly

Simulator Screenshot - iPhone 15 Pro - 2024-10-18 at 10.55.22.png (2×1 px, 188 KB)

  • JS playground:
function getLabel(deviceID, isPrimary, isThisDevice) {
  // contents of useMemo
}

getLabel('123456789', false, false) // '1234567'
getLabel('123456789', false, true)  // '1234567 (this device)'
getLabel('123456789', true, false)  // '1234567 (primary)'
getLabel('123456789', true, true)   // '1234567 (primary, this device)'

Reviewers: ashoat, varun

Reviewed By: ashoat

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D13747

Details

Provenance
bartekAuthored on Oct 17 2024, 7:33 AM
Reviewer
ashoat
Differential Revision
D13747: [native] Improve device labels on device list screen
Parents
rCOMM89cbd85b1c2a: [native] only display remove device button if current device is primary device
Branches
Unknown
Tags
Unknown