feat: clubcard

This commit is contained in:
2025-12-04 11:23:27 +01:00
parent fbfae145e9
commit 2985f4fa2f
3 changed files with 123 additions and 19 deletions
+33 -6
View File
@@ -16,9 +16,10 @@ import { isWeb } from "../hooks/useLayoutType.js";
import { useUserData } from "../providers/UserDataProvider"; import { useUserData } from "../providers/UserDataProvider";
import { Routes } from "../navigation"; import { Routes } from "../navigation";
import { navigate } from "../navigation/NavigationService"; import { navigate } from "../navigation/NavigationService";
import { gutters } from "../styles"; import { gutters, Palette } from "../styles";
import { FONT_FAMILY } from "../styles/Fonts"; import { FONT_FAMILY } from "../styles/Fonts";
import { subscribeCoinPackModal } from "../utils/coinPackModal"; import { subscribeCoinPackModal } from "../utils/coinPackModal";
import { BlurView } from "expo-blur";
export default ({ export default ({
children, children,
@@ -254,11 +255,37 @@ export default ({
</View> </View>
) : null} ) : null}
{showReturnHomeButton ? ( {showReturnHomeButton ? (
<GradientButton // <GradientButton
title="retour à l'accueil" // title="retour à l'accueil"
onPress={handleReturnHomePress} // onPress={handleReturnHomePress}
containerStyle={styles.returnHomeButton} // containerStyle={styles.returnHomeButton}
/> // />
<Pressable onPress={handleReturnHomePress} sty>
<BlurView
tint="light"
intensity={30}
style={{
paddingHorizontal: 10,
paddingVertical: 8,
borderRadius: 12,
overflow: "hidden",
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
}}
>
<Text
style={{
fontSize: 14,
color: Palette.white,
fontFamily: FONT_FAMILY.InterRegular,
marginRight: 5,
}}
>
{"Retour à l'accueil"}
</Text>
</BlurView>
</Pressable>
) : null} ) : null}
</View> </View>
) : null} ) : null}
+49 -6
View File
@@ -36,6 +36,7 @@ import { openCoinPackModal } from "../../utils/coinPackModal";
import useNavigateToMusicDetails from "../../hooks/useNavigateToMusicDetails"; import useNavigateToMusicDetails from "../../hooks/useNavigateToMusicDetails";
import StageCard from "./components/StageCard"; import StageCard from "./components/StageCard";
import ClubCard from "./components/ClubCard"; import ClubCard from "./components/ClubCard";
import { BlurView } from "expo-blur";
const isProjectEmpty = (project) => { const isProjectEmpty = (project) => {
if (!project) { if (!project) {
@@ -485,6 +486,14 @@ const Home = ({ navigation, route }) => {
</View> </View>
); );
const clubCard = (
<ClubCard
onPress={handleClubPress}
containerStyle={stageCardItemStyle}
variant="stage"
/>
);
const coinBalance = useMemo(() => { const coinBalance = useMemo(() => {
const value = currentUserData?.coins; const value = currentUserData?.coins;
if (typeof value === "number" && Number.isFinite(value)) { if (typeof value === "number" && Number.isFinite(value)) {
@@ -519,11 +528,32 @@ const Home = ({ navigation, route }) => {
) : null; ) : null;
const returnHomeButton = ( const returnHomeButton = (
<GradientButton <Pressable onPress={handleReturnToLanding}>
title="retour à l'accueil" <BlurView
onPress={handleReturnToLanding} tint="dark"
containerStyle={styles.returnButton} intensity={30}
/> style={{
paddingHorizontal: 10,
paddingVertical: 8,
borderRadius: 12,
overflow: "hidden",
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
}}
>
<Text
style={{
fontSize: 14,
color: Palette.white,
fontFamily: FONT_FAMILY.InterRegular,
marginRight: 5,
}}
>
{"Retour à l'accueil"}
</Text>
</BlurView>
</Pressable>
); );
const topBar = ( const topBar = (
@@ -588,7 +618,11 @@ const Home = ({ navigation, route }) => {
{stageCardsList} {stageCardsList}
<ClubCard onPress={handleClubPress} /> {isWeb ? (
<View style={styles.webClubWrapper}>{clubCard}</View>
) : (
<View style={styles.mobileClubWrapper}>{clubCard}</View>
)}
</> </>
); );
@@ -845,6 +879,15 @@ const styles = StyleSheet.create({
flexDirection: "column", flexDirection: "column",
alignItems: "stretch", alignItems: "stretch",
}, },
webClubWrapper: {
width: "100%",
alignItems: "center",
marginTop: 16,
},
mobileClubWrapper: {
width: "100%",
marginTop: 20,
},
webStageCard: { webStageCard: {
width: "48%", width: "48%",
}, },
+41 -7
View File
@@ -1,15 +1,32 @@
import React, { memo, useEffect } from "react"; import React, { memo } from "react";
import { Image, Pressable, StyleSheet, View } from "react-native"; import { Image, Pressable, StyleSheet } from "react-native";
import { isWeb } from "../../../hooks/useLayoutType.js"; import { isWeb } from "../../../hooks/useLayoutType.js";
import { img } from "../../../assets/index.js"; import { img } from "../../../assets/index.js";
const ClubCard = ({ onPress }) => { const ClubCard = ({
onPress,
containerStyle = null,
variant = "compact",
}) => {
const isStageVariant = variant === "stage";
const cardBaseStyle = isStageVariant
? isWeb
? styles.stageCardWeb
: styles.stageCardMobile
: styles.compactCard;
const imageStyle = isStageVariant ? styles.stageImage : styles.compactImage;
return ( return (
<Pressable <Pressable
onPress={onPress} onPress={onPress}
style={({ pressed }) => [styles.card, pressed && styles.cardPressed]} style={({ pressed }) => [
styles.card,
cardBaseStyle,
containerStyle,
pressed && styles.cardPressed,
]}
> >
<Image source={img.musiclandClub} style={styles.image} /> <Image source={img.musiclandClub} style={imageStyle} />
</Pressable> </Pressable>
); );
}; };
@@ -17,16 +34,33 @@ const ClubCard = ({ onPress }) => {
export default ClubCard; export default ClubCard;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
card: { card: {},
compactCard: {
marginTop: isWeb ? 16 : 28, marginTop: isWeb ? 16 : 28,
alignSelf: "center", alignSelf: "center",
}, },
stageCardWeb: {
width: "48%",
borderRadius: 20,
overflow: "hidden",
},
stageCardMobile: {
width: "100%",
borderRadius: 24,
overflow: "hidden",
marginBottom: 20,
},
cardPressed: { cardPressed: {
opacity: 0.85, opacity: 0.85,
}, },
image: { compactImage: {
width: 210, width: 210,
height: 120, height: 120,
resizeMode: "contain", resizeMode: "contain",
}, },
stageImage: {
width: "100%",
height: isWeb ? 210 : 300,
resizeMode: "contain",
},
}); });