style: 调整代码样式

pull/13/head
moonrailgun 4 years ago
parent e2f2fca04d
commit 770ba62630

@ -10,7 +10,7 @@ export const GroupSection: React.FC<{
return ( return (
<div> <div>
<div <div
className="flex items-center cursor-pointer py-1" className="flex items-center cursor-pointer py-1 text-xs"
onClick={switchShow} onClick={switchShow}
> >
<Icon <Icon
@ -21,7 +21,7 @@ export const GroupSection: React.FC<{
<div>{props.header}</div> <div>{props.header}</div>
</div> </div>
<div <div
className="transition-all overflow-hidden" className="transition-all overflow-hidden space-y-0.5"
style={{ style={{
maxHeight: isShow ? 'var(--max-height)' : 0, maxHeight: isShow ? 'var(--max-height)' : 0,
}} }}

@ -29,12 +29,13 @@ export const Sidebar: React.FC = React.memo(() => {
{groupPanels {groupPanels
.filter((panel) => panel.parentId === group.id) .filter((panel) => panel.parentId === group.id)
.map((panel) => ( .map((panel) => (
<GroupPanelItem <div key={panel.id}>
key={panel.id} <GroupPanelItem
name={panel.name} name={panel.name}
icon={<div>#</div>} icon={<div>#</div>}
to={`/main/group/${groupId}/${panel.id}`} to={`/main/group/${groupId}/${panel.id}`}
/> />
</div>
))} ))}
</GroupSection> </GroupSection>
))} ))}

@ -25,18 +25,16 @@ export const GroupNav: React.FC = React.memo(() => {
<div className="space-y-2"> <div className="space-y-2">
{Array.isArray(groups) && {Array.isArray(groups) &&
groups.map((group) => ( groups.map((group) => (
<NavbarNavItem <div key={group._id}>
key={group._id} <NavbarNavItem name={group.name} to={`/main/group/${group._id}`}>
name={group.name} <Avatar
to={`/main/group/${group._id}`} shape="square"
> size={48}
<Avatar name={group.name}
shape="square" src={group.avatar}
size={48} />
name={group.name} </NavbarNavItem>
src={group.avatar} </div>
/>
</NavbarNavItem>
))} ))}
{/* 创建群组 */} {/* 创建群组 */}

Loading…
Cancel
Save