From 0617accecdcb11159ba15c34885f294bc206aa89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateo=20Guzm=C3=A1n?= Date: Wed, 9 Apr 2025 06:36:36 -0700 Subject: [PATCH] RNTester: Fix playground icon & test details button (#50530) Summary: Some minor fixes in the RNTester that were bugging me a bit: - Playground tab icon is not displaying the correct icon when the tab is active. - The RNTTestDetails button is being displayed when there is nothing to display. - Export the data for the Playground tab correctly to display the description. ## Changelog: [INTERNAL] - RNTester: Fix playground icon & test details button Pull Request resolved: https://github.com/facebook/react-native/pull/50530 Test Plan:
Screenshots | Before | After | |------------------------------------|------------------------------------| | ![Screenshot_1744044385](https://github.com/user-attachments/assets/d4a08423-531b-49a8-b3c5-314e0bd55b4c) | ![Screenshot_1744044377](https://github.com/user-attachments/assets/c36cde64-d48d-4f80-95db-2e4f9765b350) |
Reviewed By: NickGerleman Differential Revision: D72576804 Pulled By: cortinico fbshipit-source-id: 8555677a5121fe908c18d349e80ce8097d144fe5 --- .../rn-tester/js/components/RNTTestDetails.js | 49 ++++++++++--------- .../rn-tester/js/components/RNTesterTheme.js | 4 +- .../examples/Playground/RNTesterPlayground.js | 1 + 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/packages/rn-tester/js/components/RNTTestDetails.js b/packages/rn-tester/js/components/RNTTestDetails.js index 8cf46bce804..7c3af618c63 100644 --- a/packages/rn-tester/js/components/RNTTestDetails.js +++ b/packages/rn-tester/js/components/RNTTestDetails.js @@ -25,30 +25,31 @@ function RNTTestDetails({ }): React.Node { const [collapsed, setCollapsed] = React.useState(true); - const content = ( - <> - {description == null ? null : ( - - - Description - - - {description} - - - )} - {expect == null ? null : ( - - - Expectation - - - {expect} - - - )} - - ); + const content = + description == null && expect == null ? null : ( + <> + {description == null ? null : ( + + + Description + + + {description} + + + )} + {expect == null ? null : ( + + + Expectation + + + {expect} + + + )} + + ); return ( , }: RNTesterModuleExample);