Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/components/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ const ProjectTag = ({ children }:{children?: ReactNode}) => {
};

const ProjectLink = ({ children, link, newTab } : {children?: ReactNode, link: string, newTab?: true}) => {
const LinkContent = ({ children }:{children?: ReactNode}) => {
return (
<div className="project-card-link-content">
{children}
</div>
);
};

return (
<Link href={link} target={newTab ? "_blank" : "_self"} className="project-card-link">
<div className="flex justify-center">
{children} {newTab && <IconExternalLink className="w-4 h-4" />}
<div className="project-card-link-content-container">
<LinkContent>{children}</LinkContent> {newTab && <IconExternalLink className="w-4 h-4 hide-on-mobile" />}
</div>
</Link>
);
Expand All @@ -37,26 +45,31 @@ const ProjectCard = ({ title, description, repoLink, demoLink, videoLink, design
{videoLink &&
<ProjectLink link={videoLink} newTab>
<IconBrandYoutube />
<span className="hide-on-desktop">video</span>
</ProjectLink>
}
{demoLink &&
<ProjectLink link={demoLink} newTab>
<IconPlayerPlay />
<span className="hide-on-desktop">demo</span>
</ProjectLink>
}
{repoLink &&
<ProjectLink link={repoLink} newTab>
<IconCode />
<span className="hide-on-desktop">code</span>
</ProjectLink>
}
{designLink &&
<ProjectLink link={designLink} newTab>
<IconBrush />
<span className="hide-on-desktop">design</span>
</ProjectLink>
}
{paperLink &&
<ProjectLink link={paperLink} newTab>
<IconFile />
<span className="hide-on-desktop">paper</span>
</ProjectLink>
}
</div>
Expand Down
8 changes: 8 additions & 0 deletions src/styles/components/project-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
.project-card-links .project-card-link {
@apply py-2 px-4 min-w-[72px] bg-orange-500 bg-opacity-30 rounded-full
hover:text-orange-600 dark:hover:text-orange-300;

.project-card-link-content-container {
@apply flex justify-center gap-1;
}

.project-card-link-content-container .project-card-link-content {
@apply flex gap-1;
}
}

.project-card-tags {
Expand Down
1 change: 1 addition & 0 deletions src/styles/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "fonts.css";
@import "utils.css";

@import "pages/pages.css";
@import "pages/home.css";
Expand Down
7 changes: 7 additions & 0 deletions src/styles/utils.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.hide-on-mobile {
@apply md:block hidden;
}

.hide-on-desktop {
@apply md:hidden;
}