From 39adc68b87b75fbfd934cfc74f3292c2d37141b7 Mon Sep 17 00:00:00 2001 From: Kim Brose Date: Thu, 7 Jul 2022 14:39:36 +0200 Subject: [PATCH 1/7] add spaces to TileErrorBoundary Signed-off-by: Kim Brose --- src/components/views/messages/TileErrorBoundary.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/messages/TileErrorBoundary.tsx b/src/components/views/messages/TileErrorBoundary.tsx index 361dae2a6bb..6501c82ec6d 100644 --- a/src/components/views/messages/TileErrorBoundary.tsx +++ b/src/components/views/messages/TileErrorBoundary.tsx @@ -92,8 +92,9 @@ export default class TileErrorBoundary extends React.Component {
{ _t("Can't load this message") } - { mxEvent && ` (${mxEvent.getType()})` } + { mxEvent && ` (${mxEvent.getType()}) ` } { submitLogsButton } + { ` ` } { viewSourceButton }
From f6ca2fc7dfe21364c7cc8f00ceadfe6ffdb8a871 Mon Sep 17 00:00:00 2001 From: Kim Brose <2803622+HarHarLinks@users.noreply.github.com> Date: Thu, 7 Jul 2022 15:28:53 +0200 Subject: [PATCH 2/7] use nbsp --- src/components/views/messages/TileErrorBoundary.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/messages/TileErrorBoundary.tsx b/src/components/views/messages/TileErrorBoundary.tsx index 6501c82ec6d..e60b383c9e0 100644 --- a/src/components/views/messages/TileErrorBoundary.tsx +++ b/src/components/views/messages/TileErrorBoundary.tsx @@ -92,9 +92,9 @@ export default class TileErrorBoundary extends React.Component {
{ _t("Can't load this message") } - { mxEvent && ` (${mxEvent.getType()}) ` } + { mxEvent && ` (${mxEvent.getType()}) ` } { submitLogsButton } - { ` ` } + { ` ` } { viewSourceButton }
From a17d97492b6cb0955d264a95cda30492c9a81930 Mon Sep 17 00:00:00 2001 From: Kim Brose <2803622+HarHarLinks@users.noreply.github.com> Date: Thu, 7 Jul 2022 15:29:11 +0200 Subject: [PATCH 3/7] add space conditionally --- src/components/views/messages/TileErrorBoundary.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/views/messages/TileErrorBoundary.tsx b/src/components/views/messages/TileErrorBoundary.tsx index e60b383c9e0..5ac5f0cb14b 100644 --- a/src/components/views/messages/TileErrorBoundary.tsx +++ b/src/components/views/messages/TileErrorBoundary.tsx @@ -83,7 +83,7 @@ export default class TileErrorBoundary extends React.Component { let viewSourceButton; if (mxEvent && SettingsStore.getValue("developerMode")) { - viewSourceButton = + viewSourceButton =   { _t("View Source") } ; } @@ -94,7 +94,6 @@ export default class TileErrorBoundary extends React.Component { { _t("Can't load this message") } { mxEvent && ` (${mxEvent.getType()}) ` } { submitLogsButton } - { ` ` } { viewSourceButton } From 96cfaf0d7a2b0825a558c23e55c3bee6b652e5cb Mon Sep 17 00:00:00 2001 From: HarHarLinks Date: Fri, 8 Jul 2022 19:40:38 +0200 Subject: [PATCH 4/7] learn some TS + JSX Signed-off-by: HarHarLinks --- src/components/views/messages/TileErrorBoundary.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/messages/TileErrorBoundary.tsx b/src/components/views/messages/TileErrorBoundary.tsx index 5ac5f0cb14b..2936db86b33 100644 --- a/src/components/views/messages/TileErrorBoundary.tsx +++ b/src/components/views/messages/TileErrorBoundary.tsx @@ -82,8 +82,10 @@ export default class TileErrorBoundary extends React.Component { } let viewSourceButton; + let spaceViewSourceButton; if (mxEvent && SettingsStore.getValue("developerMode")) { - viewSourceButton =   + spaceViewSourceButton = " " + viewSourceButton = { _t("View Source") } ; } @@ -94,6 +96,7 @@ export default class TileErrorBoundary extends React.Component { { _t("Can't load this message") } { mxEvent && ` (${mxEvent.getType()}) ` } { submitLogsButton } + { spaceViewSourceButton } { viewSourceButton } From 76b7a38edeb7072cb46281448465fe6952b078c3 Mon Sep 17 00:00:00 2001 From: HarHarLinks Date: Fri, 8 Jul 2022 19:47:55 +0200 Subject: [PATCH 5/7] feed some ; to the nice linter Signed-off-by: HarHarLinks --- src/components/views/messages/TileErrorBoundary.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/messages/TileErrorBoundary.tsx b/src/components/views/messages/TileErrorBoundary.tsx index 2936db86b33..6bb8b7f296c 100644 --- a/src/components/views/messages/TileErrorBoundary.tsx +++ b/src/components/views/messages/TileErrorBoundary.tsx @@ -84,7 +84,7 @@ export default class TileErrorBoundary extends React.Component { let viewSourceButton; let spaceViewSourceButton; if (mxEvent && SettingsStore.getValue("developerMode")) { - spaceViewSourceButton = " " + spaceViewSourceButton = " "; viewSourceButton = { _t("View Source") } ; From 9743844390418239ea391480b58d03bba133ca51 Mon Sep 17 00:00:00 2001 From: HarHarLinks Date: Sat, 9 Jul 2022 13:00:18 +0200 Subject: [PATCH 6/7] refactor nbsp Signed-off-by: HarHarLinks --- .../views/messages/TileErrorBoundary.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/views/messages/TileErrorBoundary.tsx b/src/components/views/messages/TileErrorBoundary.tsx index 6bb8b7f296c..e9e58084764 100644 --- a/src/components/views/messages/TileErrorBoundary.tsx +++ b/src/components/views/messages/TileErrorBoundary.tsx @@ -82,21 +82,21 @@ export default class TileErrorBoundary extends React.Component { } let viewSourceButton; - let spaceViewSourceButton; if (mxEvent && SettingsStore.getValue("developerMode")) { - spaceViewSourceButton = " "; - viewSourceButton = - { _t("View Source") } - ; + viewSourceButton = <> +   + + { _t("View Source") } + + ; } return (
  • { _t("Can't load this message") } - { mxEvent && ` (${mxEvent.getType()}) ` } + { mxEvent && ` (${mxEvent.getType()})` }   { submitLogsButton } - { spaceViewSourceButton } { viewSourceButton }
    From 186b59c65f48bc0a11cfa4911765ff1400ccd86b Mon Sep 17 00:00:00 2001 From: HarHarLinks Date: Mon, 11 Jul 2022 14:03:08 +0200 Subject: [PATCH 7/7] add space conditionally, pt 2 Signed-off-by: HarHarLinks --- src/components/views/messages/TileErrorBoundary.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/views/messages/TileErrorBoundary.tsx b/src/components/views/messages/TileErrorBoundary.tsx index e9e58084764..4f7d452dedd 100644 --- a/src/components/views/messages/TileErrorBoundary.tsx +++ b/src/components/views/messages/TileErrorBoundary.tsx @@ -76,9 +76,12 @@ export default class TileErrorBoundary extends React.Component { let submitLogsButton; if (SdkConfig.get().bug_report_endpoint_url) { - submitLogsButton = - { _t("Submit logs") } - ; + submitLogsButton = <> +   + + { _t("Submit logs") } + + ; } let viewSourceButton; @@ -95,7 +98,7 @@ export default class TileErrorBoundary extends React.Component {
    { _t("Can't load this message") } - { mxEvent && ` (${mxEvent.getType()})` }   + { mxEvent && ` (${mxEvent.getType()})` } { submitLogsButton } { viewSourceButton }