-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(expo-hqplan): added the windy library and loaded the first compon…
…ent.
- Loading branch information
Showing
10 changed files
with
179 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,12 @@ | ||
module.exports = function (api) { | ||
api.cache(true); | ||
|
||
api.cache(true) | ||
return { | ||
presets: [ | ||
[ | ||
'@nx/react/babel', | ||
{ | ||
runtime: 'automatic', | ||
useBuiltIns: 'usage', | ||
}, | ||
], | ||
["babel-preset-expo", { jsxImportSource: "nativewind" }], | ||
"nativewind/babel", | ||
], | ||
plugins: [ | ||
'nativewind/babel', | ||
'react-native-reanimated/plugin', | ||
"react-native-reanimated/plugin" | ||
], | ||
env: { | ||
test: { | ||
presets: ['babel-preset-expo'], | ||
}, | ||
}, | ||
}; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,80 @@ | ||
/* eslint-disable jsx-a11y/accessible-emoji */ | ||
import { View, Text, SafeAreaView, ScrollView, TouchableOpacity } from 'react-native'; | ||
import { | ||
View, | ||
Text, | ||
SafeAreaView, | ||
ScrollView, | ||
TouchableOpacity, | ||
} from 'react-native'; | ||
import Svg, { G, Path } from 'react-native-svg'; | ||
import { useRef, useState } from 'react'; | ||
import { WindyHero } from '@kbve/windy'; | ||
|
||
const HomeScreen = () => { | ||
const [whatsNextYCoord, setWhatsNextYCoord] = useState<number>(0); | ||
const scrollViewRef = useRef<null | ScrollView>(null); | ||
|
||
const [whatsNextYCoord, setWhatsNextYCoord] = useState<number>(0); | ||
const scrollViewRef = useRef<null | ScrollView>(null); | ||
|
||
return ( | ||
<SafeAreaView className="flex-1"> | ||
<ScrollView | ||
ref={(ref) => { | ||
scrollViewRef.current = ref; | ||
}} | ||
contentInsetAdjustmentBehavior="automatic" | ||
className="bg-cyan-400"> | ||
<View className="my-6 mx-3"> | ||
<Text className="text-2xl">Hello there,</Text> | ||
<Text | ||
className="text-5xl font-medium pt-3" | ||
testID="heading" | ||
role="heading"> | ||
Welcome ExpoHqplan 👋 | ||
</Text> | ||
</View> | ||
<View className="my-6 mx-3"> | ||
<View className="rounded-xl bg-[#143055] p-9 mb-6"> | ||
<View className="flex-1 flex-row"> | ||
<Svg | ||
width={32} | ||
height={32} | ||
stroke="hsla(162, 47%, 50%, 1)" | ||
fill="none" | ||
viewBox="0 0 24 24"> | ||
<Path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="2" | ||
d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z" | ||
/> | ||
</Svg> | ||
<Text className="text-2xl text-white ml-3" | ||
> | ||
You're up and running | ||
</Text> | ||
</View> | ||
<TouchableOpacity | ||
className="bg-white py-4 rounded-lg w-1/2 mt-6" | ||
onPress={() => { | ||
scrollViewRef.current?.scrollTo({ | ||
x: 0, | ||
y: whatsNextYCoord, | ||
}); | ||
}}> | ||
<Text | ||
className="text-lg text-center"> | ||
What's next? | ||
</Text> | ||
</TouchableOpacity> | ||
return ( | ||
<SafeAreaView className="flex-1"> | ||
<ScrollView | ||
ref={(ref) => { | ||
scrollViewRef.current = ref; | ||
}} | ||
contentInsetAdjustmentBehavior="automatic" | ||
className="bg-cyan-400"> | ||
<View className="my-6 mx-3"> | ||
<Text className="text-2xl">Hello there,</Text> | ||
<Text | ||
className="text-5xl font-medium pt-3" | ||
testID="heading" | ||
role="heading"> | ||
Welcome ExpoHqplan 👋 | ||
</Text> | ||
</View> | ||
<View className="my-6 mx-3"> | ||
<View className="rounded-xl bg-[#143055] p-9 mb-6"> | ||
<View className="flex-1 flex-row"> | ||
<Svg | ||
width={32} | ||
height={32} | ||
stroke="hsla(162, 47%, 50%, 1)" | ||
fill="none" | ||
viewBox="0 0 24 24"> | ||
<Path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="2" | ||
d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z" | ||
/> | ||
</Svg> | ||
<Text className="text-2xl text-white ml-3"> | ||
You're up and running | ||
</Text> | ||
</View> | ||
<TouchableOpacity | ||
className="bg-white py-4 rounded-lg w-1/2 mt-6" | ||
onPress={() => { | ||
scrollViewRef.current?.scrollTo({ | ||
x: 0, | ||
y: whatsNextYCoord, | ||
}); | ||
}}> | ||
<Text className="text-lg text-center"> | ||
What's next? | ||
</Text> | ||
</TouchableOpacity> | ||
</View> | ||
</ScrollView> | ||
</SafeAreaView> | ||
); | ||
</View> | ||
<View className="flex-1 bg-gray-900"> | ||
<WindyHero | ||
title="Discover the Windy Experience!" | ||
subtitle="A seamless blend of design and performance" | ||
imageUrl="https://images.unsplash.com/photo-1727466928916-9789f30de10b?q=80&w=3387&auto=format&fit=crop&ixlib=rb-4.0.3" | ||
/> | ||
</View> | ||
</ScrollView> | ||
</SafeAreaView> | ||
); | ||
}; | ||
|
||
export default HomeScreen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
module.exports = function (api) { | ||
api.cache(true); | ||
|
||
return { | ||
presets: [ | ||
[ | ||
'@nx/react/babel', | ||
{ | ||
runtime: 'automatic', | ||
useBuiltIns: 'usage', | ||
}, | ||
], | ||
presets: [ | ||
[ | ||
'@nx/react/babel', | ||
{ | ||
runtime: 'automatic', | ||
useBuiltIns: 'usage', | ||
}, | ||
], | ||
plugins: [], | ||
env: { | ||
test: { | ||
presets: ['babel-preset-expo'], | ||
}, | ||
], | ||
plugins: [ | ||
'nativewind/babel', | ||
'react-native-reanimated/plugin', | ||
], | ||
env: { | ||
test: { | ||
presets: ['babel-preset-expo'], | ||
}, | ||
}, | ||
}; | ||
}; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { View, Text } from 'react-native'; | ||
import Animated, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated'; | ||
import { Image as ExpoImage } from 'expo-image'; | ||
import { cn } from '../../utils/cn'; | ||
import React from 'react'; | ||
|
||
// Create an animated image component | ||
const AnimatedImage = Animated.createAnimatedComponent(ExpoImage); | ||
|
||
interface WindyHeroProps { | ||
title: string; | ||
subtitle?: string; | ||
imageUrl: string; | ||
} | ||
|
||
export default function WindyHero({ title, subtitle, imageUrl }: WindyHeroProps) { | ||
const opacity = React.useRef(useSharedValue(0)).current; | ||
|
||
const animatedTextStyle = useAnimatedStyle(() => ({ | ||
opacity: withSpring(opacity.value, { damping: 10, stiffness: 100 }), | ||
})); | ||
|
||
React.useEffect(() => { | ||
opacity.value = 1; | ||
}, [opacity]); | ||
|
||
return ( | ||
<View className={cn("relative w-full h-60 md:h-80 lg:h-96 overflow-hidden")}> | ||
|
||
<AnimatedImage | ||
source={{ uri: imageUrl }} | ||
className={cn("absolute top-0 left-0 w-full h-full object-cover")} | ||
contentFit="cover" | ||
/> | ||
|
||
<View className={cn("absolute inset-0 flex items-center justify-center px-4")}> | ||
<Animated.View style={animatedTextStyle}> | ||
<Text className={cn("text-white text-2xl md:text-4xl font-bold text-center")}> | ||
{title} | ||
</Text> | ||
{subtitle && ( | ||
<Text className={cn("text-white text-lg md:text-2xl mt-2 text-center")}> | ||
{subtitle} | ||
</Text> | ||
)} | ||
</Animated.View> | ||
</View> | ||
</View> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as WindyHero } from "./components/hero/WindyHero"; | ||
export { cn } from "./utils/cn"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { clsx, type ClassValue } from 'clsx'; | ||
import { twMerge } from 'tailwind-merge'; | ||
|
||
export function cn(...inputs: ClassValue[]) { | ||
return twMerge(clsx(inputs)); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.