mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
fix SessionIcon viewbox being out of bounds
This commit is contained in:
parent
d6b7463f5f
commit
b87faa9291
1 changed files with 14 additions and 9 deletions
|
@ -35,13 +35,6 @@ const getIconDimensionFromIconSize = (iconSize: SessionIconSize | number) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
type StyledSvgProps = {
|
|
||||||
width: string | number;
|
|
||||||
height: string | number;
|
|
||||||
iconRotation: number;
|
|
||||||
rotateDuration?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
const rotate = keyframes`
|
const rotate = keyframes`
|
||||||
from {
|
from {
|
||||||
transform: rotate(0deg);
|
transform: rotate(0deg);
|
||||||
|
@ -61,11 +54,17 @@ const animation = (props: { rotateDuration?: any }) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type StyledSvgProps = {
|
||||||
|
width: string | number;
|
||||||
|
iconRotation: number;
|
||||||
|
rotateDuration?: number;
|
||||||
|
};
|
||||||
|
|
||||||
//tslint:disable no-unnecessary-callback-wrapper
|
//tslint:disable no-unnecessary-callback-wrapper
|
||||||
const Svg = styled.svg<StyledSvgProps>`
|
const Svg = styled.svg<StyledSvgProps>`
|
||||||
width: ${props => props.width};
|
width: ${props => props.width};
|
||||||
animation: ${props => animation(props)};
|
|
||||||
transform: ${props => `rotate(${props.iconRotation}deg)`};
|
transform: ${props => `rotate(${props.iconRotation}deg)`};
|
||||||
|
animation: ${props => animation(props)};
|
||||||
`;
|
`;
|
||||||
//tslint:enable no-unnecessary-callback-wrapper
|
//tslint:enable no-unnecessary-callback-wrapper
|
||||||
|
|
||||||
|
@ -81,7 +80,13 @@ const SessionSvg = (props: {
|
||||||
}) => {
|
}) => {
|
||||||
const colorSvg = props.iconColor || props?.theme?.colors.textColor;
|
const colorSvg = props.iconColor || props?.theme?.colors.textColor;
|
||||||
const pathArray = props.path instanceof Array ? props.path : [props.path];
|
const pathArray = props.path instanceof Array ? props.path : [props.path];
|
||||||
const propsToPick = _.pick(props, 'width', 'animation', 'transform') as any;
|
const propsToPick = {
|
||||||
|
width: props.width,
|
||||||
|
height: props.height,
|
||||||
|
rotateDuration: props.rotateDuration,
|
||||||
|
iconRotation: props.iconRotation,
|
||||||
|
viewBox: props.viewBox,
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Svg {...propsToPick}>
|
<Svg {...propsToPick}>
|
||||||
|
|
Loading…
Reference in a new issue