fix compile errors with SessionIcon

This commit is contained in:
Audric Ackermann 2021-05-31 14:11:20 +10:00
parent 5edfa530f2
commit 70e72cb92d
No known key found for this signature in database
GPG key ID: 999F434D76324AD4
2 changed files with 6 additions and 4 deletions

View file

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { icons, SessionIconSize, SessionIconType } from '../icon'; import { icons, SessionIconSize, SessionIconType } from '../icon';
import styled, { css, DefaultTheme, keyframes } from 'styled-components'; import styled, { css, DefaultTheme, keyframes } from 'styled-components';
import _ from 'lodash';
export type SessionIconProps = { export type SessionIconProps = {
iconType: SessionIconType; iconType: SessionIconType;
@ -51,7 +51,7 @@ const rotate = keyframes`
} }
`; `;
const animation = (props: any) => { const animation = (props: { rotateDuration?: any }) => {
if (props.rotateDuration) { if (props.rotateDuration) {
return css` return css`
${rotate} ${props.rotateDuration}s infinite linear; ${rotate} ${props.rotateDuration}s infinite linear;
@ -81,9 +81,10 @@ 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;
return ( return (
<Svg {...props}> <Svg {...propsToPick}>
{pathArray.map((path, index) => { {pathArray.map((path, index) => {
return <path key={index} fill={colorSvg} d={path} />; return <path key={index} fill={colorSvg} d={path} />;
})} })}

3
ts/window.d.ts vendored
View file

@ -1,3 +1,5 @@
import {} from 'styled-components/cssprop';
import { LocalizerType } from '../types/Util'; import { LocalizerType } from '../types/Util';
import { LibsignalProtocol } from '../../libtextsecure/libsignal-protocol'; import { LibsignalProtocol } from '../../libtextsecure/libsignal-protocol';
import { SignalInterface } from '../../js/modules/signal'; import { SignalInterface } from '../../js/modules/signal';
@ -5,7 +7,6 @@ import { Libloki } from '../libloki';
import { LibTextsecure } from '../libtextsecure'; import { LibTextsecure } from '../libtextsecure';
import { ConfirmationDialogParams } from '../background'; import { ConfirmationDialogParams } from '../background';
import {} from 'styled-components/cssprop';
import { ConversationControllerType } from '../js/ConversationController'; import { ConversationControllerType } from '../js/ConversationController';
import { any } from 'underscore'; import { any } from 'underscore';