@@ -15,6 +15,7 @@ import {
1515 IconButton ,
1616 Progress ,
1717 ScrollArea ,
18+ Skeleton ,
1819 Text ,
1920} from "@radix-ui/themes" ;
2021import { useMutation , useQuery } from "@tanstack/react-query" ;
@@ -31,6 +32,20 @@ function formatSize(bytes: number | null): string {
3132 return `${ Math . round ( mb ) } MB` ;
3233}
3334
35+ function ReleaseNotesSkeleton ( ) {
36+ return (
37+ < Flex direction = "column" gap = "3" >
38+ { [ "improved" , "fixed" ] . map ( ( key ) => (
39+ < Flex key = { key } direction = "column" gap = "2" >
40+ < Skeleton width = "56px" height = "12px" />
41+ < Skeleton width = "90%" height = "14px" />
42+ < Skeleton width = "80%" height = "14px" />
43+ </ Flex >
44+ ) ) }
45+ </ Flex >
46+ ) ;
47+ }
48+
3449export function UpdateAvailableModal ( ) {
3550 const isOpen = useUpdateModalStore ( ( state ) => state . isOpen ) ;
3651 const close = useUpdateModalStore ( ( state ) => state . close ) ;
@@ -48,7 +63,7 @@ export function UpdateAvailableModal() {
4863 const downloadMutation = useMutation (
4964 hostTRPC . updates . download . mutationOptions ( ) ,
5065 ) ;
51- const { data : releasesData } = useQuery ( {
66+ const { data : releasesData , isLoading : isLoadingReleases } = useQuery ( {
5267 ...hostTRPC . githubReleases . list . queryOptions ( ) ,
5368 enabled : isOpen ,
5469 } ) ;
@@ -100,7 +115,7 @@ export function UpdateAvailableModal() {
100115 </ Dialog . Close >
101116 </ Flex >
102117
103- { hasParsedNotes || rawNotes ? (
118+ { hasParsedNotes || rawNotes || isLoadingReleases ? (
104119 < Flex direction = "column" gap = "2" >
105120 < Text
106121 size = "1"
@@ -110,19 +125,23 @@ export function UpdateAvailableModal() {
110125 >
111126 Release notes
112127 </ Text >
113- < ScrollArea
114- type = "auto"
115- scrollbars = "vertical"
116- style = { { maxHeight : 240 } }
117- >
118- < div className = "pr-3" >
119- { hasParsedNotes && parsedNotes ? (
120- < ReleaseNotesSections notes = { parsedNotes } />
121- ) : rawNotes ? (
122- < MarkdownRenderer content = { rawNotes } />
123- ) : null }
124- </ div >
125- </ ScrollArea >
128+ { hasParsedNotes || rawNotes ? (
129+ < ScrollArea
130+ type = "auto"
131+ scrollbars = "vertical"
132+ style = { { maxHeight : 240 } }
133+ >
134+ < div className = "pr-3" >
135+ { hasParsedNotes && parsedNotes ? (
136+ < ReleaseNotesSections notes = { parsedNotes } />
137+ ) : rawNotes ? (
138+ < MarkdownRenderer content = { rawNotes } />
139+ ) : null }
140+ </ div >
141+ </ ScrollArea >
142+ ) : (
143+ < ReleaseNotesSkeleton />
144+ ) }
126145 </ Flex >
127146 ) : null }
128147
@@ -141,6 +160,9 @@ export function UpdateAvailableModal() {
141160 ) : null }
142161
143162 < Flex justify = "end" align = "center" gap = "2" mt = "1" >
163+ < Button variant = "soft" color = "gray" size = "2" onClick = { close } >
164+ Later
165+ </ Button >
144166 { isReady ? (
145167 < Button size = "2" onClick = { ( ) => void installUpdate ( ) } >
146168 Restart to update
0 commit comments