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