Skip to content

Commit

Permalink
Address divider issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjeffers committed Dec 10, 2024
1 parent 053d1fe commit df9020b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 36 deletions.
15 changes: 7 additions & 8 deletions packages/mobile/src/components/skeletons/EntitySkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { useMemo, type ReactNode } from 'react'
import { times, random } from 'lodash'
import { View } from 'react-native'

import { Tile, Text, Divider } from 'app/components/core'
import { Divider } from '@audius/harmony-native'
import { Tile, Text } from 'app/components/core'
import Skeleton, { StaticSkeleton } from 'app/components/skeleton/Skeleton'
import { makeStyles } from 'app/styles'

Expand Down Expand Up @@ -59,10 +60,6 @@ const useStyles = makeStyles(({ spacing, palette }) => ({
height: 25,
marginHorizontal: spacing(4)
},
divider: {
width: '100%',
marginVertical: spacing(2)
},
metrics: {
width: '100%',
flexDirection: 'row',
Expand Down Expand Up @@ -111,6 +108,8 @@ export const EntitySkeleton = (props: EntitySkeletonProps) => {
[]
)

const divider = <Divider w='100%' mv='s' />

return (
<Tile styles={{ root: styles.root, content: styles.content }}>
<View style={styles.heading}>
Expand All @@ -133,7 +132,7 @@ export const EntitySkeleton = (props: EntitySkeletonProps) => {
<StaticSkeleton style={styles.socialAction} />
<StaticSkeleton style={styles.socialAction} />
</View>
<Divider style={styles.divider} />
{divider}
<View style={styles.metrics}>
<StaticSkeleton style={styles.metric} />
<StaticSkeleton style={styles.metric} />
Expand All @@ -147,15 +146,15 @@ export const EntitySkeleton = (props: EntitySkeletonProps) => {
/>
))}
</View>
<Divider style={styles.divider} />
{divider}
<View style={styles.metadataSection}>
<StaticSkeleton style={styles.metadata} />
<StaticSkeleton style={styles.metadata} />
<StaticSkeleton style={styles.metadata} />
</View>
{children ? (
<>
<Divider style={styles.divider} />
{divider}
{children}
</>
) : null}
Expand Down
14 changes: 3 additions & 11 deletions packages/mobile/src/screens/collection-screen/CollectionScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ import { encodeUrlName, removeNullable } from '@audius/common/utils'
import type { Nullable } from '@audius/common/utils'
import { useDispatch, useSelector } from 'react-redux'

import type { ImageProps } from '@audius/harmony-native'
import { Divider, type ImageProps } from '@audius/harmony-native'
import {
ScreenContent,
Screen,
VirtualizedScrollView,
Divider
VirtualizedScrollView
} from 'app/components/core'
import { ScreenSecondaryContent } from 'app/components/core/Screen/ScreenSecondaryContent'
import { CollectionImage } from 'app/components/image/CollectionImage'
Expand All @@ -48,7 +47,6 @@ import { useRoute } from 'app/hooks/useRoute'
import { setVisibility } from 'app/store/drawers/slice'
import { getIsCollectionMarkedForDownload } from 'app/store/offline-downloads/selectors'
import { makeStyles } from 'app/styles'
import { useThemePalette } from 'app/utils/theme'

import { CollectionScreenDetailsTile } from './CollectionScreenDetailsTile'
import { CollectionScreenSkeleton } from './CollectionScreenSkeleton'
Expand All @@ -69,10 +67,6 @@ const getUserId = accountSelectors.getUserId
const useStyles = makeStyles(({ spacing }) => ({
root: {
padding: spacing(3)
},
divider: {
marginTop: spacing(2),
marginBottom: spacing(8)
}
}))

Expand Down Expand Up @@ -136,8 +130,6 @@ const CollectionScreenComponent = (props: CollectionScreenComponentProps) => {
const { onOpen: openEarlyReleaseConfirmation } =
useEarlyReleaseConfirmationModal()

const { neutralLight5 } = useThemePalette()

const releaseDate =
'release_date' in collection ? collection.release_date : created_at
const url = useMemo(() => {
Expand Down Expand Up @@ -315,7 +307,7 @@ const CollectionScreenComponent = (props: CollectionScreenComponentProps) => {
/>
{isOwner && !is_album && !ddex_app ? (
<ScreenSecondaryContent>
<Divider style={styles.divider} color={neutralLight5} />
<Divider mt='s' mb='2xl' />
<SuggestedTracks collectionId={playlist_id} />
</ScreenSecondaryContent>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { cacheUsersActions } from '@audius/common/store'
import { View, Animated } from 'react-native'
import { useDispatch } from 'react-redux'

import { Divider } from 'app/components/core'
import { Divider } from '@audius/harmony-native'
import { makeStyles } from 'app/styles'
import { spacing } from 'app/styles/spacing'

import { useSelectProfile } from '../selectors'

Expand All @@ -31,9 +30,6 @@ const useStyles = makeStyles(({ spacing }) => ({
},
socialsCentered: {
justifyContent: 'center'
},
divider: {
marginVertical: spacing(1)
}
}))

Expand Down Expand Up @@ -106,10 +102,8 @@ export const ProfileSocials = () => {
{index === socialLinks.length - 1 ? null : (
<Divider
orientation='vertical'
style={[
styles.divider,
{ marginHorizontal: spacing(socialsCount === 2 ? 6 : 4) }
]}
mv='xs'
mh={socialsCount === 2 ? 's' : 'xs'}
/>
)}
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { useDispatch, useSelector } from 'react-redux'
import type { IconComponent } from '@audius/harmony-native'
import {
Box,
Divider,
Flex,
FollowButton,
IconNote,
Expand All @@ -30,7 +31,6 @@ import {
useTheme
} from '@audius/harmony-native'
import {
Divider,
ProfilePicture,
UserCoverPhoto,
UserDisplayName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { tokenDashboardPageSelectors } from '@audius/common/store'
import { FlatList, View } from 'react-native'
import { useSelector } from 'react-redux'

import { Flex, Text } from '@audius/harmony-native'
import { Divider } from 'app/components/core'
import { Divider, Flex, Text } from '@audius/harmony-native'
import LoadingSpinner from 'app/components/loading-spinner'
import { makeStyles } from 'app/styles'

Expand Down Expand Up @@ -37,9 +36,6 @@ const useStyles = makeStyles(({ spacing }) => ({
},
gap: {
flex: 2
},
divider: {
marginVertical: spacing(3)
}
}))

Expand Down Expand Up @@ -106,7 +102,7 @@ export const LinkedWallets = () => {
</Text>
<View style={styles.gap} />
</View>
<Divider style={styles.divider} />
<Divider mv='m' />
{loadingStatus === Status.SUCCESS ? (
<FlatList
renderItem={({ item }) => (
Expand All @@ -120,7 +116,7 @@ export const LinkedWallets = () => {
/>
)}
data={wallets}
ItemSeparatorComponent={() => <Divider style={styles.divider} />}
ItemSeparatorComponent={() => <Divider mv='m' />}
/>
) : loadingStatus === Status.IDLE || loadingStatus === Status.LOADING ? (
<Flex alignSelf='center'>
Expand Down

0 comments on commit df9020b

Please sign in to comment.