Skip to content

Commit

Permalink
LUN-132: fix shadow and alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
f1sh1918 committed Jun 7, 2022
1 parent 09b44c8 commit 5d1959c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
14 changes: 4 additions & 10 deletions src/components/FavoriteButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ import useLoadAsync from '../hooks/useLoadAsync'
import AsyncStorage from '../services/AsyncStorage'
import { reportError } from '../services/sentry'

const Container = styled.View`
padding: ${props => `${props.theme.spacings.xs} 0 ${props.theme.spacings.xs} ${props.theme.spacings.sm}`};
align-self: center;
`

const Icon = styled(StarCircleIconGreyFilled)`
min-width: ${wp('9%')}px;
min-height: ${wp('9%')}px;
Expand All @@ -25,6 +20,7 @@ const IconOutline = styled(StarCircleIconGrey)`
const Button = styled.TouchableOpacity`
justify-content: center;
align-items: center;
shadow-color: ${props => props.theme.colors.shadow};
shadow-radius: 5px;
shadow-offset: 1px 1px;
shadow-opacity: 0.5;
Expand Down Expand Up @@ -57,11 +53,9 @@ const FavoriteButton = ({ document, onFavoritesChanged }: Props): ReactElement |
}

return (
<Container>
<Button testID={isFavorite ? 'remove' : 'add'} onPress={onPress}>
{isFavorite ? <Icon /> : <IconOutline />}
</Button>
</Container>
<Button testID={isFavorite ? 'remove' : 'add'} onPress={onPress}>
{isFavorite ? <Icon /> : <IconOutline />}
</Button>
)
}

Expand Down
9 changes: 8 additions & 1 deletion src/components/VocabularyListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const RightChildrenContainer = styled.View`
justify-content: space-between;
`

const FavButtonContainer = styled.View`
padding: ${props => `0 ${props.theme.spacings.xs} 0 ${props.theme.spacings.sm}`};
align-self: center;
`

interface VocabularyListItemProps {
document: Document
onPress: () => void
Expand All @@ -54,7 +59,9 @@ const VocabularyListItem = ({ document, onPress, onFavoritesChanged }: Vocabular
rightChildren={
<RightChildrenContainer>
<AudioPlayer document={document} disabled={false} />
<FavoriteButton document={document} onFavoritesChanged={onFavoritesChanged} />
<FavButtonContainer>
<FavoriteButton document={document} onFavoritesChanged={onFavoritesChanged} />
</FavButtonContainer>
</RightChildrenContainer>
}
/>
Expand Down

0 comments on commit 5d1959c

Please sign in to comment.