diff --git a/src/navigation/BottomTab.js b/src/navigation/BottomTab.js index ed0b681..baca24d 100644 --- a/src/navigation/BottomTab.js +++ b/src/navigation/BottomTab.js @@ -1,34 +1,20 @@ -import React, { useGlobal } from "reactn"; -import { StyleSheet } from "react-native"; -import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; import { Motion } from "@legendapp/motion"; +import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; +import React from "reactn"; -import { responsiveHeight } from "../actions/responsiveSizes.js"; - -import useLayoutType from "../hooks/useLayoutType.js"; - -import { Routes } from "./Routes"; import { Palette } from "../styles"; +import { Routes } from "./Routes"; import { tabs } from "../assets"; import TabBar from "./TabBar"; -import HomeStack from "./HomeStack"; -import ChatStack from "./ChatStack"; -import SettingsStack from "./SettingsStack"; -import Library from "../screens/Library/Library.js"; -import Profile from "../screens/Profile/Profile.js"; +import { Platform } from "react-native"; import HitParade from "../screens/HitParade/HitParade.js"; +import Library from "../screens/Library/Library.js"; import Playbacks from "../screens/Playbacks.js"; - -const bottomTabStyles = StyleSheet.create({ - icon: { - width: responsiveHeight(5), - height: responsiveHeight(5), - resizeMode: "contain", - }, -}); +import Profile from "../screens/Profile/Profile.js"; +import HomeStack from "./HomeStack"; const BottomTab = createBottomTabNavigator(); @@ -40,10 +26,11 @@ export const BottomTabScreen = () => { tintColor: focused ? Palette.white : "#8B8883", }} style={[ - bottomTabStyles.icon, { - width: 24, - height: 24, + width: Platform.OS === "web" ? 30 : 24, + height: Platform.OS === "web" ? 30 : 24, + marginBottom: Platform.OS === "web" ? 13 : 0, + marginTop: Platform.OS === "web" ? 13 : 0, }, ]} source={icon} diff --git a/src/navigation/TabBar.js b/src/navigation/TabBar.js index e7c2fa5..830d140 100644 --- a/src/navigation/TabBar.js +++ b/src/navigation/TabBar.js @@ -1,13 +1,10 @@ -import React from "react"; -import { View, TouchableOpacity, Text } from "react-native"; import * as Haptics from "expo-haptics"; +import React from "react"; +import { Text, TouchableOpacity, View } from "react-native"; -import { gutters, Palette, Style } from "../styles"; -import useLayoutType from "../hooks/useLayoutType"; -import BorderGradient from "../components/BorderGradient/BorderGradient"; -import { colors } from "react-native-swiper-flatlist/src/themes"; -import { BlurView } from "expo-blur"; import ItemContainer from "../components/ItemContainer/ItemContainer"; +import useLayoutType from "../hooks/useLayoutType"; +import { gutters, Palette, Style } from "../styles"; import { FONT_FAMILY } from "../styles/Fonts"; const TabBar = ({ state = {}, descriptors = {}, navigation = {} }) => { @@ -32,7 +29,7 @@ const TabBar = ({ state = {}, descriptors = {}, navigation = {} }) => { end: { x: 1, y: 0 }, }} style={{ - height: 65, + height: isWeb ? 80 : 65, }} > { options.tabBarLabel !== undefined ? options.tabBarLabel : options.title !== undefined - ? options.title - : route.name; + ? options.title + : route.name; const _onPressTabBar = () => { if (!isWeb) { @@ -97,7 +94,7 @@ const TabBar = ({ state = {}, descriptors = {}, navigation = {} }) => { {options?.tabBarIcon({ focused: isFocused })} { const { currentUID, followUser, unfollowUser } = useUser() || {}; @@ -176,7 +176,7 @@ const PlaybackItem = ({ item, isActive, userCache, getUserByUid }) => { const arr = Array.isArray(ts?.alignedWords) ? ts.alignedWords : []; return arr.map((w) => ({ - word: String(w?.word ?? ''), + word: String(w?.word ?? ""), startS: Number(w?.startS ?? 0), endS: Number(w?.endS ?? 0), })); @@ -202,43 +202,47 @@ const PlaybackItem = ({ item, isActive, userCache, getUserByUid }) => { + position: "relative", + backgroundColor: "black", + }} + > {!!videoUrl ? ( ) : ( )} {/* Right side actions */} + }} + > - + }} + > + { navigate(Routes.SingerProfile, { userId: item?.userId }); - }}> + }} + > {owner?.profilePictureURL ? ( { // rollback on failure setIsFollowing((v) => !v); } - }}> + }} + > { fontSize: 13, color: Palette.white, fontFamily: FONT_FAMILY.InterMedium, - }}> - {isFollowing ? 'Ne plus suivre' : 'Suivre'} + }} + > + {isFollowing ? "Ne plus suivre" : "Suivre"} @@ -332,7 +338,8 @@ const PlaybackItem = ({ item, isActive, userCache, getUserByUid }) => { setLikesCount((c) => (isLiked ? c + 1 : Math.max(0, c - 1))); } }} - style={{ alignItems: 'center' }}> + style={{ alignItems: "center" }} + > { fontSize: 11, marginTop: 4, fontFamily: FONT_FAMILY.InterMedium, - textAlign: 'center', - }}> + textAlign: "center", + }} + > {likesCount} )} item?.id && openComments(item.id)} - style={{ alignItems: 'center' }}> + style={{ alignItems: "center" }} + > {!!commentsCount && ( { fontSize: 11, marginTop: 4, fontFamily: FONT_FAMILY.InterMedium, - textAlign: 'center', - }}> + textAlign: "center", + }} + > {commentsCount} )} @@ -371,8 +381,8 @@ const PlaybackItem = ({ item, isActive, userCache, getUserByUid }) => { { try { - const url = item?.playbackUrl || ''; - const title = item?.title || 'Partager'; + const url = item?.playbackUrl || ""; + const title = item?.title || "Partager"; const base = item?.title ? `Découvre « ${item.title} » sur MusicLand` : `Découvre ce playback sur MusicLand`; @@ -385,20 +395,21 @@ const PlaybackItem = ({ item, isActive, userCache, getUserByUid }) => { }) ); } catch (e) {} - }}> + }} + > { fontSize: 12, color: Palette.white, fontFamily: FONT_FAMILY.InterRegular, - }}> - {item?.title || 'Description chanson'} + }} + > + {item?.title || "Description chanson"} )} @@ -436,7 +448,7 @@ const Playbacks = () => { const { getUserByUid } = useUser() || {}; const isFocused = useIsFocused(); const { data: playbacks = [], loadMore } = useDataFromRef({ - ref: projectsRef.where('playbackUrl', '!=', null), + ref: projectsRef.where("playbackUrl", "!=", null), simpleRef: false, listener: false, usePagination: true, @@ -475,7 +487,7 @@ const Playbacks = () => { }, [focusProjectId, playbacks, loadMore]); return ( - +