Browse Source

Merge pull request #967 from mrfelton/fix/tooltips

fix(ui): improve tooltip styles
renovate/prettier-1.x
JimmyMow 6 years ago
committed by GitHub
parent
commit
6a47228cae
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      app/components/Activity/Activity.scss
  2. 20
      app/components/Activity/Invoice/Invoice.js
  3. 9
      app/components/Activity/Payment/Payment.js
  4. 9
      app/components/Activity/Transaction/Transaction.js
  5. 23
      app/components/UI/GlobalStyle.js

9
app/components/Activity/Activity.scss

@ -162,7 +162,6 @@
cursor: pointer; cursor: pointer;
height: 76px; height: 76px;
align-items: center; align-items: center;
font-size: 14px;
transition: background-color 0.1s linear; transition: background-color 0.1s linear;
transition-delay: 0.1s; transition-delay: 0.1s;
color: var(--primaryText); color: var(--primaryText);
@ -224,14 +223,10 @@
flex-direction: column; flex-direction: column;
flex: 6; flex: 6;
justify-content: space-evenly; justify-content: space-evenly;
width: 75%;
&:nth-child(2) {
font-size: 10px;
}
.title { .title {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 14px;
} }
.subtitle { .subtitle {
@ -268,7 +263,6 @@
h3 { h3 {
display: inline-block; display: inline-block;
font-size: 14px;
font-weight: 300; font-weight: 300;
letter-spacing: 1.2px; letter-spacing: 1.2px;
@ -286,6 +280,7 @@
text-align: right; text-align: right;
font-size: 12px; font-size: 12px;
color: var(--primaryText); color: var(--primaryText);
width: 25%;
span { span {
&:nth-child(1) { &:nth-child(1) {

20
app/components/Activity/Invoice/Invoice.js

@ -15,19 +15,17 @@ const Invoice = ({ invoice, ticker, currentTicker, showActivityModal, currencyNa
onClick={() => showActivityModal('INVOICE', invoice.payment_request)} onClick={() => showActivityModal('INVOICE', invoice.payment_request)}
> >
<div className={styles.activityTypeIcon}> <div className={styles.activityTypeIcon}>
<section <CheckCircle />
className="hint--bottom"
data-hint={
invoice.settled
? intl.formatMessage({ ...messages.type_paid })
: intl.formatMessage({ ...messages.type_unpaid })
}
>
<CheckCircle />
</section>
</div> </div>
<div className={styles.data}> <div
className={`hint--top-right ${styles.data}`}
data-hint={
invoice.settled
? intl.formatMessage({ ...messages.type_paid })
: intl.formatMessage({ ...messages.type_unpaid })
}
>
<div className={styles.title}> <div className={styles.title}>
<h3> <h3>
{invoice.settled ? ( {invoice.settled ? (

9
app/components/Activity/Payment/Payment.js

@ -35,12 +35,13 @@ const Payment = ({
onClick={() => showActivityModal('PAYMENT', payment.payment_hash)} onClick={() => showActivityModal('PAYMENT', payment.payment_hash)}
> >
<div className={styles.activityTypeIcon}> <div className={styles.activityTypeIcon}>
<section className="hint--bottom" data-hint={intl.formatMessage({ ...messages.type })}> <Zap />
<Zap />
</section>
</div> </div>
<div className={styles.data}> <div
className={`hint--top-right ${styles.data}`}
data-hint={intl.formatMessage({ ...messages.type })}
>
<div className={styles.title}> <div className={styles.title}>
<h3>{displayNodeName(payment.path[payment.path.length - 1])}</h3> <h3>{displayNodeName(payment.path[payment.path.length - 1])}</h3>
</div> </div>

9
app/components/Activity/Transaction/Transaction.js

@ -23,12 +23,13 @@ const Transaction = ({
onClick={() => showActivityModal('TRANSACTION', transaction.tx_hash)} onClick={() => showActivityModal('TRANSACTION', transaction.tx_hash)}
> >
<div className={styles.activityTypeIcon}> <div className={styles.activityTypeIcon}>
<section className="hint--bottom" data-hint={intl.formatMessage({ ...messages.type })}> <ChainLink />
<ChainLink />
</section>
</div> </div>
<div className={styles.data}> <div
className={`hint--top-right ${styles.data}`}
data-hint={intl.formatMessage({ ...messages.type })}
>
<div className={styles.title}> <div className={styles.title}>
<h3> <h3>
{transaction.received ? ( {transaction.received ? (

23
app/components/UI/GlobalStyle.js

@ -100,12 +100,14 @@ const GlobalStyle = createGlobalStyle`
} }
.hint--bottom::before, .hint--bottom::before,
.hint--bottom-left::before { .hint--bottom-left::before,
.hint--bottom-right::before {
border-bottom-color: #404040; border-bottom-color: #404040;
} }
.hint--top::before, .hint--top::before,
.hint--top-left::before { .hint--top-left::before,
.hint--top-right::before {
border-top-color: #404040; border-top-color: #404040;
} }
@ -147,7 +149,8 @@ const GlobalStyle = createGlobalStyle`
transform: translateY(-8px); transform: translateY(-8px);
} }
.hint--top-left::before { .hint--top-left::before,
.hint--top-right::before {
margin-bottom: -12px; margin-bottom: -12px;
} }
@ -155,14 +158,26 @@ const GlobalStyle = createGlobalStyle`
margin-right: -6px; margin-right: -6px;
} }
.hint--top-right::after {
margin-right: 6px;
}
.hint--top-left::before, .hint--top-left::before,
.hint--top-left::after { .hint--top-left::after {
bottom: 100%; bottom: 100%;
right: 12px; right: 12px;
} }
.hint--top-right::before,
.hint--top-right::after {
bottom: 100%;
left: 12px;
}
.hint--top-left:hover::after, .hint--top-left:hover::after,
.hint--top-left:hover::before { .hint--top-left:hover::before,
.hint--top-right:hover::after,
.hint--top-right:hover::before {
transform: translateY(-8px); transform: translateY(-8px);
} }

Loading…
Cancel
Save