Skip to content

Commit

Permalink
fix(web): fix display issue when username does not exist (#1411)
Browse files Browse the repository at this point in the history
  • Loading branch information
newfish-cmyk authored Jul 17, 2023
1 parent ce6ad79 commit 85ca268
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions web/src/pages/functionTemplate/Mods/TemplateInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,33 @@ const TemplateInfo = (props: { functionTemplate: TFunctionTemplate; usedBy: any[
<div>
<UseTemplate template={functionTemplate} />
<div>
<Box className="border-b-[1px]">
<span className="text-xl font-semibold">{t("Template.DeveloperInfo")}</span>
<Box className="flex max-h-40 overflow-auto py-5">
<Avatar
width={12}
height={12}
border={"2px solid #DEE0E2"}
src={getAvatarUrl(functionTemplate?.uid)}
name={functionTemplate.user.username}
backgroundColor={"primary.500"}
/>
<div className="ml-3 flex flex-col">
<span className="text-lg font-semibold text-grayModern-900">
{functionTemplate.user.username}
</span>
<Tooltip label={t("Developing")}>
<span className="space-x-1 text-grayModern-400">
<WechatIcon />
<GithubIcon />
<PhoneIcon />
{functionTemplate.user?.username && (
<Box className="border-b-[1px]">
<span className="text-xl font-semibold">{t("Template.DeveloperInfo")}</span>
<Box className="flex max-h-40 overflow-auto py-5">
<Avatar
width={12}
height={12}
border={"2px solid #DEE0E2"}
src={getAvatarUrl(functionTemplate?.uid)}
name={functionTemplate.user?.username}
backgroundColor={"primary.500"}
/>
<div className="ml-3 flex flex-col">
<span className="text-lg font-semibold text-grayModern-900">
{functionTemplate.user?.username}
</span>
</Tooltip>
</div>
<Tooltip label={t("Developing")}>
<span className="space-x-1 text-grayModern-400">
<WechatIcon />
<GithubIcon />
<PhoneIcon />
</span>
</Tooltip>
</div>
</Box>
</Box>
</Box>
)}
<Box className="border-b-[1px] pt-5">
<span className="text-xl font-semibold">{t("Template.Function")}</span>
<Box className="max-h-40 overflow-auto py-2">
Expand Down

0 comments on commit 85ca268

Please sign in to comment.