Skip to content

Commit

Permalink
fix(ProfilePinnedRepositories): some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
christianfds committed Oct 12, 2022
1 parent da1e91e commit b674900
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
20 changes: 12 additions & 8 deletions components/profile/ProfilePinnedRepositories.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ const ProfilePinnedRepositories = ({ username, pinnedRepositories }) => {
{')'}
</div>
</p>
<div className="flex flex-col gap-4 pt-4 max-h-[450px] overflow-y-scroll pt-2 pr-5">
<div className="flex flex-col gap-4 max-h-[450px] overflow-y-scroll pt-2 pr-5">
{pinnedRepositories?.nodes.map((repo) => (
<Link href={`${repo.url}`} key={repo.id}>
<a className="flex items-center gap-3 rounded-md shadow-bs5 hover:shadow-bs2 transition-all duration-200 p-2 border-2 border-slate-300 dark:border-gray-700 dark:bg-dark-gray">
<a className="flex items-center rounded-md shadow-bs5 hover:shadow-bs2 p-2 border-2 border-slate-300 dark:border-gray-700 dark:bg-dark-gray">
<div className="w-full">

<p className="text-base font-semibold">
<svg className="w-3.5 h-3.5 inline mr-1" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(0.011928, 0, 0, -0.011928, 220.936829, 277.006042)" fill="currentColor" stroke="none">
Expand All @@ -30,19 +31,21 @@ const ProfilePinnedRepositories = ({ username, pinnedRepositories }) => {
</svg>
{repo.name}
</p>

<p className="font-normal text-sm">
{repo.shortDescriptionHTML}
</p>

<p className="font-normal flex items-center justify-between text-slate-600 text-xs">
<span className="flex items-center leading-none">
<svg className="w-3 h-3 inline" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" />
<svg className="w-3 h-3 inline" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" />
</svg>
{ repo.stargazerCount }
{' | '}
<svg className="w-3 h-3 inline" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z" />
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<svg className="w-3 h-3 inline" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" d="M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z" />
<path strokeLinecap="round" strokeLinejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
</svg>
{ repo.watchers.totalCount }
{' | '}
Expand All @@ -51,9 +54,10 @@ const ProfilePinnedRepositories = ({ username, pinnedRepositories }) => {
</svg>
{ repo.forks.totalCount }
</span>

<div className="text-right">
{repo.languages?.nodes.map((lang) => (
<div className="flex align-middle">
<div className="flex align-middle" key={lang.id}>
<span className="leading-none">{ lang.name }</span>
<div className="w-3 h-3 ml-1 inline-block rounded-full border-solid border" style={{backgroundColor: lang.color, borderColor: "rgba(255,255,255,0.2)"}}></div>
</div>
Expand Down
1 change: 1 addition & 0 deletions graphql/Query.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const GET_USER = gql`
languages(first: 1, orderBy: {direction: DESC, field: SIZE}) {
nodes {
... on Language {
id
name
color
}
Expand Down

0 comments on commit b674900

Please sign in to comment.