Rework repost icon to match line widths

zio/stable
Paul Frazee 2023-01-17 13:17:38 -06:00
parent 798622b307
commit e3e2831d11
2 changed files with 30 additions and 4 deletions

View File

@ -11,7 +11,12 @@ import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
import ReactNativeHapticFeedback from 'react-native-haptic-feedback' import ReactNativeHapticFeedback from 'react-native-haptic-feedback'
import {Text} from './text/Text' import {Text} from './text/Text'
import {PostDropdownBtn} from './forms/DropdownButton' import {PostDropdownBtn} from './forms/DropdownButton'
import {HeartIcon, HeartIconSolid, CommentBottomArrow} from '../../lib/icons' import {
HeartIcon,
HeartIconSolid,
RepostIcon,
CommentBottomArrow,
} from '../../lib/icons'
import {s, colors} from '../../lib/styles' import {s, colors} from '../../lib/styles'
import {useTheme} from '../../lib/ThemeContext' import {useTheme} from '../../lib/ThemeContext'
import {useAnimatedValue} from '../../lib/hooks/useAnimatedValue' import {useAnimatedValue} from '../../lib/hooks/useAnimatedValue'
@ -143,12 +148,12 @@ export function PostCtrls(opts: PostCtrlsOpts) {
onPress={onPressToggleRepostWrapper} onPress={onPressToggleRepostWrapper}
style={styles.ctrl}> style={styles.ctrl}>
<Animated.View style={anim1Style}> <Animated.View style={anim1Style}>
<FontAwesomeIcon <RepostIcon
style={ style={
opts.isReposted ? styles.ctrlIconReposted : defaultCtrlColor opts.isReposted ? styles.ctrlIconReposted : defaultCtrlColor
} }
icon="retweet" strokeWidth={2.4}
size={opts.big ? 22 : 19} size={opts.big ? 24 : 20}
/> />
</Animated.View> </Animated.View>
{typeof opts.repostCount !== 'undefined' ? ( {typeof opts.repostCount !== 'undefined' ? (

View File

@ -225,6 +225,27 @@ export function UserGroupIcon({
) )
} }
export function RepostIcon({
style,
size = 24,
strokeWidth = 1.5,
}: {
style?: StyleProp<ViewStyle>
size?: string | number
strokeWidth: number
}) {
return (
<Svg viewBox="0 0 24 24" width={size} height={size} style={style}>
<Path
stroke="currentColor"
strokeWidth={strokeWidth}
strokeLinejoin="round"
d="M 14.437 17.362 L 5.475 17.376 C 4.7 17.376 4.072 16.748 4.072 15.973 L 4.082 5.65 L 1.375 9.315 M 4.082 5.65 L 6.749 9.315 M 9.859 5.65 L 18.625 5.654 C 19.4 5.654 20.028 6.282 20.028 7.057 L 20.031 17.362 L 17.238 13.409 M 20.031 17.362 L 22.763 13.409"
/>
</Svg>
)
}
// Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. // Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.
export function HeartIcon({ export function HeartIcon({
style, style,