-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[www] A bunch of mostly "Creator"-related UI updates (#8390)
* Use thumbnail component for creators index view cards * let creators index grid fill the whole viewport width, adopting what we do for site and starter showcase, switching from fixed to fluid gatsby-image * link index view card GitHub icon * DRY: add `shared/empty-grid-items` * No search for now * Add key * One <Button> to rule them all Refactor (and rename Cta)Button component so that we can re-use it in other places. Aaaaamazing! - expand Button component to render as either gatsby-link (default), `href` or `button` (`<Button tag=„href“ />`) - add `<Button small />` - use `<Button>` to render - „Submit“ links in Site, Starter, and Creators Showcase - „Load More“ links Site and Starter Showcase - use the shared button styles to style the Hubspot newsletter form button * Bonus round: Consolidate a couple showcase sidebar filter styles
- Loading branch information
1 parent
3af1570
commit 663d25e
Showing
20 changed files
with
314 additions
and
434 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from "react" | ||
import { Link } from "gatsby" | ||
import { buttonStyles } from "../utils/styles" | ||
|
||
const components = { | ||
link: Link, | ||
href: ({ children, ...rest }) => <a {...rest}>{children}</a>, | ||
button: ({ children, ...rest }) => <button {...rest}>{children}</button>, | ||
} | ||
|
||
const Button = ({ | ||
to, | ||
overrideCSS, | ||
icon, | ||
children, | ||
tag, | ||
large, | ||
small, | ||
secondary, | ||
...rest | ||
}) => { | ||
const Tag = components[tag || `link`] | ||
|
||
const props = { | ||
to: !tag ? to : undefined, | ||
href: tag === `href` ? to : undefined, | ||
css: { | ||
"&&": { | ||
...buttonStyles.default, | ||
...overrideCSS, | ||
...(secondary && { ...buttonStyles.secondary }), | ||
...(large && { ...buttonStyles.large }), | ||
...(small && { ...buttonStyles.small }), | ||
}, | ||
}, | ||
...rest, | ||
} | ||
|
||
return ( | ||
<Tag {...props}> | ||
{children} | ||
{icon && <>{icon}</>} | ||
</Tag> | ||
) | ||
} | ||
|
||
export default Button |
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 was deleted.
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.