1+ import { Button } from "../../components/ui/Button" ;
12import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator" ;
23import * as Dialog from "../../components/ui/Dialog" ;
34import previewStreamScript from "@t3tools/mobile-preview-stream" ;
@@ -142,13 +143,9 @@ export function PreviewStreamWebView(
142143 { error || "Connecting to browser..." }
143144 </ AppText >
144145 { error && (
145- < Pressable
146- accessibilityRole = "button"
147- className = "rounded-full border border-secondary-border bg-secondary px-6 py-3"
148- onPress = { refresh }
149- >
150- < AppText className = "text-secondary-foreground" > Retry</ AppText >
151- </ Pressable >
146+ < View className = "items-center" >
147+ < Button label = "Retry" tone = "secondary" onPress = { refresh } />
148+ </ View >
152149 ) }
153150 </ >
154151 ) }
@@ -335,19 +332,14 @@ function PreviewStreamDocumentView({
335332 { previewStreamControlLabel ( control ) }
336333 </ AppText >
337334 { control ?. canOperate ? (
338- < Pressable
339- accessibilityRole = "button"
335+ < Button
336+ label = { control . controller === "you" ? "Release control" : "Take control" }
337+ tone = "secondary"
340338 disabled = { control . controller === "another-viewer" }
341- accessibilityState = { { disabled : control . controller === "another-viewer" } }
342- className = "rounded-full border border-secondary-border bg-secondary px-3 py-2"
343339 onPress = { ( ) =>
344340 command ( { type : control . controller === "you" ? "releaseControl" : "takeControl" } )
345341 }
346- >
347- < AppText className = "text-xs text-secondary-foreground" >
348- { control . controller === "you" ? "Release control" : "Take control" }
349- </ AppText >
350- </ Pressable >
342+ />
351343 ) : null }
352344 </ View >
353345 ) : null }
@@ -445,22 +437,12 @@ function PreviewStreamDocumentView({
445437 The page asks for { fileChooser . multiple ? "files" : "a file" } .
446438 </ AppText >
447439 < View className = "flex-row justify-end gap-3" >
448- < Pressable
449- accessibilityRole = "button"
450- className = "px-3 py-2"
451- onPress = { ( ) => answerFileChooser ( false ) }
452- >
453- < AppText className = "text-secondary-foreground" > Cancel</ AppText >
454- </ Pressable >
455- < Pressable
456- accessibilityRole = "button"
457- className = "px-3 py-2"
440+ < Button label = "Cancel" tone = "text" onPress = { ( ) => answerFileChooser ( false ) } />
441+ < Button
442+ label = { `Choose ${ fileChooser . multiple ? "files" : "file" } ` }
443+ tone = "secondary"
458444 onPress = { ( ) => answerFileChooser ( true ) }
459- >
460- < AppText className = "text-secondary-foreground" >
461- Choose { fileChooser . multiple ? "files" : "file" }
462- </ AppText >
463- </ Pressable >
445+ />
464446 </ View >
465447 </ View >
466448 ) : null }
@@ -480,26 +462,22 @@ function PreviewStreamDocumentView({
480462 />
481463 ) : null }
482464 < View className = "flex-row justify-end gap-3" >
483- < Pressable
484- accessibilityRole = "button "
485- className = "px-3 py-2 "
465+ < Button
466+ label = "Dismiss "
467+ tone = "text "
486468 onPress = { ( ) => command ( { type : "dialog" , accept : false } ) }
487- >
488- < AppText className = "text-secondary-foreground" > Dismiss</ AppText >
489- </ Pressable >
490- < Pressable
491- accessibilityRole = "button"
492- className = "px-3 py-2"
469+ />
470+ < Button
471+ label = "Accept"
472+ tone = "secondary"
493473 onPress = { ( ) =>
494474 command ( {
495475 type : "dialog" ,
496476 accept : true ,
497477 ...( control . dialog ?. type === "prompt" ? { promptText } : { } ) ,
498478 } )
499479 }
500- >
501- < AppText className = "text-secondary-foreground" > Accept</ AppText >
502- </ Pressable >
480+ />
503481 </ View >
504482 </ >
505483 ) : (
@@ -537,15 +515,13 @@ function PreviewStreamDocumentView({
537515 </ Pressable >
538516 ) : null }
539517 { status === "error" && ! gone && ! compact ? (
540- < Pressable
541- accessibilityRole = "button"
542- className = "rounded-full border border-secondary-border bg-secondary px-6 py-3"
543- onPress = { onRetry }
544- >
545- < AppText className = "text-secondary-foreground" >
546- { hostSetup ? "Try again" : "Reconnect" }
547- </ AppText >
548- </ Pressable >
518+ < View className = "items-center" >
519+ < Button
520+ label = { hostSetup ? "Try again" : "Reconnect" }
521+ tone = "secondary"
522+ onPress = { onRetry }
523+ />
524+ </ View >
549525 ) : null }
550526 </ View >
551527 ) : null }
0 commit comments