|
16 | 16 |
|
17 | 17 | import {LitElement, TemplateResult, css, html, nothing} from 'lit'; |
18 | 18 | import {customElement, property, query, state} from 'lit/decorators.js'; |
| 19 | +import {openShareDialog} from './webstatus-saved-search-share-dialog.js'; |
19 | 20 | import {APIClient} from '../contexts/api-client-context.js'; |
20 | 21 | import {UserContext} from '../contexts/firebase-user-context.js'; |
21 | 22 | import { |
@@ -44,6 +45,8 @@ export class WebstatusSavedSearchControls extends LitElement { |
44 | 45 | @property({type: Object}) |
45 | 46 | apiClient!: APIClient; |
46 | 47 |
|
| 48 | + |
| 49 | + |
47 | 50 | @property({type: Object}) |
48 | 51 | userContext!: UserContext; |
49 | 52 |
|
@@ -73,6 +76,103 @@ export class WebstatusSavedSearchControls extends LitElement { |
73 | 76 | #bookmark-task-spinner { |
74 | 77 | font-size: 1rem; |
75 | 78 | } |
| 79 | + |
| 80 | + /* Modal Styles - Default (Light theme) */ |
| 81 | + sl-dialog::part(panel) { |
| 82 | + background-color: white !important; /* Solid white background */ |
| 83 | + color: black; |
| 84 | + } |
| 85 | + |
| 86 | + sl-dialog::part(body) { |
| 87 | + background-color: white !important; /* Solid white background for body */ |
| 88 | + } |
| 89 | + |
| 90 | + /* Z-Index Fix (Light Theme) */ |
| 91 | + sl-dialog { |
| 92 | + --sl-z-index-dialog: 1500 !important; /* Force high z-index */ |
| 93 | + } |
| 94 | +
|
| 95 | + /* Content specific transparency fix (Light Theme) */ |
| 96 | + .link-share-box { |
| 97 | + background-color: white !important; /* Ensure solid background */ |
| 98 | + } |
| 99 | + |
| 100 | + .link-share-box sl-input::part(base) { |
| 101 | + background-color: white !important; /* Solid background for input */ |
| 102 | + } |
| 103 | +
|
| 104 | + /* Dark theme override */ |
| 105 | + :host(.sl-theme-dark) sl-dialog::part(panel), |
| 106 | + .sl-theme-dark sl-dialog::part(panel) { |
| 107 | + background-color: #1e1e1e !important; /* Solid dark background */ |
| 108 | + color: white; |
| 109 | + } |
| 110 | + |
| 111 | + :host(.sl-theme-dark) sl-dialog::part(body), |
| 112 | + .sl-theme-dark sl-dialog::part(body) { |
| 113 | + background-color: #1e1e1e !important; /* Solid dark background for body */ |
| 114 | + } |
| 115 | + |
| 116 | + /* Z-Index Fix (Dark Theme) */ |
| 117 | + :host(.sl-theme-dark) sl-dialog, |
| 118 | + .sl-theme-dark sl-dialog { |
| 119 | + --sl-z-index-dialog: 1500 !important; /* Force high z-index in dark theme */ |
| 120 | + } |
| 121 | + |
| 122 | + /* Content specific transparency fix (Dark Theme) */ |
| 123 | + :host(.sl-theme-dark) .link-share-box, |
| 124 | + .sl-theme-dark .link-share-box { |
| 125 | + background-color: #1e1e1e !important; /* Solid dark background */ |
| 126 | + } |
| 127 | + |
| 128 | + :host(.sl-theme-dark) .link-share-box sl-input::part(base), |
| 129 | + .sl-theme-dark .link-share-box sl-input::part(base) { |
| 130 | + background-color: #121212 !important; /* Solid dark background for input */ |
| 131 | + } |
| 132 | + |
| 133 | + .qr-code-box { |
| 134 | + border: 1px solid var(--border-color); |
| 135 | + border-radius: var(--border-radius, 4px); |
| 136 | + padding: var(--content-padding-large, 24px); |
| 137 | + display: flex; |
| 138 | + flex-direction: column; |
| 139 | + align-items: center; |
| 140 | + gap: var(--content-padding-large); |
| 141 | + width: 300px; /* Larger fixed size */ |
| 142 | + height: 300px; /* Square */ |
| 143 | + margin: 0 auto; /* Center horizontally */ |
| 144 | + background-color: var(--color-background); /* Solid background */ |
| 145 | + } |
| 146 | + |
| 147 | + .link-share-box { |
| 148 | + display: flex; |
| 149 | + flex-direction: column; /* Change to column to stack title and row */ |
| 150 | + gap: var(--spacing-medium); |
| 151 | + width: 100%; |
| 152 | + margin-top: var(--content-padding-large, 24px); |
| 153 | + background-color: var(--color-background); /* Solid background */ |
| 154 | + padding: var(--content-padding); |
| 155 | + border-radius: var(--border-radius); |
| 156 | + } |
| 157 | + |
| 158 | + .input-button-row { |
| 159 | + display: flex; |
| 160 | + flex-direction: row; |
| 161 | + align-items: center; |
| 162 | + gap: var(--spacing-medium); |
| 163 | + width: 100%; |
| 164 | + } |
| 165 | + |
| 166 | + .input-button-row sl-input { |
| 167 | + flex-grow: 1; |
| 168 | + } |
| 169 | + |
| 170 | + .input-button-row sl-input::part(base) { |
| 171 | + background-color: var(--background-primary, #121212); /* Follow theme */ |
| 172 | + color: var(--text-color, #ffffff); |
| 173 | + } |
| 174 | + |
| 175 | +
|
76 | 176 | `; |
77 | 177 |
|
78 | 178 | openSavedSearch( |
@@ -207,24 +307,15 @@ export class WebstatusSavedSearchControls extends LitElement { |
207 | 307 | savedSearch: UserSavedSearch, |
208 | 308 | ): TemplateResult { |
209 | 309 | const isOwner = savedSearch.permissions?.role === BookmarkOwnerRole; |
210 | | - const shareableUrl = `${this._getOrigin()}${this._formatOverviewPageUrl(this.location, {q: `saved:${savedSearch.id}`})}`; |
211 | 310 | return html` |
212 | | - <sl-copy-button |
213 | | - value="${shareableUrl}" |
214 | | - copy-label="Copy saved search URL to clipboard" |
215 | | - success-label="Copied" |
216 | | - error-label="Whoops, your browser doesn't support this!" |
217 | | - ><sl-icon-button |
218 | | - slot="copy-icon" |
219 | | - name="share" |
220 | | - label="Copy" |
221 | | - ></sl-icon-button |
222 | | - ><sl-icon-button |
223 | | - slot="success-icon" |
224 | | - name="share-fill" |
225 | | - label="Copy Success" |
226 | | - ></sl-icon-button> |
227 | | - </sl-copy-button> |
| 311 | + <sl-icon-button |
| 312 | + name="share" |
| 313 | + label="Share" |
| 314 | + @click=${() => { |
| 315 | + const shareableUrl = `${this._getOrigin()}${this._formatOverviewPageUrl(this.location, {q: `saved:${savedSearch.id}`})}`; |
| 316 | + openShareDialog(savedSearch, shareableUrl); |
| 317 | + }} |
| 318 | + ></sl-icon-button> |
228 | 319 | ${this.renderBookmarkControl(savedSearch, isOwner)} |
229 | 320 | ${isOwner |
230 | 321 | ? html` |
@@ -252,6 +343,10 @@ export class WebstatusSavedSearchControls extends LitElement { |
252 | 343 | `; |
253 | 344 | } |
254 | 345 |
|
| 346 | + |
| 347 | + |
| 348 | + |
| 349 | + |
255 | 350 | render() { |
256 | 351 | return html` |
257 | 352 | <div slot="anchor" class="popup-anchor saved-search-controls"></div> |
|
0 commit comments