This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Coinbase button into its own component (#1741)
* Break custom coinbase button into its own component * Index file * Use new import
- Loading branch information
1 parent
6c204c6
commit a88f8c0
Showing
5 changed files
with
79 additions
and
49 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
packages/web/src/components/coinbase-pay-button/CoinbasePayButtonCustom.module.css
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,40 @@ | ||
.coinbaseButton:not(:disabled) { | ||
background: transparent !important; | ||
border: 1px solid #0052ff; | ||
} | ||
.coinbaseButton .coinbaseLogo { | ||
vertical-align: baseline; | ||
margin-left: 4px; | ||
} | ||
.coinbaseButton .textClassName { | ||
color: #0052ff; | ||
font-size: var(--font-2xl); | ||
font-weight: var(--font-demi-bold); | ||
text-transform: none; | ||
} | ||
.coinbaseLogo path { | ||
transition: all var(--quick); | ||
} | ||
|
||
/** Hover **/ | ||
.coinbaseButton:hover:not(:disabled) { | ||
background: #0052ff !important; | ||
transform: none; | ||
} | ||
.coinbaseButton:hover:not(:disabled) .textClassName { | ||
color: var(--static-white); | ||
} | ||
.coinbaseButton:hover:not(:disabled) .coinbaseLogo path { | ||
fill: var(--static-white); | ||
} | ||
|
||
/** Disabled **/ | ||
.coinbaseButton:disabled { | ||
background: var(--neutral-light-6); | ||
} | ||
.coinbaseButton:disabled .textClassName { | ||
color: var(--static-white); | ||
} | ||
.coinbaseButton:disabled .coinbaseLogo path { | ||
fill: var(--static-white); | ||
} |
33 changes: 33 additions & 0 deletions
33
packages/web/src/components/coinbase-pay-button/CoinbasePayButtonCustom.tsx
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 { Button, ButtonProps, ButtonType } from '@audius/stems' | ||
|
||
import { ReactComponent as CoinbaseLogo } from 'assets/img/coinbase-pay/LogoCoinbase.svg' | ||
|
||
import styles from './CoinbasePayButtonCustom.module.css' | ||
|
||
const messages = { | ||
buyWith: 'Buy with', | ||
buyWithCoinbase: 'Buy with Coinbase' | ||
} | ||
|
||
export const CoinbasePayButtonCustom = (props: Partial<ButtonProps>) => { | ||
return ( | ||
<Button | ||
aria-label={messages.buyWithCoinbase} | ||
text={ | ||
<> | ||
<span>{messages.buyWith}</span> | ||
<CoinbaseLogo | ||
className={styles.coinbaseLogo} | ||
width={97} | ||
height={18} | ||
/> | ||
</> | ||
} | ||
type={ButtonType.GLASS} | ||
includeHoverAnimations | ||
className={styles.coinbaseButton} | ||
textClassName={styles.textClassName} | ||
{...props} | ||
/> | ||
) | ||
} |
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,3 @@ | ||
export { CoinbasePayButtonCustom } from './CoinbasePayButtonCustom' | ||
export { CoinbasePayButton } from './CoinbasePayButton' | ||
export { CoinbasePayButtonProvider } from './CoinbasePayButtonProvider' |
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