From f5dbc76ef5a0c94b95e8bdf7a164a3329810bb14 Mon Sep 17 00:00:00 2001 From: willclarktech Date: Tue, 8 Jun 2021 14:51:54 +0200 Subject: [PATCH] Use && conditional syntax --- src/App/components/ChannelCounterpartyData.tsx | 4 ++-- src/App/components/ConnectionCounterpartyData.tsx | 4 ++-- src/App/routes/Acknowledgement/index.tsx | 6 +++--- src/App/routes/Channel/ChannelData.tsx | 4 ++-- src/App/routes/Commitment/index.tsx | 6 +++--- src/App/routes/Connection/ConnectionData.tsx | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/App/components/ChannelCounterpartyData.tsx b/src/App/components/ChannelCounterpartyData.tsx index b2a0a5c..e4455ed 100644 --- a/src/App/components/ChannelCounterpartyData.tsx +++ b/src/App/components/ChannelCounterpartyData.tsx @@ -11,8 +11,8 @@ export function CounterpartyData({ counterparty }: CounterpartyDataProps): JSX.E return (
Counterparty - {counterparty?.portId ? Port ID: {counterparty.portId} : null} - {counterparty?.channelId ? Channel ID: {counterparty.channelId} : null} + {counterparty?.portId && Port ID: {counterparty.portId}} + {counterparty?.channelId && Channel ID: {counterparty.channelId}}
); } diff --git a/src/App/components/ConnectionCounterpartyData.tsx b/src/App/components/ConnectionCounterpartyData.tsx index 9b5c7ec..5e45de0 100644 --- a/src/App/components/ConnectionCounterpartyData.tsx +++ b/src/App/components/ConnectionCounterpartyData.tsx @@ -12,8 +12,8 @@ export function CounterpartyData({ counterparty }: CounterpartyDataProps): JSX.E return (
Counterparty - {counterparty?.clientId ? Client ID: {counterparty.clientId} : null} - {counterparty?.connectionId ? Connection ID: {counterparty.connectionId} : null} + {counterparty?.clientId && Client ID: {counterparty.clientId}} + {counterparty?.connectionId && Connection ID: {counterparty.connectionId}} {counterparty?.prefix?.keyPrefix?.length ? ( Prefix: {toHex(counterparty?.prefix?.keyPrefix)} ) : null} diff --git a/src/App/routes/Acknowledgement/index.tsx b/src/App/routes/Acknowledgement/index.tsx index 6748b03..33f6b66 100644 --- a/src/App/routes/Acknowledgement/index.tsx +++ b/src/App/routes/Acknowledgement/index.tsx @@ -38,9 +38,9 @@ export function Acknowledgement(): JSX.Element {
Data - {portId ? Port ID: {portId} : null} - {channelId ? Channel ID: {channelId} : null} - {sequence ? Sequence: {sequence} : null} + {portId && Port ID: {portId}} + {channelId && Channel ID: {channelId}} + {sequence && Sequence: {sequence}} {ackResponse?.acknowledgement ? (
Proof: {ackResponse.proof?.length ? toHex(ackResponse.proof) : "–"} diff --git a/src/App/routes/Channel/ChannelData.tsx b/src/App/routes/Channel/ChannelData.tsx index 2420f4a..858929c 100644 --- a/src/App/routes/Channel/ChannelData.tsx +++ b/src/App/routes/Channel/ChannelData.tsx @@ -27,8 +27,8 @@ export function ChannelData({ portId, channelId }: ChannelDataProps): JSX.Elemen return channelResponse?.channel ? (
Data
- {portId ?
Port ID: {portId}
: null} - {channelId ?
Channel ID: {channelId}
: null} + {portId &&
Port ID: {portId}
} + {channelId &&
Channel ID: {channelId}
}
Proof: {channelResponse.proof?.length ? toHex(channelResponse.proof) : "–"}
diff --git a/src/App/routes/Commitment/index.tsx b/src/App/routes/Commitment/index.tsx index 43ce00b..61225bb 100644 --- a/src/App/routes/Commitment/index.tsx +++ b/src/App/routes/Commitment/index.tsx @@ -39,9 +39,9 @@ export function Commitment(): JSX.Element {
Data - {portId ? Port ID: {portId} : null} - {channelId ? Channel ID: {channelId} : null} - {sequence ? Sequence: {sequence} : null} + {portId && Port ID: {portId}} + {channelId && Channel ID: {channelId}} + {sequence && Sequence: {sequence}} {commitmentResponse?.commitment ? (
Proof: {commitmentResponse.proof?.length ? toHex(commitmentResponse.proof) : "–"} diff --git a/src/App/routes/Connection/ConnectionData.tsx b/src/App/routes/Connection/ConnectionData.tsx index 8d8bc16..4caffdb 100644 --- a/src/App/routes/Connection/ConnectionData.tsx +++ b/src/App/routes/Connection/ConnectionData.tsx @@ -26,7 +26,7 @@ export function ConnectionData({ connectionId }: ConnectionDataProps): JSX.Eleme return connectionResponse?.connection ? (
Data
- {connectionId ?
Connection ID: {connectionId}
: null} + {connectionId &&
Connection ID: {connectionId}
}
Proof: {connectionResponse.proof?.length ? toHex(connectionResponse.proof) : "–"}