@@ -6,46 +6,93 @@ import { InstallationTabs } from "@/components/docs/installation-tabs";
66import Image from "next/image" ;
77import { useTheme } from "next-themes" ;
88
9- export default function InstallationPage ( ) {
10- const [ selectedPlatform , setSelectedPlatform ] = React . useState ( "expo" ) ;
11- const { resolvedTheme } = useTheme ( ) ;
12- const [ mounted , setMounted ] = React . useState ( false ) ;
13-
14- React . useEffect ( ( ) => {
15- setMounted ( true ) ;
16- } , [ ] ) ;
9+ const InstallationPageSkeleton = ( ) => {
10+ return (
11+ < div className = "container max-w-3xl py-10 animate-pulse" >
12+ { /* Header skeleton */ }
13+ < div className = "space-y-6" >
14+ < div className = "space-y-4" >
15+ < div className = "h-10 bg-muted rounded-md w-1/2" > </ div >
16+ < div className = "h-6 bg-muted rounded-md w-full" > </ div >
17+ < div className = "h-6 bg-muted rounded-md w-4/5" > </ div >
18+ </ div >
1719
18- if ( ! mounted ) {
19- return (
20- < div className = "space-y-8" >
21- < div >
22- < h1 className = "text-3xl font-bold tracking-tight" > Installation</ h1 >
23- < p className = "text-muted-foreground text-lg mt-2" >
24- How to install dependencies and structure your app.
25- </ p >
20+ { /* Info banner skeleton */ }
21+ < div className = "rounded-lg border-2 p-4" >
22+ < div className = "flex items-center gap-3" >
23+ < div className = "rounded-full bg-muted p-2 w-9 h-9" > </ div >
24+ < div className = "h-5 bg-muted rounded-md flex-1" > </ div >
25+ </ div >
2626 </ div >
27+ </ div >
28+
29+ { /* Platform selection skeleton */ }
30+ < div className = "mt-12 space-y-8" >
2731 < div className = "grid grid-cols-1 md:grid-cols-2 gap-6" >
28- < div className = "relative overflow-hidden rounded-lg border p-6" >
32+ < div className = "rounded-lg border p-6" >
2933 < div className = "flex flex-col items-center space-y-4" >
30- < div className = "h-16 w-16 relative" >
31- < Image
32- src = { resolvedTheme === 'dark' ? "/images/expo-logo-dark.svg" : "/images/expo-logo.svg" }
33- alt = "Expo"
34- fill
35- className = "object-contain"
36- />
34+ < div className = "h-16 w-16 bg-muted rounded" > </ div >
35+ < div className = "text-center space-y-2" >
36+ < div className = "h-6 bg-muted rounded-md w-32" > </ div >
37+ < div className = "h-4 bg-muted rounded-md w-40" > </ div >
3738 </ div >
38- < div className = "text-center" >
39- < h3 className = "font-bold text-xl" > Expo (Recommended)</ h3 >
40- < p className = "text-sm text-muted-foreground mt-1" >
41- Quick setup with better developer experience
42- </ p >
39+ </ div >
40+ </ div >
41+ < div className = "rounded-lg border p-6 opacity-50" >
42+ < div className = "flex flex-col items-center space-y-4" >
43+ < div className = "h-16 w-16 bg-muted rounded" > </ div >
44+ < div className = "text-center space-y-2" >
45+ < div className = "h-6 bg-muted rounded-md w-32" > </ div >
46+ < div className = "h-4 bg-muted rounded-md w-40" > </ div >
4347 </ div >
4448 </ div >
4549 </ div >
4650 </ div >
51+
52+ { /* Installation steps skeleton */ }
53+ < div className = "space-y-8" >
54+ < div className = "space-y-4" >
55+ < div className = "h-8 bg-muted rounded-md w-1/3" > </ div >
56+ < div className = "h-5 bg-muted rounded-md w-full" > </ div >
57+ < div className = "h-5 bg-muted rounded-md w-3/4" > </ div >
58+ </ div >
59+
60+ { /* Multiple step skeletons */ }
61+ { Array . from ( { length : 6 } ) . map ( ( _ , i ) => (
62+ < div key = { i } className = "space-y-4" >
63+ < div className = "h-6 bg-muted rounded-md w-1/4" > </ div >
64+ < div className = "h-4 bg-muted rounded-md w-full" > </ div >
65+ < div className = "h-32 bg-muted rounded-md" > </ div >
66+ </ div >
67+ ) ) }
68+ </ div >
4769 </ div >
48- ) ;
70+ </ div >
71+ ) ;
72+ } ;
73+
74+ export default function InstallationPage ( ) {
75+ const [ selectedPlatform , setSelectedPlatform ] = React . useState ( "expo" ) ;
76+ const { resolvedTheme } = useTheme ( ) ;
77+ const [ mounted , setMounted ] = React . useState ( false ) ;
78+ const [ isLoading , setIsLoading ] = React . useState ( true ) ;
79+
80+ React . useEffect ( ( ) => {
81+ const loadResources = async ( ) => {
82+ setIsLoading ( true ) ;
83+
84+ // Simulate loading time for theme and resources
85+ await new Promise ( resolve => setTimeout ( resolve , 800 ) ) ;
86+
87+ setMounted ( true ) ;
88+ setIsLoading ( false ) ;
89+ } ;
90+
91+ loadResources ( ) ;
92+ } , [ ] ) ;
93+
94+ if ( isLoading || ! mounted ) {
95+ return < InstallationPageSkeleton /> ;
4996 }
5097
5198 return (
@@ -136,7 +183,7 @@ export default function InstallationPage() {
136183 < div className = "mt-8 space-y-12" >
137184 < div className = "space-y-4" >
138185 < h3 className = "text-xl font-semibold" > 1. Create Expo Project</ h3 >
139- < InstallationTabs command = "create-expo-app my-app --template default " />
186+ < InstallationTabs command = "create-expo-app my-app" />
140187 </ div >
141188
142189 < div className = "space-y-4" >
@@ -473,7 +520,7 @@ export function cn(...inputs: ClassValue[]) {
473520 "strict": true,
474521 "paths": {
475522 "@/*": [
476- "./"
523+ "./* "
477524 ]
478525 }
479526 },
@@ -634,41 +681,34 @@ function AppContent() {
634681 Add this code in any of your components to test that everything is working:
635682 </ p >
636683 < CodeBlock
637- language = "typescript "
684+ language = "tsx "
638685 collapsible
639- title = "app/components/TestComponent.tsx"
640- code = { `import { Button } from '@/components/ui/button';
641- import { Text } from 'react-native';
686+ title = "Test Component"
687+ code = { `import { View, Text } from 'react-native';
642688
643- // ... rest of your imports ...
644-
645- return (
646- <Button>
647- <Text className="text-primary-foreground">Click me</Text>
648- </Button>
649- );` }
689+ export default function TestComponent() {
690+ return (
691+ <View className="flex-1 justify-center items-center bg-background">
692+ <Text className="text-2xl font-bold text-foreground">
693+ NativeUI is working! 🎉
694+ </Text>
695+ </View>
696+ );
697+ }` }
650698 />
651699 </ div >
652700 </ div >
653701 </ div >
654702 </ div >
655703 ) : (
656- < div className = "rounded-lg border-2 border-muted p-8 text-center" >
657- < h2 className = "text-2xl font-bold tracking-tight mb-4 " > React Native CLI Support </ h2 >
658- < p className = "text-muted-foreground text-lg leading-7 " >
659- Support for React Native CLI is coming soon. We recommend using Expo for now.
704+ < div className = "text-center py-12 " >
705+ < h3 className = "text-xl font-semibold mb-2 " > React Native CLI</ h3 >
706+ < p className = "text-muted-foreground" >
707+ Support for React Native CLI is coming soon. Stay tuned!
660708 </ p >
661709 </ div >
662710 ) }
663711 </ div >
664-
665- < div className = "mt-12 space-y-4" >
666- < h2 className = "text-2xl font-bold tracking-tight" > Next Steps</ h2 >
667- < p className = "text-muted-foreground leading-7" >
668- Now that you have set up your project, you can start adding components from our collection.
669- Visit the components section to explore available components and learn how to use them.
670- </ p >
671- </ div >
672712 </ div >
673713 ) ;
674714}
0 commit comments