Skip to content

Commit

Permalink
styled-components ts conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsongl committed Jul 19, 2019
1 parent 6d19a5a commit fab3996
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions x-pack/legacy/plugins/code/public/components/diff_page/diff.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,18 @@ const TopBarContainer = styled.div`
justify-content: space-between;
`;

const Accordion = styled(EuiAccordion)`
border: ${theme.euiBorderThick};
border-radius: ${theme.euiSizeS};
margin-bottom: ${theme.euiSize};
`;
// @types/styled-components@3.0.1 does not yet support `defaultProps`, which EuiAccordion uses
// Ref: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/31903
// const Accordion = styled(EuiAccordion)`
// border: ${theme.euiBorderThick};
// border-radius: ${theme.euiSizeS};
// margin-bottom: ${theme.euiSize};
// `;
const accordionStyles = {
border: theme.euiBorderThick,
borderRadius: theme.euiSizeS,
marginBottom: theme.euiSize,
};

const Icon = styled(EuiIcon)`
margin-right: ${theme.euiSizeS};
Expand Down Expand Up @@ -103,7 +110,8 @@ const onClick = (e: MouseEvent<HTMLDivElement>) => {
};

const Difference = (props: { fileDiff: FileDiff; repoUri: string; revision: string }) => (
<Accordion
<EuiAccordion
style={accordionStyles}
initialIsOpen={true}
id={props.fileDiff.path}
buttonContent={
Expand Down Expand Up @@ -135,7 +143,7 @@ const Difference = (props: { fileDiff: FileDiff; repoUri: string; revision: stri
language={props.fileDiff.language!}
renderSideBySide={true}
/>
</Accordion>
</EuiAccordion>
);

export class DiffPage extends React.Component<Props> {
Expand Down

0 comments on commit fab3996

Please sign in to comment.