Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
695 additions
and
303 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as HoverCard from "@radix-ui/react-hover-card"; | ||
import Link from "next/link"; | ||
import HoverCardWrapper from "components/molecules/HoverCardWrapper/hover-card-wrapper"; | ||
import { Avatar } from "components/atoms/Avatar/avatar-hover-card"; | ||
|
||
export default function StackedOwners({ owners }: { owners: string[] }) { | ||
return ( | ||
<div className="flex -space-x-3 transition-all duration-300 hover:-space-x-1"> | ||
{owners.slice(0, owners.length > 4 ? 4 : owners.length).map((username) => ( | ||
<div | ||
key={`owner-picture-${username}`} | ||
className="w-8 h-8 overflow-hidden transition-all duration-300 border-2 border-white border-solid rounded-full" | ||
> | ||
<HoverCard.Root> | ||
<Link href={`/user/${username}`} as={`/user/${username}`}> | ||
<HoverCard.Trigger> | ||
<Avatar contributor={username} /> | ||
</HoverCard.Trigger> | ||
</Link> | ||
|
||
<HoverCard.Portal> | ||
<HoverCard.Content sideOffset={5}> | ||
<HoverCardWrapper username={username} /> | ||
</HoverCard.Content> | ||
</HoverCard.Portal> | ||
</HoverCard.Root> | ||
</div> | ||
))} | ||
|
||
{owners.length > 4 && ( | ||
<div className="text-xs flex items-center bg-slate-100 text-center px-1 w-8 h-8 overflow-hidden transition-all duration-300 border-2 border-white border-solid rounded-full"> | ||
<p>+{owners.length - 4}</p> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} |
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,40 @@ | ||
import { useEffect, useState } from "react"; | ||
import MultiSelect, { OptionKeys } from "components/atoms/Select/multi-select"; | ||
|
||
type TrackedRepositoryFilterProps = { | ||
options: OptionKeys[]; | ||
handleSelect: (selected: OptionKeys[]) => void; | ||
}; | ||
|
||
export default function TrackedRepositoryFilter({ options, handleSelect }: TrackedRepositoryFilterProps) { | ||
const [isMultiSelectOpen, setIsMultiSelectOpen] = useState(false); | ||
const [selected, setSelected] = useState<OptionKeys[]>([]); | ||
|
||
useEffect(() => { | ||
handleSelect(selected); | ||
}, [selected]); | ||
|
||
return ( | ||
<MultiSelect | ||
placeholder="Filter" | ||
inputPlaceholder="Search repositories" | ||
className="px-3" | ||
options={options} | ||
open={isMultiSelectOpen} | ||
setOpen={setIsMultiSelectOpen} | ||
selected={selected} | ||
setSelected={setSelected} | ||
handleSelect={(option) => { | ||
setSelected((list) => { | ||
// toggle: if already in, filter, else add into list | ||
if (list.find((o) => o.value === option.value)) { | ||
list = list.filter((o) => o.value !== option.value); | ||
} else { | ||
list = [...list, option]; | ||
} | ||
return list; | ||
}); | ||
}} | ||
/> | ||
); | ||
} |
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 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 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
Oops, something went wrong.