-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
11 changed files
with
1,127 additions
and
1,050 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ jobs: | |
- uses: actions/labeler@v5 | ||
with: | ||
configuration-path: .github/labeler.yml | ||
sync-labels: true |
Large diffs are not rendered by default.
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
Large diffs are not rendered by default.
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,21 @@ | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | ||
|
||
const InfoBlock = ({ icon, label = '', value, isLink = false, className = '' }) => ( | ||
<div className={`flex ${className}`}> | ||
<FontAwesomeIcon icon={icon} className="mr-3 mt-1 w-5" /> | ||
<div> | ||
<div className="text-sm md:text-base"> | ||
{label && <div className="text-sm font-medium">{label}</div>} | ||
{isLink ? ( | ||
<a href={value} className="hover:underline dark:text-sky-600"> | ||
{value} | ||
</a> | ||
) : ( | ||
value | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
|
||
export default InfoBlock |
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,8 @@ | ||
const SecondaryCard = ({ title, children, className = '' }) => ( | ||
<div className={`mb-8 rounded-lg bg-gray-100 p-6 shadow-md dark:bg-gray-800 ${className}`}> | ||
<h2 className="mb-4 text-2xl font-semibold">{title}</h2> | ||
{children} | ||
</div> | ||
) | ||
|
||
export default SecondaryCard |
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,66 @@ | ||
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons' | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | ||
import { useState } from 'react' | ||
import { useNavigate } from 'react-router-dom' | ||
const TopContributors = ({ | ||
contributors, | ||
label = 'Top Contributors', | ||
maxInitialDisplay = 6, | ||
className = '', | ||
}) => { | ||
const navigate = useNavigate() | ||
const [showAllContributors, setShowAllContributors] = useState(false) | ||
|
||
const toggleContributors = () => setShowAllContributors(!showAllContributors) | ||
|
||
const displayContributors = showAllContributors | ||
? contributors | ||
: contributors.slice(0, maxInitialDisplay) | ||
|
||
return ( | ||
<div className={`mb-8 rounded-lg bg-gray-100 p-6 shadow-md dark:bg-gray-800 ${className}`}> | ||
<h2 className="mb-4 text-2xl font-semibold">{label}</h2> | ||
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3"> | ||
{displayContributors.map((contributor, index) => ( | ||
<div | ||
key={index} | ||
onClick={() => navigate(`/community/users/${contributor.login}`)} | ||
className="flex cursor-pointer items-center space-x-3 rounded-lg p-3 hover:bg-gray-200 dark:hover:bg-gray-700" | ||
> | ||
<img | ||
src={contributor.avatar_url} | ||
alt={contributor.name || contributor.login} | ||
className="mr-3 h-10 w-10 rounded-full" | ||
/> | ||
<div> | ||
<p className="font-semibold text-blue-600 hover:underline dark:text-sky-400"> | ||
{contributor.name || contributor.login} | ||
</p> | ||
<p className="text-sm text-gray-600 dark:text-gray-400"> | ||
{contributor.contributions_count} contributions | ||
</p> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
{contributors.length > maxInitialDisplay && ( | ||
<button | ||
onClick={toggleContributors} | ||
className="mt-4 flex items-center text-[#1d7bd7] hover:underline dark:text-sky-600" | ||
> | ||
{showAllContributors ? ( | ||
<> | ||
Show less <FontAwesomeIcon icon={faChevronUp} className="ml-1" /> | ||
</> | ||
) : ( | ||
<> | ||
Show more <FontAwesomeIcon icon={faChevronDown} className="ml-1" /> | ||
</> | ||
)} | ||
</button> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
export default TopContributors |
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,43 @@ | ||
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons' | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | ||
import { useState } from 'react' | ||
|
||
const ToggleableList = ({ items, label, limit = 10 }) => { | ||
const [showAll, setShowAll] = useState(false) | ||
|
||
const toggleShowAll = () => setShowAll(!showAll) | ||
|
||
return ( | ||
<div className="rounded-lg bg-gray-100 p-6 shadow-md dark:bg-gray-800"> | ||
<h2 className="mb-4 text-2xl font-semibold">{label}</h2> | ||
<div className="flex flex-wrap gap-2"> | ||
{(showAll ? items : items.slice(0, limit)).map((item, index) => ( | ||
<span | ||
key={index} | ||
className="rounded-lg border border-gray-400 px-2 py-1 text-sm dark:border-gray-300" | ||
> | ||
{item} | ||
</span> | ||
))} | ||
</div> | ||
{items.length > limit && ( | ||
<button | ||
onClick={toggleShowAll} | ||
className="mt-4 flex items-center text-[#1d7bd7] hover:underline dark:text-sky-600" | ||
> | ||
{showAll ? ( | ||
<> | ||
Show less <FontAwesomeIcon icon={faChevronUp} className="ml-1" /> | ||
</> | ||
) : ( | ||
<> | ||
Show more <FontAwesomeIcon icon={faChevronDown} className="ml-1" /> | ||
</> | ||
)} | ||
</button> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
export default ToggleableList |
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.