From bf09a25eb54ffaf580dc5facc674ad983cea5333 Mon Sep 17 00:00:00 2001 From: danis Date: Tue, 11 Jul 2023 10:06:55 +0200 Subject: [PATCH] linear gradient --- front/Theme.tsx | 6 ++++++ front/package.json | 5 +++-- front/views/ArtistDetailsView.tsx | 32 ++++++++++++++++++++++++++++--- front/views/GenreDetailsView.tsx | 8 +++++++- front/yarn.lock | 5 +++++ 5 files changed, 50 insertions(+), 6 deletions(-) diff --git a/front/Theme.tsx b/front/Theme.tsx index 6d7fc57..9c19074 100644 --- a/front/Theme.tsx +++ b/front/Theme.tsx @@ -4,9 +4,15 @@ import { useEffect } from 'react'; const ThemeProvider = ({ children }: { children: JSX.Element }) => { const colorScheme = useColorScheme(); + const config = { + dependencies: { + "linear-gradient": require("expo-linear-gradient").LinearGradient, + }, + }; return ( { return ( - + + + + {/* {artistData?.name} { height={isMobileView ? 200 : 300} width={'100%'} resizeMode='cover' - /> + /> */} {artistData?.name} @@ -144,7 +170,7 @@ const ArtistDetailsView = ({ artistId }: any) => { } - + {/* */} ); }; diff --git a/front/views/GenreDetailsView.tsx b/front/views/GenreDetailsView.tsx index ba4f42c..53700bf 100644 --- a/front/views/GenreDetailsView.tsx +++ b/front/views/GenreDetailsView.tsx @@ -124,7 +124,13 @@ const GenreDetailsView = ({ genreId }: any) => { size={'100%'} height={isMobileView ? 200 : 300} width={'100%'} - backgroundColor={colorRange[Math.floor(Math.random() * 5)]?.code ?? '#364fc7'} + // backgroundColor={colorRange[Math.floor(Math.random() * 5)]?.code ?? '#364fc7'} + bg={{ + linearGradient: { + colors: [colorRange[Math.floor(Math.random() * 5)]?.code ?? '#364fc7', 'black'], + start: [0, 0], + end: [0, 1], + },}} />