@@ -8,66 +8,71 @@ const LNURL: &str = "LNURL1DP68GURN8GHJ7EM9W3SKCCNE9E3K7MF0D3H82UNVWQHHVCT6WU7PK
8
8
pub fn QrCodeCmp ( ) -> impl IntoView {
9
9
if leptos:: leptos_dom:: is_browser ( ) {
10
10
let svgs = view ! { <div></div> } ;
11
- let result: String = qrcode_generator:: to_svg_to_string ( LNURL , QrCodeEcc :: Medium , 256 , None :: < & str > ) . unwrap ( ) ;
11
+ let result: String =
12
+ qrcode_generator:: to_svg_to_string ( LNURL , QrCodeEcc :: Medium , 256 , None :: < & str > )
13
+ . expect ( "QR Loaded" ) ;
12
14
svgs. set_inner_html ( & result) ;
13
15
svgs
14
16
} else {
15
17
view ! { <div></div> }
16
18
}
17
-
18
19
}
19
20
20
21
#[ component]
21
22
pub fn Donate ( ) -> impl IntoView {
22
23
view ! {
23
- <div class="flex flex-col mt-8 w-9/12 bg-white border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700 text-center items-center justify-items-center p-5 place-content-center content-center" >
24
- <label class="text-xs sm:text-xs md:text-sm text-black dark:text-white" >
25
- "บริการนี้ฟรี หากท่านต้องการสนับสนุนค่ากาแฟ และโดเมน."
26
- <br/>
27
- "สามารถใช้ Bitcoin lightning ⚡ เพื่อสนับสนุนเสรีภาพของสังคมพวกเราต่อไป."
28
- <br/> "This service is free, but operating it costs a bit of money and time." <br/>
29
- "If you like it, please consider a small lightning ⚡ donation to keep it alive."
30
- <br/> "Zap me:⚡vaz@siamstr.com"
31
- </label>
32
- <div class="rounded-lg justify-center items-center border-2 text-white text-xl font-bold p-2 m-2 w-fit self-center" >
33
- <QrCodeCmp />
34
- </div>
35
- <label class="block my-1 text-sm font-medium text-gray-900 dark:text-white" >
36
- - หรือ -
37
- </label>
38
- <div class="flex flex-col sm:flex-col md:flex-row lg:flex-row xl:flex-row 2xl:flex-row w-full lg:w-3/4 sm:w-full md:w-full 2xl:w-1/2 xl:w-1/2 text-center items-center justify-items-center p-5 place-content-center content-center" >
39
- <div class="w-9/12 flex flex-row" >
40
- <input
41
- type ="text"
42
- class="text-xs sm:text-xs md:text-sm bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 text-center"
43
- prop: value=LNURL
44
- />
45
- <button
46
- class="btn btn-accent w-fit text-xs sm:text-xs md:text-sm text-black dark:text-white"
47
- on: click=move |_| {
48
- if let Some ( clipboard) = window( ) . navigator( ) . clipboard( ) {
49
- let _ = clipboard. write_text( LNURL ) ;
50
- } else {
51
- window( ) . alert_with_message( "Something went wrong :(" ) . unwrap( ) ;
52
- }
53
- }
54
- >
24
+ <div class="flex flex-col mt-8 w-9/12 bg-white border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700 text-center items-center justify-items-center p-5 place-content-center content-center" >
25
+ <label class="text-xs sm:text-xs md:text-sm text-black dark:text-white" >
26
+ "บริการนี้ฟรี หากท่านต้องการสนับสนุนค่ากาแฟ และโดเมน."
27
+ <br/>
28
+ "สามารถใช้ Bitcoin lightning ⚡ เพื่อสนับสนุนเสรีภาพของสังคมพวกเราต่อไป."
29
+ <br/>
30
+ "This service is free, but operating it costs a bit of money and time."
31
+ <br/>
32
+ "If you like it, please consider a small lightning ⚡ donation to keep it alive."
33
+ <br/> "Zap me:⚡vaz@siamstr.com"
34
+ </label>
35
+ <div class="rounded-lg justify-center items-center border-2 text-white text-xl font-bold p-2 m-2 w-fit self-center" >
36
+ <QrCodeCmp />
37
+ </div>
38
+ <label class="block my-1 text-sm font-medium text-gray-900 dark:text-white" >
39
+ - หรือ -
40
+ </label>
41
+ <div class="flex flex-col sm:flex-col md:flex-row lg:flex-row xl:flex-row 2xl:flex-row w-full lg:w-3/4 sm:w-full md:w-full 2xl:w-1/2 xl:w-1/2 text-center items-center justify-items-center p-5 place-content-center content-center" >
42
+ <div class="w-9/12 flex flex-row" >
43
+ <input
44
+ type ="text"
45
+ class="text-xs sm:text-xs md:text-sm bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 text-center"
46
+ prop: value={ LNURL }
47
+ />
48
+ <button
49
+ class="btn btn-accent w-fit text-xs sm:text-xs md:text-sm text-black dark:text-white"
50
+ on: click={ move |_| {
51
+ if let Some ( clipboard) = window( ) . navigator( ) . clipboard( ) {
52
+ let _ = clipboard. write_text( LNURL ) ;
53
+ } else {
54
+ window( )
55
+ . alert_with_message( "Something went wrong :(" )
56
+ . unwrap( ) ;
57
+ }
58
+ } }
59
+ >
55
60
56
- "📋"
57
- </button>
58
- </div>
59
- <div>
60
- <button
61
- class="btn btn-accent w-full text-xs sm:text-xs md:text-sm text-black dark:text-white"
62
- data-npub="npub1tr66yvqghfdgwv9yxhmg7xx6pvgvu5uvdc42tgdhsys8vvzdt8msev06fl"
63
- data-relays="wss://relay.damus.io,wss://relay.siamstr.com,wss://relay.notoshi.win,wss://relay.nostr.band"
64
- >
65
- "Zapเลย⚡️"
66
- </button>
67
- <script src="https://cdn.jsdelivr.net/npm/nostr-zap@0.22.0" ></script>
68
- </div>
69
- </div>
70
- </div>
71
- }
72
- }
61
+ "📋"
62
+ </button>
63
+ </div>
64
+ <div>
65
+ <button
66
+ class="btn btn-accent w-full text-xs sm:text-xs md:text-sm text-black dark:text-white"
67
+ data-npub="npub1tr66yvqghfdgwv9yxhmg7xx6pvgvu5uvdc42tgdhsys8vvzdt8msev06fl"
68
+ data-relays="wss://relay.damus.io,wss://relay.siamstr.com,wss://relay.notoshi.win,wss://relay.nostr.band"
69
+ >
70
+ "Zapเลย⚡️"
71
+ </button>
72
+ <script src="https://cdn.jsdelivr.net/npm/nostr-zap@0.22.0" ></script>
73
+ </div>
73
74
75
+ </div>
76
+ </div>
77
+ }
78
+ }
0 commit comments