use LbcMessage on snackbars
This commit is contained in:
parent
672a79cc09
commit
2c1d97f759
3 changed files with 11 additions and 3 deletions
|
@ -10,7 +10,7 @@ type Props = {
|
||||||
export default function LbcMessage(props: Props) {
|
export default function LbcMessage(props: Props) {
|
||||||
let amount;
|
let amount;
|
||||||
const tokenizedMessage = props.children.replace(
|
const tokenizedMessage = props.children.replace(
|
||||||
/(\d?\.?-?\d?\.?-?\d+?)\s(LBC)/g,
|
/(\d?\.?-?\d?\.?-?\d+?)\s(LBC|LBRY Credits?)/g,
|
||||||
(originalString, lbcAmount, thirdArg) => {
|
(originalString, lbcAmount, thirdArg) => {
|
||||||
amount = lbcAmount;
|
amount = lbcAmount;
|
||||||
return `%lbc%`;
|
return `%lbc%`;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import React from 'react';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import Icon from 'component/common/icon';
|
import Icon from 'component/common/icon';
|
||||||
|
import LbcMessage from 'component/common/lbc-message';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
removeSnack: any => void,
|
removeSnack: any => void,
|
||||||
|
@ -52,7 +53,9 @@ class SnackBar extends React.PureComponent<Props> {
|
||||||
<div className="snack-bar__message">
|
<div className="snack-bar__message">
|
||||||
<Icon icon={isError ? ICONS.ALERT : ICONS.COMPLETED} size={18} />
|
<Icon icon={isError ? ICONS.ALERT : ICONS.COMPLETED} size={18} />
|
||||||
|
|
||||||
<div>{message}</div>
|
<div>
|
||||||
|
<LbcMessage>{message}</LbcMessage>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{linkText && linkTarget && (
|
{linkText && linkTarget && (
|
||||||
// This is a little weird because of `linkTarget` code in `lbry-redux`
|
// This is a little weird because of `linkTarget` code in `lbry-redux`
|
||||||
|
|
|
@ -52,7 +52,12 @@
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
font-size: var(--font-body);
|
font-size: var(--font-body);
|
||||||
|
|
||||||
.icon {
|
.credit-amount {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon--CheckCircle,
|
||||||
|
.icon--AlertCircle {
|
||||||
margin-right: var(--spacing-m);
|
margin-right: var(--spacing-m);
|
||||||
min-width: 1rem;
|
min-width: 1rem;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue