-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Highlight projects that want maintainers (#283)
Closes #249 Signed-off-by: Sergio Castaño Arteaga <[email protected]> Signed-off-by: Cintia Sanchez Garcia <[email protected]> Co-authored-by: Sergio Castaño Arteaga <[email protected]> Co-authored-by: Cintia Sanchez Garcia <[email protected]>
- Loading branch information
1 parent
a1d6155
commit a925c54
Showing
10 changed files
with
254 additions
and
4 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
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,46 @@ | ||
.dropdown { | ||
margin-top: 25px; | ||
} | ||
|
||
.badge { | ||
padding: 0.2em 0.5em; | ||
background-color: var(--bs-white); | ||
border: 1px solid rgba(0, 0, 0, 0.176); | ||
color: var(--clo-tertiary); | ||
} | ||
|
||
[data-theme='dark'] .badge { | ||
border-color: var(--solid-border); | ||
background-color: var(--clo-secondary-15); | ||
} | ||
|
||
.icon { | ||
top: -1px; | ||
} | ||
|
||
.dot { | ||
top: 1px; | ||
} | ||
|
||
.wrapper { | ||
left: 3rem; | ||
right: 3rem; | ||
bottom: -1px; | ||
} | ||
|
||
.badgeInBottom { | ||
padding-top: 3.64px; | ||
padding-bottom: 2.64px; | ||
font-size: 0.65rem; | ||
line-height: 0.6rem; | ||
letter-spacing: 0.05rem; | ||
border-top-right-radius: 5px; | ||
border-top-left-radius: 5px; | ||
} | ||
|
||
@media only screen and (max-width: 1199.98px) { | ||
.wrapper { | ||
left: 1rem; | ||
right: 1rem; | ||
} | ||
} |
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,107 @@ | ||
import classNames from 'classnames'; | ||
import { DropdownOnHover, ExternalLink } from 'clo-ui'; | ||
import { isUndefined } from 'lodash'; | ||
import { MdInfoOutline } from 'react-icons/md'; | ||
import { RxDotFilled } from 'react-icons/rx'; | ||
|
||
import { MaintainersWanted, MaintainersWantedContact, MaintainersWantedLink } from '../../types'; | ||
import styles from './MaintainersWantedBadge.module.css'; | ||
|
||
interface Props { | ||
className?: string; | ||
maintainers_wanted: MaintainersWanted; | ||
buttonStyle?: boolean; | ||
} | ||
|
||
const MaintainersWantedBadge = (props: Props) => { | ||
const activeTooltip = | ||
(props.maintainers_wanted.contacts && props.maintainers_wanted.contacts.length > 0) || | ||
(props.maintainers_wanted.links && props.maintainers_wanted.links.length > 0); | ||
const isButton = !isUndefined(props.buttonStyle) && props.buttonStyle; | ||
|
||
const maintainersBadge = ( | ||
<> | ||
{!isButton ? ( | ||
<div | ||
className={`position-relative text-center text-uppercase fw-bold w-100 ${styles.badge} ${styles.badgeInBottom}`} | ||
> | ||
<div className="d-flex flex-row align-items-center justify-content-center"> | ||
<div>Maintainers wanted</div> | ||
<MdInfoOutline className={`ms-2 position-relative ${styles.icon}`} /> | ||
</div> | ||
</div> | ||
) : ( | ||
<div className={`d-none d-sm-flex badge rounded-0 me-2 ${styles.badge}`}> | ||
<div className="d-flex flex-row align-items-center justify-content-center"> | ||
<MdInfoOutline className="me-1" /> | ||
<div>Maintainers wanted</div> | ||
</div> | ||
</div> | ||
)} | ||
</> | ||
); | ||
|
||
return ( | ||
<div className={classNames({ [`position-absolute ${styles.wrapper}`]: !isButton })}> | ||
{activeTooltip ? ( | ||
<DropdownOnHover | ||
dropdownClassName={styles.dropdown} | ||
width={isButton ? 300 : 500} | ||
linkContent={maintainersBadge} | ||
tooltipStyle | ||
> | ||
<div className="text-start p-2"> | ||
{props.maintainers_wanted.links && props.maintainers_wanted.links.length > 0 && ( | ||
<> | ||
<div className="border-bottom border-1 pb-1 mb-2 fw-bold">Links</div> | ||
<div | ||
className={classNames('mb-1', { | ||
'mb-3': props.maintainers_wanted.contacts && props.maintainers_wanted.contacts.length > 0, | ||
})} | ||
> | ||
{props.maintainers_wanted.links.map((link: MaintainersWantedLink, index: number) => { | ||
return ( | ||
<div key={`link_${index}_${link.url}`} className="d-flex flex-row align-items-center ms-2"> | ||
<RxDotFilled className={`me-2 position-relative ${styles.dot}`} /> | ||
<ExternalLink className="text-truncate w-100" href={link.url}> | ||
{link.title || link.url} | ||
</ExternalLink> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
</> | ||
)} | ||
{props.maintainers_wanted.contacts && props.maintainers_wanted.contacts.length > 0 && ( | ||
<> | ||
<div className="border-bottom border-1 pb-1 mb-2 fw-bold">Contacts</div> | ||
<div className="mb-1"> | ||
{props.maintainers_wanted.contacts.map((contact: MaintainersWantedContact, index: number) => { | ||
return ( | ||
<div | ||
key={`contact_${index}_${contact.github_handle}`} | ||
className="d-flex flex-row align-items-center ms-2" | ||
> | ||
<RxDotFilled className={`me-2 position-relative ${styles.dot}`} /> | ||
<ExternalLink | ||
className="text-truncate w-100" | ||
href={`https://github.com/${contact.github_handle}`} | ||
> | ||
{contact.github_handle} | ||
</ExternalLink> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
</DropdownOnHover> | ||
) : ( | ||
<>{maintainersBadge}</> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default MaintainersWantedBadge; |
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