1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +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>
<code>{featureNaming?.pattern}</code>
</dd>
{Boolean(featureNaming?.example) && (
<>
<dt>Example</dt>
<dd>{featureNaming?.example}</dd>
</>
)}
{Boolean(featureNaming?.description) && (
<>
<dt>Description</dt>
<dd>{featureNaming?.description}</dd>
</>
)}
<ConditionallyRender
condition={Boolean(featureNaming?.example)}
show={
<>
<dt>Example</dt>
<dd>{featureNaming?.example}</dd>
</>
}
/>
<ConditionallyRender
condition={Boolean(
featureNaming?.description
)}
show={
<>
<dt>Description</dt>
<dd>
{featureNaming?.description}
</dd>
</>
}
/>
</dl>
</StyledFlagNamingInfo>
}