Skip to content

Commit

Permalink
Show GitHub icon for GitHub links
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteAsian123 committed Aug 15, 2024
1 parent fb2c931 commit d8cc525
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/profiles/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export interface Metadata {
links: {
[id: string]: {
name: string,
iconUrl?: string,
url: string,
}
},
Expand Down
12 changes: 12 additions & 0 deletions src/routes/AppProfile/AppProfile.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,16 @@
text-transform: none;
width: 100%;
justify-content: left;

padding: 3px;
padding-left: 15px;
}

.sidebar > button > .icon {
width: 24px;
height: 40px;

display: flex;
justify-content: center;
align-items: center;
}
18 changes: 13 additions & 5 deletions src/routes/AppProfile/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useParams } from "react-router-dom";
import { useProfileState } from "@app/hooks/useProfileState";
import styles from "./AppProfile.module.css";
import { InformationIcon, TimeIcon, VerifiedIcon } from "@app/assets/Icons";
import { GithubIcon, InformationIcon, LinkIcon, TimeIcon, VerifiedIcon } from "@app/assets/Icons";
import { LaunchButton } from "./LaunchButton";
import { localizeMetadata, processAssetUrl } from "@app/profiles/utils";
import Box from "@app/components/Box";
Expand Down Expand Up @@ -79,13 +79,21 @@ function AppProfile() {
{metadata.description}
</Box>
{
Object.entries(metadata.links).map(i =>
<Button color={ButtonColor.LIGHT} key={i[0]}
Object.entries(metadata.links).map(i => {
let icon = <LinkIcon width={12} height={12} />;
if (i[1].url.startsWith("https://github.com")) {
icon = <GithubIcon width={24} height={24} />;
}

return <Button color={ButtonColor.LIGHT} key={i[0]}
onClick={async () => await askOpenUrl(i[1].url)}>

<div className={styles.icon}>
{icon}
</div>
{i[1].name}
</Button>
)
</Button>;
})
}
</div>
</div>
Expand Down

0 comments on commit d8cc525

Please sign in to comment.