From 52f2c94fb7d365583c196cb00f7af6fb43863dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Mon, 15 Jan 2024 01:12:05 +0100 Subject: [PATCH] We can now see MusicItem IconButtons on Android (Play & Likes) --- front/components/UI/MusicItem.tsx | 74 +++++++++++++++++++------------ 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/front/components/UI/MusicItem.tsx b/front/components/UI/MusicItem.tsx index 6964387..ef24c1f 100644 --- a/front/components/UI/MusicItem.tsx +++ b/front/components/UI/MusicItem.tsx @@ -1,9 +1,18 @@ /* eslint-disable react/prop-types */ import React, { useMemo, memo } from 'react'; import { StyleSheet, ViewStyle, Image } from 'react-native'; -import { Column, HStack, Row, Stack, Text, useBreakpointValue, useTheme } from 'native-base'; +import { + Column, + HStack, + Row, + Stack, + Text, + useBreakpointValue, + useTheme, + IconButton, +} from 'native-base'; import { HeartAdd, HeartRemove, Play } from 'iconsax-react-native'; -import IconButton from './IconButton'; +// import IconButton from './IconButton'; import Spacer from '../../components/UI/Spacer'; import { useTranslation } from 'react-i18next'; @@ -103,18 +112,15 @@ function MusicItemComponent(props: MusicItemType) { backgroundColor: colors.coolGray[500], paddingRight: screenSize === 'small' ? 8 : 16, }, - playButtonContainer: { + playButton: { + backgroundColor: colors.primary[300], + borderRadius: 999, zIndex: 1, position: 'absolute', right: -8, bottom: -6, }, - playButton: { - backgroundColor: colors.primary[300], - borderRadius: 999, - }, image: { - position: 'relative', width: screenSize === 'xl' ? 80 : 60, height: screenSize === 'xl' ? 80 : 60, }, @@ -124,6 +130,10 @@ function MusicItemComponent(props: MusicItemType) { }, songContainer: { width: '100%', + display: 'flex', + flexDirection: 'row', + gap: 2, + alignItems: 'center', }, stats: { display: 'flex', @@ -144,34 +154,40 @@ function MusicItemComponent(props: MusicItemType) { return ( - + } + /> - + {props.artist} {screenSize === 'xl' && } - - {props.song} + + {props.song} + ) : ( + + ) + } + onPress={() => { + props.onLike(!props.liked); + }} />