update
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { View, Text, StyleSheet, FlatList, Pressable } from "react-native";
|
||||
import { View, Text, FlatList } from "react-native";
|
||||
import React, { useState } from "react";
|
||||
import CreateLyricsHeader from "./components/CreateLyricsHeader";
|
||||
import BorderGradient from "../../components/BorderGradient/BorderGradient";
|
||||
@@ -7,9 +7,9 @@ import { BlurView } from "expo-blur";
|
||||
import { Palette } from "../../styles";
|
||||
import { FONT_FAMILY } from "../../styles/Fonts";
|
||||
import { EMOTION_CONVEY } from "../../data/data";
|
||||
import ItemContainer from "../../components/ItemContainer/ItemContainer";
|
||||
|
||||
const EmotionConvey = () => {
|
||||
const [containerLayout, setContainerLayout] = useState(null);
|
||||
const [itemLayout, setItemLayout] = useState([]);
|
||||
|
||||
return (
|
||||
@@ -19,100 +19,59 @@ const EmotionConvey = () => {
|
||||
subTitle="Sélectionne tes intentions émotionnelles. (2 max)"
|
||||
/>
|
||||
|
||||
<View style={styles.blurContainer}>
|
||||
<BorderGradient
|
||||
gradientProps={{
|
||||
colors: ["#FFFFFF00", "#FFFFFF"],
|
||||
<ItemContainer height={responsiveHeight(50)}>
|
||||
<FlatList
|
||||
data={EMOTION_CONVEY}
|
||||
contentContainerStyle={{
|
||||
gap: 16,
|
||||
flexGrow: 1,
|
||||
zIndex: 2,
|
||||
}}
|
||||
style={{
|
||||
...styles.borderGradientStyle,
|
||||
height: containerLayout?.height,
|
||||
}}
|
||||
/>
|
||||
<BlurView
|
||||
intensity={40}
|
||||
style={{ padding: 6, zIndex: 2, }}
|
||||
onLayout={(e) => {
|
||||
e.persist();
|
||||
setContainerLayout(e.nativeEvent.layout);
|
||||
}}
|
||||
>
|
||||
<FlatList
|
||||
data={EMOTION_CONVEY}
|
||||
contentContainerStyle={{
|
||||
gap: 16,
|
||||
flexGrow: 1,
|
||||
zIndex: 2,
|
||||
}}
|
||||
renderItem={({ item, index }) => (
|
||||
<View>
|
||||
<BorderGradient
|
||||
gradientProps={{
|
||||
colors: item.color,
|
||||
}}
|
||||
style={{
|
||||
borderWidth: 1,
|
||||
height: itemLayout[index]?.height,
|
||||
borderRadius: 14,
|
||||
position: "absolute",
|
||||
width: "100%",
|
||||
}}
|
||||
/>
|
||||
<View
|
||||
style={{ borderRadius: 14, overflow: "hidden" }}
|
||||
onLayout={(e) => {
|
||||
e.persist();
|
||||
setItemLayout((prev) => [...prev, e.nativeEvent.layout]);
|
||||
}}
|
||||
renderItem={({ item, index }) => (
|
||||
<View>
|
||||
<BorderGradient
|
||||
gradientProps={{
|
||||
colors: item.color,
|
||||
}}
|
||||
style={{
|
||||
borderWidth: 1,
|
||||
height: itemLayout[index]?.height,
|
||||
borderRadius: 14,
|
||||
position: "absolute",
|
||||
width: "100%",
|
||||
}}
|
||||
/>
|
||||
<View
|
||||
style={{ borderRadius: 14, overflow: "hidden" }}
|
||||
onLayout={(e) => {
|
||||
e.persist();
|
||||
setItemLayout((prev) => [...prev, e.nativeEvent.layout]);
|
||||
}}
|
||||
>
|
||||
<BlurView
|
||||
intensity={30}
|
||||
style={{ paddingVertical: 14, paddingHorizontal: 12 }}
|
||||
>
|
||||
<BlurView
|
||||
intensity={30}
|
||||
style={{ paddingVertical: 14, paddingHorizontal: 12 }}
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 16,
|
||||
color: Palette.white,
|
||||
fontFamily: FONT_FAMILY.InterRegular,
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 16,
|
||||
color: Palette.white,
|
||||
fontFamily: FONT_FAMILY.InterRegular,
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontFamily: FONT_FAMILY.InterBold }}>
|
||||
{item.title}
|
||||
</Text>{" "}
|
||||
: {item.description}
|
||||
</Text>
|
||||
</BlurView>
|
||||
</View>
|
||||
<Text style={{ fontFamily: FONT_FAMILY.InterBold }}>
|
||||
{item.title}
|
||||
</Text>{" "}
|
||||
: {item.description}
|
||||
</Text>
|
||||
</BlurView>
|
||||
</View>
|
||||
)}
|
||||
/>
|
||||
</BlurView>
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
/>
|
||||
</ItemContainer>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default EmotionConvey;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
borderGradientStyle: {
|
||||
borderWidth: 1,
|
||||
borderRadius: 20,
|
||||
shadowColor: "#000",
|
||||
shadowOffset: {
|
||||
width: 0,
|
||||
height: 2,
|
||||
},
|
||||
shadowOpacity: 0.25,
|
||||
shadowRadius: 3.84,
|
||||
elevation: 100,
|
||||
position: "absolute",
|
||||
width: "100%",
|
||||
},
|
||||
blurContainer: {
|
||||
borderRadius: 20,
|
||||
overflow: "hidden",
|
||||
zIndex: 1,
|
||||
maxHeight: responsiveHeight(55),
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user