列表的type字段为头像跳转到个人中心或者组织的判断依据

This commit is contained in:
caishi 2021-04-06 11:45:03 +08:00
parent 5d6b95ab8f
commit c8eda704e5
2 changed files with 10 additions and 10 deletions

View File

@ -27,7 +27,7 @@ class IndexItem extends Component {
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img> <img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
</a> </a>
: :
<Link to={`/users/${item.author.login}`} className="show-user-link"> <Link to={item.author && (item.author.type === "Organization" ? `/organize/${item.author.login}`:`/users/${item.author.login}`)} className="show-user-link">
<img className="p-r-photo" alt="" src={getImageUrl(`${item.author && item.author.image_url}`)} ></img> <img className="p-r-photo" alt="" src={getImageUrl(`${item.author && item.author.image_url}`)} ></img>
</Link> </Link>
} }

View File

@ -97,18 +97,18 @@ function DetailBanner({ list , owner , projectsId , isManager , url , pathname ,
</Link> </Link>
</li> </li>
} }
</React.Fragment>
)
})
}
{ {
isManager && platform ? item.menu_name === "setting" &&
<li className={pathname === "setting" ? "active" : ""}> <li className={pathname === "setting" ? "active" : ""}>
<Link to={`/projects/${owner}/${projectsId}/setting`}> <Link to={`/projects/${owner}/${projectsId}/setting`}>
<i className={url && url.indexOf("/setting") > 0 ? "iconfont icon-cangku color-grey-3 mr5 font-14":"iconfont icon-cangku color-grey-6 font-14 mr5"}></i> <i className={url && url.indexOf("/setting") > 0 ? "iconfont icon-cangku color-grey-3 mr5 font-14":"iconfont icon-cangku color-grey-6 font-14 mr5"}></i>
<span>仓库设置</span> <span>仓库设置</span>
</Link> </Link>
</li>:"" </li>
}
</React.Fragment>
)
})
} }
</ul> </ul>
: :