Commit 2d26d672 authored by Max Alekseenko's avatar Max Alekseenko

remove padding on last element

parent 8ef0807c
...@@ -69,7 +69,7 @@ const PopoverContent = ({ appId, rating, userRating, rate, isSending, source }: ...@@ -69,7 +69,7 @@ const PopoverContent = ({ appId, rating, userRating, rate, isSending, source }:
onClickFactory={ handleRateFactory } onClickFactory={ handleRateFactory }
/> />
{ (filledIndex >= 0) && ( { (filledIndex >= 0) && (
<Text fontSize="md" ml={ 2 }> <Text fontSize="md" ml={ 3 }>
{ ratingDescriptions[filledIndex] } { ratingDescriptions[filledIndex] }
</Text> </Text>
) } ) }
......
...@@ -50,7 +50,7 @@ const Rating = ({ ...@@ -50,7 +50,7 @@ const Rating = ({
{ fullView && ( { fullView && (
<> <>
<Stars filledIndex={ (rating?.value || 0) - 1 }/> <Stars filledIndex={ (rating?.value || 0) - 1 }/>
<Text fontSize="md" ml={ 1 }>{ rating?.value }</Text> <Text fontSize="md" ml={ 2 }>{ rating?.value }</Text>
</> </>
) } ) }
<Box ref={ popoverRef }> <Box ref={ popoverRef }>
......
import { useColorModeValue } from '@chakra-ui/react'; import { Flex, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import type { MouseEventHandler } from 'react'; import type { MouseEventHandler } from 'react';
...@@ -15,7 +15,7 @@ const Stars = ({ filledIndex, onMouseOverFactory, onMouseOut, onClickFactory }: ...@@ -15,7 +15,7 @@ const Stars = ({ filledIndex, onMouseOverFactory, onMouseOut, onClickFactory }:
const disabledStarColor = useColorModeValue('gray.200', 'gray.700'); const disabledStarColor = useColorModeValue('gray.200', 'gray.700');
const outlineStartColor = onMouseOverFactory ? 'gray.400' : disabledStarColor; const outlineStartColor = onMouseOverFactory ? 'gray.400' : disabledStarColor;
return ( return (
<> <Flex>
{ Array(5).fill(null).map((_, index) => ( { Array(5).fill(null).map((_, index) => (
<IconSvg <IconSvg
key={ index } key={ index }
...@@ -24,13 +24,14 @@ const Stars = ({ filledIndex, onMouseOverFactory, onMouseOut, onClickFactory }: ...@@ -24,13 +24,14 @@ const Stars = ({ filledIndex, onMouseOverFactory, onMouseOut, onClickFactory }:
w={ 6 } // 5 + 1 padding w={ 6 } // 5 + 1 padding
h={ 5 } h={ 5 }
pr={ 1 } // use padding intead of margin so that there are no empty spaces between stars without hover effect pr={ 1 } // use padding intead of margin so that there are no empty spaces between stars without hover effect
_last={{ w: 5, pr: 0 }}
cursor={ onMouseOverFactory ? 'pointer' : 'default' } cursor={ onMouseOverFactory ? 'pointer' : 'default' }
onMouseOver={ onMouseOverFactory?.(index) } onMouseOver={ onMouseOverFactory?.(index) }
onMouseOut={ onMouseOut } onMouseOut={ onMouseOut }
onClick={ onClickFactory?.(index) } onClick={ onClickFactory?.(index) }
/> />
)) } )) }
</> </Flex>
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment