File tree 2 files changed +28
-6
lines changed
apps/repl/app/components/limber
2 files changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -68,10 +68,21 @@ button[data-share-button] {
68
68
}
69
69
}
70
70
dialog .preem {
71
- border-radius : 0.25rem ;
71
+ width : 100dvw ;
72
+ background : transparent;
73
+ display : flex;
74
+ justify-content : center;
75
+ overflow : hidden;
76
+
72
77
animation : var (--animation-slide-in-up ), var (--animation-fade-in );
73
78
animation-timing-function : var (--ease-out-5 );
74
79
animation-duration : 0.2s ;
80
+
81
+ > .modal-facade {
82
+ background : white;
83
+ border-radius : 0.25rem ;
84
+ width : max-content;
85
+ }
75
86
}
76
87
dialog .preem ::backdrop {
77
88
backdrop-filter : blur (1px );
Original file line number Diff line number Diff line change @@ -33,17 +33,19 @@ export const Share = <template>
33
33
</button >
34
34
35
35
<m.Dialog class =" preem" {{focusTrap isActive =m.isOpen }} >
36
+ <SaveBanner @ isShowing ={{isShowing.current }} />
37
+
36
38
{{#if m.isOpen }}
37
- <ShareModal @ onCancel ={{m.close }} />
39
+ <div class =" modal-facade" >
40
+ <ShareModal @ onCancel ={{m.close }} />
41
+ </div >
38
42
{{/if }}
39
43
</m.Dialog >
40
44
</Modal >
41
45
</template >;
42
46
43
47
class ShareModal extends Component <{ onCancel: () => void }> {
44
48
<template >
45
- <SaveBanner @ isShowing ={{isShowing.current }} />
46
-
47
49
<header ><h2 >Share</h2 >
48
50
<FlatButton {{on " click" @ onCancel}} aria-label =" close this share modal" >
49
51
<FaIcon @ size =" xs" @ icon ={{faXmark }} class =" aspect-square" />
@@ -127,8 +129,17 @@ class ShareModal extends Component<{ onCancel: () => void }> {
127
129
128
130
try {
129
131
await this .toClipboard ();
130
- } catch {
131
- // TODO: Toast message
132
+ } catch (e ) {
133
+ if (typeof e === ' object' && e !== null ) {
134
+ if (' message' in e && typeof e .message === ' string' ) {
135
+ this .error = e .message ;
136
+
137
+ return ;
138
+ }
139
+ }
140
+
141
+ console .error (e );
142
+ this .error = ` An unknown error occurred. Details in the console. If you have time, a bug report would be appreciated <3 ` ;
132
143
}
133
144
};
134
145
}
You can’t perform that action at this time.
0 commit comments