This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: search user cards to include tags (#8376)
* feat: tags for user cards on search page (#8256) * new tag component, user card modifications * revert userCard, add userHorizontal * update test to reflect new search page layout * remove comments * clean up tag component * limit height of tags div, hide overflow --------- Co-authored-by: Eddie Jaoude <eddie@jaoudestudios.com> * fix: search card pr * fix: removed unused story --------- Co-authored-by: Amanda <97615019+amandamartin-dev@users.noreply.github.com>
- Loading branch information
1 parent
6b168ca
commit 9c6faa6
Showing
9 changed files
with
84 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function TagSimple({ name }) { | ||
return ( | ||
<div className="text-sm px-1 mx-px mb-2 font-mono border rounded-md line-clamp-1"> | ||
{name} | ||
</div> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import ReactMarkdown from "react-markdown"; | ||
|
||
import Link from "@components/Link"; | ||
import FallbackImage from "@components/FallbackImage"; | ||
import TagSimple from "@components/tag/TagSimple"; | ||
|
||
export default function UserHorizontal({ profile }) { | ||
return ( | ||
<Link | ||
href={`/${profile.username}`} | ||
className="flex flex-col items-center border-2 h-[14rem] overflow-hidden rounded-lg shadow-lg transition duration-350 p-4 gap-3 hover:scale-105 duration-500 ease-in-out hover:border-tertiary-medium" | ||
> | ||
<div className="flex w-full items-center justify-between space-x-2 p-2"> | ||
<FallbackImage | ||
src={`https://github.com/${profile.username}.png`} | ||
alt={`Profile picture of ${profile.name}`} | ||
width={60} | ||
height={60} | ||
className="rounded-full" | ||
fallback={profile.name} | ||
/> | ||
<div className="flex-1 wrap"> | ||
<div className="flex items-center space-x-3"> | ||
<h3 className="text-xl font-medium text-gray-900"> | ||
{profile.username} | ||
</h3> | ||
</div> | ||
<ReactMarkdown | ||
disallowedElements={["a"]} | ||
unwrapDisallowed | ||
className="text-left line-clamp-3" | ||
> | ||
{profile.bio} | ||
</ReactMarkdown> | ||
</div> | ||
</div> | ||
{profile.tags?.length > 0 && ( | ||
<div className="flex flex-wrap justify-center max-h-60 overflow-hidden"> | ||
{profile.tags?.length > 0 && | ||
profile.tags.map((tag, index) => { | ||
const trimmedTag = tag.trim(); | ||
if (!trimmedTag) { | ||
return null; | ||
} | ||
return <TagSimple name={trimmedTag} key={index} />; | ||
})} | ||
</div> | ||
)} | ||
</Link> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters