From c0c2918e72e7f2b78f154d06aa0d7b2262f1ca19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Mon, 18 Sep 2023 19:17:37 +0200 Subject: [PATCH 01/15] Started navigation --- front/Navigation.tsx | 5 +- front/components/V2/TabNavigation.tsx | 139 ++++++++++++++++++++ front/components/V2/TabNavigationButton.tsx | 72 ++++++++++ front/components/V2/TabNavigationList.tsx | 28 ++++ 4 files changed, 242 insertions(+), 2 deletions(-) create mode 100644 front/components/V2/TabNavigation.tsx create mode 100644 front/components/V2/TabNavigationButton.tsx create mode 100644 front/components/V2/TabNavigationList.tsx diff --git a/front/Navigation.tsx b/front/Navigation.tsx index 486ac99..70107a6 100644 --- a/front/Navigation.tsx +++ b/front/Navigation.tsx @@ -31,6 +31,7 @@ import ErrorView from './views/ErrorView'; import GenreDetailsView from './views/GenreDetailsView'; import GoogleView from './views/GoogleView'; import VerifiedView from './views/VerifiedView'; +import TabNavigation from './components/V2/TabNavigation'; // Util function to hide route props in URL const removeMe = () => ''; @@ -38,8 +39,8 @@ const removeMe = () => ''; const protectedRoutes = () => ({ Home: { - component: HomeView, - options: { title: translate('welcome'), headerLeft: null }, + component: TabNavigation, + options: { title: translate('welcome'), headerShown: false }, link: '/', }, Play: { component: PlayView, options: { title: translate('play') }, link: '/play/:songId' }, diff --git a/front/components/V2/TabNavigation.tsx b/front/components/V2/TabNavigation.tsx new file mode 100644 index 0000000..10f7752 --- /dev/null +++ b/front/components/V2/TabNavigation.tsx @@ -0,0 +1,139 @@ +import { View, Pressable, Text, Image } from 'react-native'; +import { Divider, Text as NBText, Center } from 'native-base'; +import TabNavigationButton from './TabNavigationButton'; +import TabNavigationList from './TabNavigationList'; +import { useAssets } from 'expo-asset'; +import useColorScheme from '../../hooks/colorScheme'; + +const TabNavigation = () => { + const colorScheme = useColorScheme(); + const [icon] = useAssets( + colorScheme == 'light' + ? require('../../assets/icon_light.png') + : require('../../assets/icon_dark.png') + ); + const buttons = [ + { + icon: 'icon', + label: 'label', + onPress: () => {}, + onLongPress: () => {}, + isActive: true, + }, + { + icon: 'icon', + label: 'salut', + onPress: () => {}, + onLongPress: () => {}, + isActive: false, + }, + ]; + + const others = [ + { + label: 'Recently played', + }, + { + label: 'Short', + }, + { label: 'Twinkle Twinkle' }, + ]; + return ( + + +
+ + + + Chromacase + + +
+ + + {buttons.map((button, index) => ( + + ))} + + + + + {others.map((other, index) => ( + + {other.label} + + ))} + + + + {[{ label: 'Settings' }, { label: 'Logout' }].map((button, index) => ( + + ))} + + + +
+ + Main content page + +
+ ); +}; + +export default TabNavigation; diff --git a/front/components/V2/TabNavigationButton.tsx b/front/components/V2/TabNavigationButton.tsx new file mode 100644 index 0000000..9d9b807 --- /dev/null +++ b/front/components/V2/TabNavigationButton.tsx @@ -0,0 +1,72 @@ +import { View, Text } from 'react-native'; +import { Pressable } from 'native-base'; + +type TabNavigationButtonProps = { + icon?: string; + label: string; + onPress: () => void; + onLongPress: () => void; + isActive: boolean; +}; + +const TabNavigationButton = (props: TabNavigationButtonProps) => { + return ( + + {({ isPressed, isHovered }) => ( + { + if (isPressed) { + return 'rgba(0, 0, 0, 0.1)'; + } else if (isHovered) { + return 'rgba(0, 0, 0, 0.05)'; + } else if (props.isActive) { + return 'rgba(0, 0, 0, 0.1)'; + } else { + return 'transparent'; + } + })(), + }} + > + {props.icon && ( + + {props.icon} + + )} + + + {props.label} + + + + )} + + ); +}; + +TabNavigationButton.defaultProps = { + icon: undefined, + onPress: () => {}, + onLongPress: () => {}, + isActive: false, +}; + +export default TabNavigationButton; diff --git a/front/components/V2/TabNavigationList.tsx b/front/components/V2/TabNavigationList.tsx new file mode 100644 index 0000000..6b99f8e --- /dev/null +++ b/front/components/V2/TabNavigationList.tsx @@ -0,0 +1,28 @@ +import React from 'react'; +import { View, StyleProp, ViewStyle } from 'react-native'; + +type TabNavigationListProps = { + children: React.ReactNode; + style?: StyleProp; +}; + +const TabNavigationList = (props: TabNavigationListProps) => { + return ( + + {props.children} + + ); +}; + +export default TabNavigationList; From dcca1b1f1c983c0bc751498d04629acb51dc721c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Tue, 19 Sep 2023 02:15:27 +0200 Subject: [PATCH 02/15] Added phone and responsive support on the tabnavigation added callapsables fixed colorscheme and setting background color --- front/components/V2/TabNavigation.tsx | 218 ++++++++----------- front/components/V2/TabNavigationButton.tsx | 31 ++- front/components/V2/TabNavigationDesktop.tsx | 147 +++++++++++++ front/components/V2/TabNavigationPhone.tsx | 64 ++++++ 4 files changed, 327 insertions(+), 133 deletions(-) create mode 100644 front/components/V2/TabNavigationDesktop.tsx create mode 100644 front/components/V2/TabNavigationPhone.tsx diff --git a/front/components/V2/TabNavigation.tsx b/front/components/V2/TabNavigation.tsx index 10f7752..935e3f7 100644 --- a/front/components/V2/TabNavigation.tsx +++ b/front/components/V2/TabNavigation.tsx @@ -1,137 +1,107 @@ -import { View, Pressable, Text, Image } from 'react-native'; -import { Divider, Text as NBText, Center } from 'native-base'; -import TabNavigationButton from './TabNavigationButton'; -import TabNavigationList from './TabNavigationList'; -import { useAssets } from 'expo-asset'; +import { useBreakpointValue } from 'native-base'; +import { View } from 'react-native'; +import TabNavigationDesktop from './TabNavigationDesktop'; +import TabNavigationPhone from './TabNavigationPhone'; +import { Ionicons } from '@expo/vector-icons'; +import React, { useState } from 'react'; +import { useSelector } from 'react-redux'; +import { RootState } from '../../state/Store'; import useColorScheme from '../../hooks/colorScheme'; -const TabNavigation = () => { - const colorScheme = useColorScheme(); - const [icon] = useAssets( - colorScheme == 'light' - ? require('../../assets/icon_light.png') - : require('../../assets/icon_dark.png') - ); - const buttons = [ - { - icon: 'icon', - label: 'label', - onPress: () => {}, - onLongPress: () => {}, - isActive: true, - }, - { - icon: 'icon', - label: 'salut', - onPress: () => {}, - onLongPress: () => {}, - isActive: false, - }, - ]; +export type NaviTab = { + id: string; + label: string; + icon?: React.ReactNode; + onPress?: () => void; + onLongPress?: () => void; + isActive?: boolean; + isCollapsed?: boolean; + iconName?: string; +}; + +const tabs = [ + { + id: 'home', + label: 'Discovery', + icon: , + iconName: 'search', + }, + { + id: 'profile', + label: 'Profile', + icon: , + iconName: 'person', + }, + { + id: 'music', + label: 'Music', + icon: , + iconName: 'musical-notes', + }, + { + id: 'search', + label: 'Search', + icon: , + iconName: 'search', + }, + { + id: 'notifications', + label: 'Notifications', + icon: , + iconName: 'notifications', + }, + { + id: 'settings', + label: 'Settings', + icon: , + iconName: 'settings', + }, +] as NaviTab[]; + +const TabNavigation = () => { + const screenSize = useBreakpointValue({ base: 'small', md: 'big' }); + const [isDesktopCollapsed, setIsDesktopCollapsed] = useState(false); + const [activeTab, setActiveTab] = useState(tabs[0]?.id ?? 'home'); + const colorScheme = useColorScheme(); + + const appTabs = tabs.map((t) => { + return { + ...t, + onPress: () => setActiveTab(t.id), + icon: ( + + ), + }; + }); - const others = [ - { - label: 'Recently played', - }, - { - label: 'Short', - }, - { label: 'Twinkle Twinkle' }, - ]; return ( - -
- - - - Chromacase - - -
- - - {buttons.map((button, index) => ( - - ))} - - - - - {others.map((other, index) => ( - - {other.label} - - ))} - - - - {[{ label: 'Settings' }, { label: 'Logout' }].map((button, index) => ( - - ))} - - - -
- - Main content page - + {screenSize === 'small' ? ( + + ) : ( + + )}
); }; diff --git a/front/components/V2/TabNavigationButton.tsx b/front/components/V2/TabNavigationButton.tsx index 9d9b807..3b37111 100644 --- a/front/components/V2/TabNavigationButton.tsx +++ b/front/components/V2/TabNavigationButton.tsx @@ -1,12 +1,14 @@ -import { View, Text } from 'react-native'; -import { Pressable } from 'native-base'; +import { View } from 'react-native'; +import { Pressable, Text } from 'native-base'; +import React from 'react'; type TabNavigationButtonProps = { - icon?: string; + icon?: React.ReactNode; label: string; onPress: () => void; onLongPress: () => void; isActive: boolean; + isCollapsed: boolean; }; const TabNavigationButton = (props: TabNavigationButtonProps) => { @@ -29,13 +31,23 @@ const TabNavigationButton = (props: TabNavigationButtonProps) => { padding: '10px', borderRadius: '8px', flexGrow: 0, + boxShadow: (() => { + if (isHovered) { + return '0px 0px 16px 0px rgba(0, 0, 0, 0.25)'; + } else if (props.isActive) { + return '0px 0px 8px 0px rgba(0, 0, 0, 0.25)'; + } else { + return undefined; + } + })(), + backdropFilter: 'blur(2px)', backgroundColor: (() => { if (isPressed) { return 'rgba(0, 0, 0, 0.1)'; } else if (isHovered) { - return 'rgba(0, 0, 0, 0.05)'; + return 'rgba(231, 231, 232, 0.2)'; } else if (props.isActive) { - return 'rgba(0, 0, 0, 0.1)'; + return 'rgba(16, 16, 20, 0.5)'; } else { return 'transparent'; } @@ -45,17 +57,17 @@ const TabNavigationButton = (props: TabNavigationButtonProps) => { {props.icon && ( - {props.icon} + {props.icon} )} - + {!props.isCollapsed && ( {props.label} - + )} )} @@ -67,6 +79,7 @@ TabNavigationButton.defaultProps = { onPress: () => {}, onLongPress: () => {}, isActive: false, + isCollapsed: false, }; export default TabNavigationButton; diff --git a/front/components/V2/TabNavigationDesktop.tsx b/front/components/V2/TabNavigationDesktop.tsx new file mode 100644 index 0000000..85f5991 --- /dev/null +++ b/front/components/V2/TabNavigationDesktop.tsx @@ -0,0 +1,147 @@ +import { View, Image } from 'react-native'; +import { Divider, Text, Center } from 'native-base'; +import TabNavigationButton from './TabNavigationButton'; +import TabNavigationList from './TabNavigationList'; +import { useAssets } from 'expo-asset'; +import useColorScheme from '../../hooks/colorScheme'; +import { NaviTab } from './TabNavigation'; + +type TabNavigationDesktopProps = { + tabs: NaviTab[]; + isCollapsed: boolean; + setIsCollapsed: (isCollapsed: boolean) => void; + activeTabID: string; + setActiveTabID: (id: string) => void; +}; + +const TabNavigationDesktop = (props: TabNavigationDesktopProps) => { + const colorScheme = useColorScheme(); + const [icon] = useAssets( + colorScheme == 'light' + ? require('../../assets/icon_light.png') + : require('../../assets/icon_dark.png') + ); + // settings is displayed separately (with logout) + const buttons = props.tabs.filter((tab) => tab.id !== 'settings'); + + const others = [ + { + label: 'Recently played', + }, + { + label: 'Short', + }, + { label: 'Twinkle Twinkle' }, + ]; + + return ( + + +
+ + + + Chromacase + + +
+ + + {buttons.map((button, index) => ( + + ))} + + + + + {others.map((other, index) => ( + + {other.label} + + ))} + + + + {([props.tabs.find((t) => t.id === 'settings')] as NaviTab[]).map( + (button, index) => ( + + ) + )} + + + +
+ + Main content page + +
+ ); +}; + +export default TabNavigationDesktop; diff --git a/front/components/V2/TabNavigationPhone.tsx b/front/components/V2/TabNavigationPhone.tsx new file mode 100644 index 0000000..e3b3736 --- /dev/null +++ b/front/components/V2/TabNavigationPhone.tsx @@ -0,0 +1,64 @@ +import { View } from 'react-native'; +import { Text, Center } from 'native-base'; +import TabNavigationButton from './TabNavigationButton'; +import { NaviTab } from './TabNavigation'; + +type TabNavigationPhoneProps = { + tabs: NaviTab[]; + activeTabID: string; + setActiveTabID: (id: string) => void; +}; + +const TabNavigationPhone = (props: TabNavigationPhoneProps) => { + return ( + + +
+ + {props.tabs.map((tab) => ( + + + + ))} + +
+
+ + Main content page + +
+ ); +}; + +export default TabNavigationPhone; From e817021edebc51748359b38b4c01a1d52c60457e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Tue, 19 Sep 2023 02:24:26 +0200 Subject: [PATCH 03/15] fix type errors --- front/components/V2/TabNavigation.tsx | 2 -- front/components/V2/TabNavigationButton.tsx | 3 ++- front/components/V2/TabNavigationDesktop.tsx | 2 ++ front/components/V2/TabNavigationList.tsx | 1 + front/components/V2/TabNavigationPhone.tsx | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/front/components/V2/TabNavigation.tsx b/front/components/V2/TabNavigation.tsx index 935e3f7..bb7c30d 100644 --- a/front/components/V2/TabNavigation.tsx +++ b/front/components/V2/TabNavigation.tsx @@ -4,8 +4,6 @@ import TabNavigationDesktop from './TabNavigationDesktop'; import TabNavigationPhone from './TabNavigationPhone'; import { Ionicons } from '@expo/vector-icons'; import React, { useState } from 'react'; -import { useSelector } from 'react-redux'; -import { RootState } from '../../state/Store'; import useColorScheme from '../../hooks/colorScheme'; export type NaviTab = { diff --git a/front/components/V2/TabNavigationButton.tsx b/front/components/V2/TabNavigationButton.tsx index 3b37111..dcb217c 100644 --- a/front/components/V2/TabNavigationButton.tsx +++ b/front/components/V2/TabNavigationButton.tsx @@ -29,8 +29,9 @@ const TabNavigationButton = (props: TabNavigationButtonProps) => { alignItems: 'center', justifyContent: 'flex-start', padding: '10px', - borderRadius: '8px', + borderRadius: 8, flexGrow: 0, + // @ts-expect-error BoxShadow is not in the types but I want it this may be a legitimate error on my part boxShadow: (() => { if (isHovered) { return '0px 0px 16px 0px rgba(0, 0, 0, 0.25)'; diff --git a/front/components/V2/TabNavigationDesktop.tsx b/front/components/V2/TabNavigationDesktop.tsx index 85f5991..339f580 100644 --- a/front/components/V2/TabNavigationDesktop.tsx +++ b/front/components/V2/TabNavigationDesktop.tsx @@ -84,6 +84,7 @@ const TabNavigationDesktop = (props: TabNavigationDesktopProps) => { @@ -117,6 +118,7 @@ const TabNavigationDesktop = (props: TabNavigationDesktopProps) => { diff --git a/front/components/V2/TabNavigationList.tsx b/front/components/V2/TabNavigationList.tsx index 6b99f8e..28fbd87 100644 --- a/front/components/V2/TabNavigationList.tsx +++ b/front/components/V2/TabNavigationList.tsx @@ -15,6 +15,7 @@ const TabNavigationList = (props: TabNavigationListProps) => { alignItems: 'flex-start', alignSelf: 'stretch', flexDirection: 'column', + // @ts-expect-error gap is not in the types because we have an old version of react-native gap: '8px', }, props.style, diff --git a/front/components/V2/TabNavigationPhone.tsx b/front/components/V2/TabNavigationPhone.tsx index e3b3736..01d1902 100644 --- a/front/components/V2/TabNavigationPhone.tsx +++ b/front/components/V2/TabNavigationPhone.tsx @@ -35,7 +35,7 @@ const TabNavigationPhone = (props: TabNavigationPhoneProps) => { flexDirection: 'row', alignItems: 'center', alignSelf: 'stretch', - borderRadius: '8px', + borderRadius: 8, backgroundColor: 'rgba(16, 16, 20, 0.5)', }} > From 94875d4c7f7aceae0cf8ec59e15ff3cff53f3ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Tue, 19 Sep 2023 17:35:55 +0200 Subject: [PATCH 04/15] trying golden ratio --- front/components/V2/TabNavigation.tsx | 11 +- front/components/V2/TabNavigationDesktop.tsx | 8 +- front/components/V2/TabNavigationPhone.tsx | 8 +- front/views/V2/HomeView.tsx | 146 +++++++++++++++++++ 4 files changed, 165 insertions(+), 8 deletions(-) create mode 100644 front/views/V2/HomeView.tsx diff --git a/front/components/V2/TabNavigation.tsx b/front/components/V2/TabNavigation.tsx index bb7c30d..6a3c724 100644 --- a/front/components/V2/TabNavigation.tsx +++ b/front/components/V2/TabNavigation.tsx @@ -5,6 +5,7 @@ import TabNavigationPhone from './TabNavigationPhone'; import { Ionicons } from '@expo/vector-icons'; import React, { useState } from 'react'; import useColorScheme from '../../hooks/colorScheme'; +import HomeView from '../../views/V2/HomeView'; export type NaviTab = { id: string; @@ -62,6 +63,8 @@ const TabNavigation = () => { const [activeTab, setActiveTab] = useState(tabs[0]?.id ?? 'home'); const colorScheme = useColorScheme(); + const child = ; + const appTabs = tabs.map((t) => { return { ...t, @@ -90,7 +93,9 @@ const TabNavigation = () => { tabs={appTabs} activeTabID={activeTab} setActiveTabID={setActiveTab} - /> + > + {child} + ) : ( { setActiveTabID={setActiveTab} isCollapsed={isDesktopCollapsed} setIsCollapsed={setIsDesktopCollapsed} - /> + > + {child} + )} ); diff --git a/front/components/V2/TabNavigationDesktop.tsx b/front/components/V2/TabNavigationDesktop.tsx index 339f580..2fe80c7 100644 --- a/front/components/V2/TabNavigationDesktop.tsx +++ b/front/components/V2/TabNavigationDesktop.tsx @@ -12,6 +12,7 @@ type TabNavigationDesktopProps = { setIsCollapsed: (isCollapsed: boolean) => void; activeTabID: string; setActiveTabID: (id: string) => void; + children?: React.ReactNode; }; const TabNavigationDesktop = (props: TabNavigationDesktopProps) => { @@ -139,9 +140,10 @@ const TabNavigationDesktop = (props: TabNavigationDesktopProps) => { - - Main content page - + {props.children} ); }; diff --git a/front/components/V2/TabNavigationPhone.tsx b/front/components/V2/TabNavigationPhone.tsx index 01d1902..16485e1 100644 --- a/front/components/V2/TabNavigationPhone.tsx +++ b/front/components/V2/TabNavigationPhone.tsx @@ -7,6 +7,7 @@ type TabNavigationPhoneProps = { tabs: NaviTab[]; activeTabID: string; setActiveTabID: (id: string) => void; + children?: React.ReactNode; }; const TabNavigationPhone = (props: TabNavigationPhoneProps) => { @@ -54,9 +55,10 @@ const TabNavigationPhone = (props: TabNavigationPhoneProps) => { - - Main content page - + {props.children} ); }; diff --git a/front/views/V2/HomeView.tsx b/front/views/V2/HomeView.tsx new file mode 100644 index 0000000..c5441f8 --- /dev/null +++ b/front/views/V2/HomeView.tsx @@ -0,0 +1,146 @@ +import { View, Image } from 'react-native'; +import { Text } from 'native-base'; +import React from 'react'; + +const bigSideRatio = 100; +const smallSideRatio = 61; + +const HomeView = () => { + return ( + + + + + + + + + + + + + + + + + + + + More + + + + + + + + Footer + + + ); +}; + +export default HomeView; From 8e5c65e6f2e7af51da85e5764ca794514f156b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Wed, 20 Sep 2023 00:35:10 +0200 Subject: [PATCH 05/15] Added SongCardInfo for the V2 design and type fixes --- front/Navigation.tsx | 9 +- front/components/V2/HomeMainSongCard.tsx | 94 +++++++ front/components/V2/SongCardInfo.tsx | 259 +++++++++++++++++++ front/components/V2/TabNavigation.tsx | 32 ++- front/components/V2/TabNavigationDesktop.tsx | 14 +- front/components/V2/TabNavigationPhone.tsx | 14 +- front/views/HomeView.tsx | 6 + front/views/V2/HomeView.tsx | 148 ++++++----- 8 files changed, 503 insertions(+), 73 deletions(-) create mode 100644 front/components/V2/HomeMainSongCard.tsx create mode 100644 front/components/V2/SongCardInfo.tsx diff --git a/front/Navigation.tsx b/front/Navigation.tsx index 70107a6..2081c00 100644 --- a/front/Navigation.tsx +++ b/front/Navigation.tsx @@ -39,10 +39,15 @@ const removeMe = () => ''; const protectedRoutes = () => ({ Home: { - component: TabNavigation, - options: { title: translate('welcome'), headerShown: false }, + component: HomeView, + options: { title: translate('welcome'), headerLeft: null }, link: '/', }, + HomeNew: { + component: TabNavigation, + options: { headerShown: false }, + link: '/V2', + }, Play: { component: PlayView, options: { title: translate('play') }, link: '/play/:songId' }, Settings: { component: SetttingsNavigator, diff --git a/front/components/V2/HomeMainSongCard.tsx b/front/components/V2/HomeMainSongCard.tsx new file mode 100644 index 0000000..6b2fc51 --- /dev/null +++ b/front/components/V2/HomeMainSongCard.tsx @@ -0,0 +1,94 @@ +import { Image, View } from 'react-native'; +import { Text, Pressable, PresenceTransition } from 'native-base'; + +type HomeMainSongCardProps = { + image: string; + title: string; + artist: string; + onPress: () => void; +}; + +const HomeMainSongCard = (props: HomeMainSongCardProps) => { + // on hover darken the image and show the title and artist with fade in + return ( + + {({ isHovered }) => ( + + + + + + {props.title} + + + {props.artist} + + + + + )} + + ); +}; + +HomeMainSongCard.defaultProps = { + onPress: () => {}, +}; + +export default HomeMainSongCard; diff --git a/front/components/V2/SongCardInfo.tsx b/front/components/V2/SongCardInfo.tsx new file mode 100644 index 0000000..06cc507 --- /dev/null +++ b/front/components/V2/SongCardInfo.tsx @@ -0,0 +1,259 @@ +import Song from '../../models/Song'; +import React from 'react'; +import { Image, View } from 'react-native'; +import { Pressable, Text, PresenceTransition, Icon, Button } from 'native-base'; +import { Ionicons } from '@expo/vector-icons'; + +type SongCardInfoProps = { + song: Song; + onPress: () => void; + onPlay: () => void; +}; + +const CardDims = { + height: 200, + width: 200, +}; + +const Scores = [ + { + icon: 'warning', + score: 3, + }, + { + icon: 'star', + score: -225, + }, + { + icon: 'trophy', + score: 100, + }, +]; + +const SongCardInfo = (props: SongCardInfoProps) => { + const [isPlayHovered, setIsPlayHovered] = React.useState(false); + const [isHovered, setIsHovered] = React.useState(false); + const [isSlided, setIsSlided] = React.useState(false); + + return ( + + { + setIsHovered(true); + }} + onHoverOut={() => { + setIsHovered(false); + setIsSlided(false); + }} + > + <> + + + {Scores.map((score, idx) => ( + + + + {score.score} + + + ))} + + + { + if (isHovered) { + setIsSlided(true); + } + }} + > + + + + + + {props.song.name} + + + {props.song.artistId} + + + + + + + {/* icon bu=outon appear in the middle of the card after the first presencetransition is done */} + + +