-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Homepage: Build user stats preview in dashboard (#6121)
* build avatar and profile banner into Dashboard * Build the rest of a Dashboard component * add a temporary statsPreview object to DashboardContainer * fix UserHome import * add round to top of Dashboard * add responsive styling to avatar * fetch user resource via panoptes in DashboardContainer * import UserHome into lib-user dev App * fix merge conflicts * fetch data for StatsTabs * Fix a few styling things * Add StyledStatsLink focus styling --------- Co-authored-by: Mark Bouslog <mcbouslog@gmail.com> Co-authored-by: Mark Bouslog <mark@zooniverse.org>
- Loading branch information
1 parent
b6c0a3c
commit f1e524f
Showing
7 changed files
with
445 additions
and
33 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
32 changes: 32 additions & 0 deletions
32
packages/lib-user/src/components/UserHome/components/Dashboard/components/DashboardLink.js
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,32 @@ | ||
import { node, string } from 'prop-types' | ||
import { useContext } from 'react' | ||
import { ResponsiveContext } from 'grommet' | ||
import { PlainButton } from '@zooniverse/react-components' | ||
import { Blank } from 'grommet-icons' | ||
|
||
function Icon({ icon, text = '' }) { | ||
return ( | ||
<Blank role='img' aria-label={text} aria-hidden='false' size='1rem'> | ||
{icon} | ||
</Blank> | ||
) | ||
} | ||
|
||
export default function DashboardLink({ href = '', icon, text = '' }) { | ||
const size = useContext(ResponsiveContext) | ||
return ( | ||
<> | ||
{size !== 'small' ? ( | ||
<PlainButton href={href} text={text} icon={icon} /> | ||
) : ( | ||
<Icon text={text} icon={icon} /> | ||
)} | ||
</> | ||
) | ||
} | ||
|
||
DashboardLink.propTypes = { | ||
href: string, | ||
icon: node, | ||
text: string | ||
} |
Oops, something went wrong.