File tree 2 files changed +42
-45
lines changed
2 files changed +42
-45
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,15 @@ export const List = defineComponent({
81
81
82
82
const { run : runLoad , isLoading, hasError } = useAsyncTask ( load ) ;
83
83
84
- onMounted ( ( ) => runLoad ( ) ) ;
84
+ onMounted ( async ( ) => {
85
+ notificationEl . value ?. showPopover ( ) ;
86
+ const [ , error ] = await runLoad ( ) ;
87
+ if ( ! error ) {
88
+ notificationEl . value ?. hidePopover ( ) ;
89
+ }
90
+ } ) ;
91
+
92
+ const notificationEl = useTemplateRef ( "notificationEl" ) ;
85
93
86
94
/* -------------------------------------------------- *
87
95
* Searching *
@@ -223,23 +231,16 @@ export const List = defineComponent({
223
231
</ div >
224
232
</ main >
225
233
226
- <!-- Status notification -->
227
- < div class ="status-layout ">
228
- < Transition name ="slide ">
229
- < div
230
- v-if ="isLoading || hasError "
231
- aria-busy ="true "
232
- class ="status "
233
- data-color-scheme ="inverted "
234
- >
235
- < small class ="status-label ">
236
- < template v-if ="!hasError "> Fetching your stuff ...</ template >
237
- < template v-else > 🚨 Couldn’t fetch your stars!</ template >
238
- </ small >
239
- </ div >
240
- </ Transition >
241
- </ div >
242
- </ div> ` ,
234
+ < div
235
+ :aria-busy ="isLoading "
236
+ class ="notification "
237
+ data-color-scheme ="inverted "
238
+ popover ="manual "
239
+ ref ="notificationEl "
240
+ >
241
+ < template v-if ="!hasError "> Fetching your stuff ...</ template >
242
+ < template v-else > 🚨 Couldn’t fetch your stars!</ template >
243
+ </ div > ` ,
243
244
} ) ;
244
245
245
246
/* -------------------------------------------------- *
Original file line number Diff line number Diff line change @@ -160,37 +160,33 @@ layer(theme);
160
160
* Fetch status *
161
161
* -------------------------------------------------- */
162
162
163
- .status-layout {
164
- bottom : var (--body-padding-y );
165
- display : flex;
166
- justify-content : center;
167
- left : 0 ;
168
- pointer-events : none;
169
- position : fixed;
170
- right : 0 ;
171
- }
172
-
173
- .status {
163
+ .notification {
174
164
background : var (--c-surface-bg );
175
165
border-radius : 9999px ;
176
- color : var (--primary );
177
- padding : 0.75rem 1.125rem ;
178
- pointer-events : auto;
179
- }
180
-
181
- .status-label {
166
+ border : none;
182
167
color : var (--c-surface-fg );
168
+ font-size : var (--font-size-small );
183
169
font-weight : var (--font-weight-medium );
184
- }
170
+ inset-block : auto var (--body-padding-y );
171
+ opacity : 0 ;
172
+ padding : 0.75rem 1.125rem ;
173
+ position : fixed;
174
+ transition : all var (--transition ) allow-discrete;
175
+ translate : 0 1rem ;
185
176
186
- .slide-enter-active ,
187
- .slide-leave-active {
188
- transition : 0.1s ease;
189
- transition-property : transform, opacity;
190
- }
177
+ & : popover-open {
178
+ opacity : 1 ;
179
+ translate : 0 0 ;
180
+ }
191
181
192
- .slide-enter-from ,
193
- .slide-leave-to {
194
- transform : scale (0.8 );
195
- opacity : 0 ;
182
+ @starting-style {
183
+ & : popover-open {
184
+ opacity : 0 ;
185
+ translate : 0 1rem ;
186
+ }
187
+ }
188
+
189
+ & [aria-busy ]::before {
190
+ color : var (--primary );
191
+ }
196
192
}
You can’t perform that action at this time.
0 commit comments