feat: fixes
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 777 KiB |
+2
-1
@@ -104,7 +104,7 @@ import placeholder2 from "./UI/placeholder2.jpg";
|
|||||||
import placeholder3 from "./UI/placeholder3.png";
|
import placeholder3 from "./UI/placeholder3.png";
|
||||||
import placeholder4 from "./UI/placeholder4.jpg";
|
import placeholder4 from "./UI/placeholder4.jpg";
|
||||||
import profile from "./UI/profile.jpg";
|
import profile from "./UI/profile.jpg";
|
||||||
|
import musiclandClub from "./UI/musiclandClub.png";
|
||||||
export const tabs = {
|
export const tabs = {
|
||||||
home,
|
home,
|
||||||
tasks,
|
tasks,
|
||||||
@@ -237,6 +237,7 @@ export const img = {
|
|||||||
placeholder4,
|
placeholder4,
|
||||||
profile,
|
profile,
|
||||||
goodVibe,
|
goodVibe,
|
||||||
|
musiclandClub,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const cardsImg = {
|
export const cardsImg = {
|
||||||
|
|||||||
@@ -575,9 +575,7 @@ const Home = ({ navigation, route }) => {
|
|||||||
{stageCardsList}
|
{stageCardsList}
|
||||||
|
|
||||||
<ClubCard
|
<ClubCard
|
||||||
image={icons.clubIcon}
|
|
||||||
onPress={handleClubPress}
|
onPress={handleClubPress}
|
||||||
hasActiveSubscription={hasActiveSubscription}
|
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,60 +1,32 @@
|
|||||||
import React, { memo, useEffect } from "react";
|
import React, { memo, useEffect } from "react";
|
||||||
import { Pressable, StyleSheet, View } from "react-native";
|
import { Image, Pressable, StyleSheet, View } from "react-native";
|
||||||
import { useVideoPlayer, VideoView } from "expo-video";
|
|
||||||
import { videos } from "../../../assets";
|
|
||||||
import { isWeb } from "../../../hooks/useLayoutType.js";
|
import { isWeb } from "../../../hooks/useLayoutType.js";
|
||||||
|
import { img } from "../../../assets/index.js";
|
||||||
|
|
||||||
const ClubCard = ({ onPress }) => {
|
const ClubCard = ({ onPress }) => {
|
||||||
const player = useVideoPlayer(videos.club, (player) => {
|
|
||||||
player.loop = true;
|
|
||||||
player.muted = true;
|
|
||||||
player.play();
|
|
||||||
});
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (player) {
|
|
||||||
player.muted = true;
|
|
||||||
player.loop = true;
|
|
||||||
player.play();
|
|
||||||
}
|
|
||||||
}, [player]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
style={({ pressed }) => [styles.card, pressed && styles.cardPressed]}
|
style={({ pressed }) => [styles.card, pressed && styles.cardPressed]}
|
||||||
>
|
>
|
||||||
<View style={styles.inner}>
|
<Image source={img.musiclandClub} style={styles.image} />
|
||||||
<VideoView
|
|
||||||
player={player}
|
|
||||||
style={styles.video}
|
|
||||||
contentFit="cover"
|
|
||||||
nativeControls={false}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</Pressable>
|
</Pressable>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default memo(ClubCard);
|
export default ClubCard;
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
card: {
|
card: {
|
||||||
marginTop: isWeb ? 16 : 28,
|
marginTop: isWeb ? 16 : 28,
|
||||||
backgroundColor: "#252438",
|
|
||||||
overflow: "hidden",
|
|
||||||
width: 200,
|
|
||||||
height: 120, // Added fixed height to ensure video visibility, adjusting based on previous content size estimation
|
|
||||||
alignSelf: "center",
|
alignSelf: "center",
|
||||||
},
|
},
|
||||||
cardPressed: {
|
cardPressed: {
|
||||||
opacity: 0.85,
|
opacity: 0.85,
|
||||||
},
|
},
|
||||||
inner: {
|
image: {
|
||||||
flex: 1,
|
width: 210,
|
||||||
},
|
height: 120,
|
||||||
video: {
|
resizeMode: "contain",
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user