File tree Expand file tree Collapse file tree 2 files changed +7
-15
lines changed Expand file tree Collapse file tree 2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -21,18 +21,13 @@ $fg-color: #f7f7f7;
2121$fg-inverse : #3d3d3d ;
2222
2323.toast {
24- background-color : $bg-color !important ;
24+ background-color : $surface-1 !important ;
2525 color : $fg-color !important ;
2626 fill : $fg-color !important ;
2727
28- border : 1px solid $accent-color ;
2928 border-radius : 10px !important ;
3029}
3130
32- .toast-err {
33- border : 1px solid rgba (rgb (194 , 42 , 42 ), 0.7 );
34- }
35-
3631body {
3732 color : rgba ($fg-color , 0.8 );
3833 background-color : $bg-color ;
Original file line number Diff line number Diff line change 11import { toast } from 'solid-toast' ;
22
3- export async function copyLink ( e : Event , link : string ) {
3+ export function copyLink ( e : Event , link : string ) {
44 e . preventDefault ( ) ;
55
6- try {
7- await navigator . clipboard . writeText ( link ) ;
8- toast ( 'Link copied to clipboard.' ) ;
9- } catch ( e ) {
10- toast ( 'Error copying link to the clipboard.' , {
11- className : "toast toast-err"
12- } ) ;
13- }
6+ toast . promise ( navigator . clipboard . writeText ( link ) , {
7+ loading : "Copying link to clipboard..." ,
8+ success : "Link copied to clipboard." ,
9+ error : "Failed to copy link to clipboard."
10+ } )
1411}
You can’t perform that action at this time.
0 commit comments