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 */} + + +