1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

refactor: use conditionally render instead of && (#4620)

For consistency and readability.
This commit is contained in:
Thomas Heartman 2023-09-06 13:51:04 +02:00 committed by GitHub
parent caff040a88
commit 34d595b5a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -157,18 +157,28 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
<dd> <dd>
<code>{featureNaming?.pattern}</code> <code>{featureNaming?.pattern}</code>
</dd> </dd>
{Boolean(featureNaming?.example) && ( <ConditionallyRender
condition={Boolean(featureNaming?.example)}
show={
<> <>
<dt>Example</dt> <dt>Example</dt>
<dd>{featureNaming?.example}</dd> <dd>{featureNaming?.example}</dd>
</> </>
}
/>
<ConditionallyRender
condition={Boolean(
featureNaming?.description
)} )}
{Boolean(featureNaming?.description) && ( show={
<> <>
<dt>Description</dt> <dt>Description</dt>
<dd>{featureNaming?.description}</dd> <dd>
{featureNaming?.description}
</dd>
</> </>
)} }
/>
</dl> </dl>
</StyledFlagNamingInfo> </StyledFlagNamingInfo>
} }