-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6562 from hotosm/style/6513-redesign-leaderboard-…
…stats-banner Redesign Leaderboard Stats Banner
- Loading branch information
Showing
10 changed files
with
251 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { useState } from 'react'; | ||
|
||
import { Button } from '../button'; | ||
import { ChevronDownIcon } from '../svgIcons/chevron-down'; | ||
import { ChevronUpIcon } from '../svgIcons/chevron-up'; | ||
|
||
export const CustomDropdown = ({ title, data, buttonClassname }) => { | ||
const [isActive, setIsActive] = useState(false); | ||
|
||
return ( | ||
<div className="relative"> | ||
{/* dropdown select */} | ||
<Button | ||
className={`white br1 f5 fw5 bn flex items-center ${buttonClassname}`} | ||
onClick={() => setIsActive(!isActive)} | ||
onBlur={() => setIsActive(false)} | ||
> | ||
{title} | ||
{isActive ? ( | ||
<ChevronUpIcon className="ml2 partners-dropdown-icon" /> | ||
) : ( | ||
<ChevronDownIcon className="ml2 partners-dropdown-icon" /> | ||
)} | ||
</Button> | ||
|
||
{/* dropdown list */} | ||
{isActive && ( | ||
<ul className="absolute list bg-grey-dark white pv3 mt2 partners-custom-dropdown"> | ||
{data.map((option) => ( | ||
<li | ||
key={option.label} | ||
className="pointer partners-dropdown-list-item" | ||
onMouseDown={() => { | ||
option?.onClick(option); | ||
}} | ||
onKeyDown={() => {}} | ||
> | ||
{option.label} | ||
</li> | ||
))} | ||
</ul> | ||
)} | ||
</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,33 @@ | ||
import { FormattedMessage } from 'react-intl'; | ||
import messages from '../../views/messages'; | ||
|
||
import { StatsSection } from './partnersStats'; | ||
import { Activity } from './partnersActivity'; | ||
import { CurrentProjects } from './currentProjects'; | ||
|
||
export const Leaderboard = ({ partner, partnerStats }) => { | ||
return ( | ||
<div className="pa4 bg-tan flex flex-column gap-1.25"> | ||
<div className="flex justify-between items-center"> | ||
<h3 className="f2 blue-dark fw7 ma0 barlow-condensed v-mid dib"> | ||
{partner.primary_hashtag | ||
?.split(',') | ||
?.map((str) => `#${str}`) | ||
?.join(', ')} | ||
</h3> | ||
</div> | ||
|
||
<StatsSection partner={partnerStats} /> | ||
|
||
<CurrentProjects currentProjects={partner.current_projects} /> | ||
|
||
{/* activity section */} | ||
<div className="w-100 fl cf"> | ||
<h3 className="f2 fw6 ttu barlow-condensed blue-dark mt0 pt2 mb3"> | ||
<FormattedMessage {...messages.activity} /> | ||
</h3> | ||
<Activity partner={partner} /> | ||
</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
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.