Skip to content

Commit 4e84849

Browse files
author
Isaac Solo
authored
Fix flair positioning on mobile (#11952)
1 parent 7d18829 commit 4e84849

File tree

4 files changed

+14
-23
lines changed

4 files changed

+14
-23
lines changed

packages/harmony/src/assets/icons/ContestSign.svg

Lines changed: 1 addition & 2 deletions
Loading

packages/mobile/src/components/lineup-tile/LineupTileArt.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ export const LineupTileArt = (props: LineupTileArtProps) => {
3434
const styles = useStyles()
3535

3636
const imageElement = (
37-
<View style={[style, trackTileStyles.image]}>
38-
<View style={styles.imageRoot}>
39-
<View style={[trackTileStyles.image, styles.backdrop]} />
40-
<FadeInView style={styles.image} startOpacity={0} duration={500}>
41-
{renderImage({ style: trackTileStyles.image })}
42-
</FadeInView>
43-
</View>
37+
<View style={styles.imageRoot}>
38+
<View style={[trackTileStyles.image, styles.backdrop]} />
39+
<FadeInView style={styles.image} startOpacity={0} duration={500}>
40+
{renderImage({ style: trackTileStyles.image })}
41+
</FadeInView>
4442
</View>
4543
)
4644

packages/mobile/src/components/track-flair/TrackFlair.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ export const TrackFlair = ({ size, children, style, trackId }: CoSignProps) => {
8585

8686
const { size: iconSize, position } = layoutBySize[size]
8787

88-
if (!track) return <>{children}</>
89-
90-
const remixTrack = track.remix_of?.tracks[0]
88+
const remixTrack = track?.remix_of?.tracks[0]
9189
const hasRemixAuthorReposted = remixTrack?.has_remix_author_reposted ?? false
9290
const hasRemixAuthorSaved = remixTrack?.has_remix_author_saved ?? false
9391

@@ -100,9 +98,9 @@ export const TrackFlair = ({ size, children, style, trackId }: CoSignProps) => {
10098
) : null
10199

102100
return (
103-
<>
101+
<View style={style}>
104102
<View>{children}</View>
105-
<View style={[styles.check, position]}>{flair}</View>
106-
</>
103+
{flair ? <View style={[styles.check, position]}>{flair}</View> : null}
104+
</View>
107105
)
108106
}

packages/mobile/src/screens/track-screen/TrackScreenRemix.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const TrackScreenRemixComponent = ({
8787
const styles = useStyles()
8888
const { spacing, color } = useTheme()
8989

90-
const { _co_sign, track_id } = track
90+
const { track_id } = track
9191
const { name, handle } = user
9292
const navigation = useNavigation()
9393

@@ -138,13 +138,9 @@ const TrackScreenRemixComponent = ({
138138
return (
139139
<View style={[styles.root, style, stylesProp?.root]}>
140140
<Pressable onPress={handlePressTrack}>
141-
{_co_sign ? (
142-
<TrackFlair trackId={track_id} size={Size.MEDIUM} style={{ flex: 0 }}>
143-
{images}
144-
</TrackFlair>
145-
) : (
146-
images
147-
)}
141+
<TrackFlair trackId={track_id} size={Size.MEDIUM}>
142+
{images}
143+
</TrackFlair>
148144
</Pressable>
149145
<Pressable style={styles.artist} onPress={handlePressArtist}>
150146
<View style={styles.name}>

0 commit comments

Comments
 (0)