mirror of
https://github.com/zuiidea/antd-admin.git
synced 2024-04-21 12:32:14 +00:00
Merge pull request #1022 from rioarray/feature/inline-conditional-rendering
inline conditional rendering in some components
This commit is contained in:
@@ -6,7 +6,7 @@ const FilterItem = ({ label = '', children }) => {
|
||||
const labelArray = label.split('')
|
||||
return (
|
||||
<div className={styles.filterItem}>
|
||||
{labelArray.length > 0 ? (
|
||||
{labelArray.length > 0 && (
|
||||
<div className={styles.labelWrap}>
|
||||
{labelArray.map((item, index) => (
|
||||
<span className="labelText" key={index}>
|
||||
@@ -14,8 +14,6 @@ const FilterItem = ({ label = '', children }) => {
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
<div className={styles.item}>{children}</div>
|
||||
</div>
|
||||
|
||||
@@ -14,9 +14,7 @@ class Bread extends PureComponent {
|
||||
return paths.map((item, key) => {
|
||||
const content = item && (
|
||||
<Fragment>
|
||||
{item.icon ? (
|
||||
<Icon type={item.icon} style={{ marginRight: 4 }} />
|
||||
) : null}
|
||||
{item.icon && <Icon type={item.icon} style={{ marginRight: 4 }} />}
|
||||
{item.name}
|
||||
</Fragment>
|
||||
)
|
||||
|
||||
@@ -28,13 +28,13 @@ class Sider extends PureComponent {
|
||||
trigger={null}
|
||||
collapsible
|
||||
collapsed={collapsed}
|
||||
onBreakpoint={isMobile ? null : onCollapseChange}
|
||||
onBreakpoint={!isMobile && onCollapseChange}
|
||||
className={styles.sider}
|
||||
>
|
||||
<div className={styles.brand}>
|
||||
<div className={styles.logo}>
|
||||
<img alt="logo" src={config.logoPath} />
|
||||
{collapsed ? null : <h1>{config.siteName}</h1>}
|
||||
{!collapsed && <h1>{config.siteName}</h1>}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -54,7 +54,7 @@ class Sider extends PureComponent {
|
||||
/>
|
||||
</ScrollBar>
|
||||
</div>
|
||||
{collapsed ? null : (
|
||||
{!collapsed && (
|
||||
<div className={styles.switchTheme}>
|
||||
<span>
|
||||
<Icon type="bulb" />
|
||||
|
||||
Reference in New Issue
Block a user