Skip to content

Commit

Permalink
Merge pull request #307 from radixdlt/tweak/margins-and-dapp-names
Browse files Browse the repository at this point in the history
tweak: Margins and dapp names
  • Loading branch information
dawidsowardx authored Jan 14, 2025
2 parents 1fd9202 + fa9bdac commit 0a984d0
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ export class RadixRequestCard extends LitElement {
:host {
display: flex;
width: 100%;
margin-bottom: 10px;
}
.text-dimmed {
Expand Down
14 changes: 12 additions & 2 deletions packages/connect-button/src/components/card/request-cards.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html, LitElement } from 'lit'
import { css, html, LitElement } from 'lit'
import { customElement, property } from 'lit/decorators.js'
import { themeCSS } from '../../theme'
import '../card/request-card'
Expand All @@ -16,13 +16,23 @@ export class RadixRequestCards extends LitElement {
type="${requestItem.type}"
status="${requestItem.status}"
id="${requestItem.interactionId}"
hash="${requestItem.transactionIntentHash || ''}"
?showCancel="${requestItem.showCancel}"
timestamp=${requestItem.createdAt}
></radix-request-card>`,
)
}

static styles = [themeCSS]
static styles = [
themeCSS,
css`
:host {
display: flex;
flex-direction: column;
gap: 10px;
}
`,
]
}

declare global {
Expand Down
27 changes: 3 additions & 24 deletions packages/connect-button/src/components/pages/requests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { css, html, LitElement } from 'lit'
import { customElement, property } from 'lit/decorators.js'
import '../card/request-card'
import '../card/request-cards'
import { RequestItem } from 'radix-connect-common'
import { pageStyles } from './styles'
import { formatTimestamp } from '../../helpers/format-timestamp'
Expand All @@ -22,25 +22,15 @@ export class RadixRequestsPage extends LitElement {

render() {
return html`
<div class="header">Connected to ${this.dAppName}</div>
<div class="header">Connected to ${this.dAppName || "dApp"}</div>
<slot name="subheader"></slot>
${this.loggedInTimestamp
? html`<div class="subheader">
Since logged in: ${formatTimestamp(this.loggedInTimestamp, ', ')}
</div>`
: ''}
<div class="content">
${(this.requestItems || []).map(
(requestItem) =>
html`<radix-request-card
type="${requestItem.type}"
status="${requestItem.status}"
id="${requestItem.interactionId}"
hash="${requestItem.transactionIntentHash || ''}"
?showCancel="${requestItem.showCancel}"
timestamp=${requestItem.createdAt}
></radix-request-card>`,
)}
<radix-request-cards .requestItems=${this.requestItems}></radix-request-cards>
</div>
`
}
Expand All @@ -55,17 +45,6 @@ export class RadixRequestsPage extends LitElement {
text-align: center;
font-size: 12px;
}
.content {
padding-bottom: 25px;
max-height: calc(100vh - 270px);
}
@media (min-height: 580px) {
.content {
max-height: 360px;
}
}
`,
]
}
Expand Down
9 changes: 2 additions & 7 deletions packages/connect-button/src/components/pages/sharing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class RadixSharingPage extends LitElement {
}

render() {
return html` <div class="header">Sharing with ${this.dAppName}</div>
return html` <div class="header">Sharing with ${this.dAppName || "dApp"}</div>
<div class="content">
<radix-persona-card
avatarUrl=${this.avatarUrl}
Expand Down Expand Up @@ -121,19 +121,14 @@ export class RadixSharingPage extends LitElement {
.icon.disabled::before {
background: var(--radix-button-disabled-text-color);
}
.content {
max-height: 193px;
overflow-x: hidden;
padding-bottom: 19px;
}
.buttons {
display: grid;
bottom: 0;
width: 100%;
grid-template-columns: 1fr 115px;
grid-gap: 10px;
width: 100%;
padding-top: 5px;
padding-top: 10px;
align-items: end;
}
Expand Down
14 changes: 11 additions & 3 deletions packages/connect-button/src/components/pages/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@ export const pageStyles = css`
}
.content {
overflow: auto;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
margin-bottom: 0;
position: relative;
-webkit-mask-image: linear-gradient(180deg, black 90%, transparent 100%);
mask-image: linear-gradient(180deg, black 90%, transparent 95%);
min-height: 100px;
/* Ensure we can't see the mask when fully scrolled to the bottom */
padding-bottom: 10px;
mask-image: linear-gradient(0deg, transparent 0px, black 10px);
/* Given .content has overflow: scroll, I feel we shouldn't need
* a max-height to constrain the content, but it just doesn't work
* So we set it manually to be correct. */
max-height: min(calc(100vh - 270px), 360px);
}
`

0 comments on commit 0a984d0

Please sign in to comment.