Skip to content

Commit 4661fdc

Browse files
authored
Mobile: Player: Change slider color + add shadow to image (#1922)
1 parent 79a8a8c commit 4661fdc

4 files changed

Lines changed: 19 additions & 23 deletions

File tree

front/apps/mobile/src/components/illustration.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { animations } from "~/theme";
3434
type Props = {
3535
illustration: IllustrationModel | undefined | null;
3636
fallbackIcon?: IconType;
37-
dropShadow?: boolean;
37+
shadowStyle?: Pick<ViewStyle, "boxShadow">;
3838
quality: IllustrationQuality;
3939
normalizedThumbnail?: boolean;
4040
variant?: "fill" | "circle" | "center";
@@ -46,7 +46,7 @@ export const Illustration = ({
4646
fallbackIcon,
4747
quality,
4848
variant,
49-
dropShadow = false,
49+
shadowStyle,
5050
normalizedThumbnail,
5151
style,
5252
}: Props) => {
@@ -61,7 +61,6 @@ export const Illustration = ({
6161
[illustration],
6262
);
6363
styles.useVariants({
64-
hasShadow: dropShadow,
6564
imageType: innerAspectRatio > 1 ? "wide" : "tall",
6665
shape: variant === "circle" ? "circle" : undefined,
6766
align: variant === "center" ? "center" : "bottom",
@@ -92,7 +91,7 @@ export const Illustration = ({
9291
aspectRatio: innerAspectRatio,
9392
},
9493
styles.innerContainer,
95-
styles.shadow,
94+
shadowStyle,
9695
]}
9796
>
9897
{illustration && loadStatus !== "error" && (
@@ -186,16 +185,6 @@ const styles = StyleSheet.create((theme) => ({
186185
slotContent: {
187186
flex: 1,
188187
},
189-
shadow: {
190-
variants: {
191-
hasShadow: {
192-
true: {
193-
boxShadow: theme.illustrationShadow,
194-
},
195-
false: {},
196-
},
197-
},
198-
},
199188
fallbackContainer: {
200189
flex: 1,
201190
display: "flex",

front/apps/mobile/src/components/player/expanded/main.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { Illustration } from "~/components/illustration";
2929
import { LoadableText } from "~/components/loadable_text";
3030
import { usePickArtistModal } from "~/components/pick-artist";
3131
import * as Haptics from "~/haptics";
32-
import { useAccentColor } from "~/hooks/accent-color";
3332
import { Button } from "~/primitives/button";
3433
import { Icon } from "~/primitives/icon";
3534
import { Pressable } from "~/primitives/pressable";
@@ -113,7 +112,6 @@ const PlayControls = () => {
113112

114113
const ProgressControls = () => {
115114
const currentTrack = useAtomValue(currentTrackAtom);
116-
const accentColor = useAccentColor(currentTrack?.track.illustration);
117115
const progress = useAtomValue(progressAtom);
118116
const duration = useAtomValue(durationAtom);
119117
const { theme } = useUnistyles();
@@ -136,10 +134,8 @@ const ProgressControls = () => {
136134
/>
137135
</View>
138136
<Slider
139-
sliderColor={accentColor ?? theme.colors.text.primary}
140-
trackColor={
141-
accentColor ? `${accentColor}30` : theme.colors.skeleton
142-
}
137+
sliderColor={theme.colors.text.primary}
138+
trackColor={theme.colors.skeleton}
143139
/>
144140
</View>
145141
);
@@ -345,6 +341,7 @@ const IllustrationOrVideo = () => {
345341
return (
346342
<Illustration
347343
illustration={currentTrack?.track.illustration}
344+
shadowStyle={styles.illustrationShadow}
348345
quality="original"
349346
variant="center"
350347
/>
@@ -366,6 +363,12 @@ const styles = StyleSheet.create((theme, _rt) => ({
366363
maxHeight: "60%",
367364
maxWidth: breakpoints.sm,
368365
},
366+
illustrationShadow: {
367+
boxShadow:
368+
theme.name === "light"
369+
? `0px 0px 20px 0px grey`
370+
: `0px 0px 20px 0px #303030`,
371+
},
369372
illustration: {
370373
aspectRatio: 1,
371374
width: "100%",

front/apps/mobile/src/pages/release/header.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const Header = ({
7171
illustration={release?.illustration}
7272
quality="original"
7373
variant="center"
74-
dropShadow
74+
shadowStyle={styles.illustrationShadow}
7575
/>
7676
</View>
7777
</View>
@@ -261,6 +261,12 @@ const styles = StyleSheet.create((theme, _rt) => ({
261261
flex: { xs: undefined, [HalfHorizontalLayout]: 1 },
262262
width: { xs: "100%", [HalfHorizontalLayout]: undefined },
263263
},
264+
illustrationShadow: {
265+
boxShadow:
266+
theme.name === "light"
267+
? `0px 5px 15px 1px grey`
268+
: `0px 5px 15px 1px #212121`,
269+
},
264270
illustration: {
265271
width: { xs: "60%", [HalfHorizontalLayout]: "100%" },
266272
maxWidth: { xs: breakpoints.sm, [HalfHorizontalLayout]: undefined },

front/apps/mobile/src/theme/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ const baseTheme = {
6363
export const lightTheme = {
6464
name: "light" as const,
6565
...baseTheme,
66-
illustrationShadow: `0px 5px 15px 1px grey`,
6766
colors: {
6867
text: {
6968
primary: "#242120",
@@ -83,7 +82,6 @@ export const lightTheme = {
8382
export const darkTheme = {
8483
name: "dark" as const,
8584
...baseTheme,
86-
illustrationShadow: `0px 5px 15px 1px #212121`,
8785
colors: {
8886
text: {
8987
primary: "#ffffff",

0 commit comments

Comments
 (0)