fixed ts issues

This commit is contained in:
codebyalex 2019-07-14 16:12:21 -04:00
parent 2accbf02ed
commit 3d0790e28f
2 changed files with 7 additions and 7 deletions

View File

@ -87,6 +87,7 @@ interface ContentProps {
className?: string;
}
// @ts-ignore
const Content = styled(({ tests, className }: ContentProps) => (
<div className={className}>
{tests.map(({ name, result }) => {
@ -98,7 +99,6 @@ const Content = styled(({ tests, className }: ContentProps) => (
.length;
const failedNumber = result.assertionResults.length - successNumber;
const passingRate = ((successNumber / result.assertionResults.length) * 100).toFixed(2);
return (
<section key={name}>
<SuiteHead>
@ -108,7 +108,7 @@ const Content = styled(({ tests, className }: ContentProps) => (
</ProgressWrapper>
</SuiteHead>
<TabsState initial="failing-tests" backgroundColor="rgba(0,0,0,.05)">
<div id="failing-tests" title={`${failedNumber} Failed`} textColor="#FF4400">
<div id="failing-tests" title={`${failedNumber} Failed`} color="#FF4400">
<List>
{result.assertionResults.map(res => {
return res.status === 'failed' ? (
@ -119,7 +119,7 @@ const Content = styled(({ tests, className }: ContentProps) => (
})}
</List>
</div>
<div id="passing-tests" title={`${successNumber} Passed`} textColor="#66BF3C">
<div id="passing-tests" title={`${successNumber} Passed`} color="#66BF3C">
<List>
{result.assertionResults.map(res => {
return res.status === 'passed' ? (

View File

@ -110,13 +110,13 @@ export const panelProps = {
const childrenToList = (children: any, selected: string) =>
Children.toArray(children).map(
({ props: { title, id, textColor, children: childrenOfChild } }, index) => {
({ props: { title, id, color, children: childrenOfChild } }, index) => {
const content = Array.isArray(childrenOfChild) ? childrenOfChild[0] : childrenOfChild;
return {
active: selected ? id === selected : index === 0,
title,
id,
textColor,
color,
render:
typeof content === 'function'
? content
@ -159,12 +159,12 @@ export const Tabs = React.memo<TabsProps>(
<Wrapper absolute={absolute} bordered={bordered} id={htmlId}>
<FlexBar border backgroundColor={backgroundColor}>
<TabBar role="tablist">
{list.map(({ title, id, active, textColor }) => (
{list.map(({ title, id, active, color }) => (
<TabButton
type="button"
key={id}
active={active}
textColor={textColor}
textColor={color}
onClick={(e: MouseEvent) => {
e.preventDefault();
actions.onSelect(id);