From 2bc49f3ab70c5479e0cf0f364a645c579eacdf0c Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Sat, 26 Oct 2019 08:44:25 +0200 Subject: [PATCH] fix(162): added forwardRef Card (#216) --- src/components/Dependencies/styles.ts | 2 +- src/components/DetailSidebar/DetailSidebar.tsx | 2 +- src/components/Help/styles.ts | 2 +- src/components/NotFound/styles.ts | 2 +- src/muiComponents/Card/Card.tsx | 10 ++++++++++ src/muiComponents/Card/index.ts | 1 + 6 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 src/muiComponents/Card/Card.tsx create mode 100644 src/muiComponents/Card/index.ts diff --git a/src/components/Dependencies/styles.ts b/src/components/Dependencies/styles.ts index 3dcea7c..edf371e 100644 --- a/src/components/Dependencies/styles.ts +++ b/src/components/Dependencies/styles.ts @@ -1,9 +1,9 @@ import styled from 'react-emotion'; -import Card from '@material-ui/core/Card'; import Chip from '@material-ui/core/Chip'; import { fontWeight } from '../../utils/styles/sizes'; import Text from '../../muiComponents/Text'; +import Card from '../../muiComponents/Card'; export const CardWrap = styled(Card)({ '&&': { diff --git a/src/components/DetailSidebar/DetailSidebar.tsx b/src/components/DetailSidebar/DetailSidebar.tsx index 6249b3f..13b875f 100644 --- a/src/components/DetailSidebar/DetailSidebar.tsx +++ b/src/components/DetailSidebar/DetailSidebar.tsx @@ -1,5 +1,4 @@ import React, { ReactElement } from 'react'; -import Card from '@material-ui/core/Card'; import CardContent from '@material-ui/core/CardContent'; import { ActionBar } from '../ActionBar/ActionBar'; @@ -11,6 +10,7 @@ import Install from '../Install'; import Repository from '../Repository/Repository'; import { DetailContext } from '../../pages/Version'; import List from '../../muiComponents/List'; +import Card from '../../muiComponents/Card'; import { TitleListItem, TitleListItemText, PackageDescription, PackageVersion } from './styles'; diff --git a/src/components/Help/styles.ts b/src/components/Help/styles.ts index f729686..c8cd753 100644 --- a/src/components/Help/styles.ts +++ b/src/components/Help/styles.ts @@ -1,7 +1,7 @@ -import Card from '@material-ui/core/Card'; import styled from 'react-emotion'; import { default as Typography } from '../../muiComponents/Heading'; +import Card from '../../muiComponents/Card'; export const CardStyled = styled(Card)({ '&&': { diff --git a/src/components/NotFound/styles.ts b/src/components/NotFound/styles.ts index f84d2c9..6c85990 100644 --- a/src/components/NotFound/styles.ts +++ b/src/components/NotFound/styles.ts @@ -1,8 +1,8 @@ -import { default as MuiCard } from '@material-ui/core/Card'; import styled from 'react-emotion'; import { default as Typography } from '../../muiComponents/Heading'; import List from '../../muiComponents/List'; +import { default as MuiCard } from '../../muiComponents/Card'; export const Wrapper = styled('div')({ display: 'flex', diff --git a/src/muiComponents/Card/Card.tsx b/src/muiComponents/Card/Card.tsx new file mode 100644 index 0000000..1b8aba6 --- /dev/null +++ b/src/muiComponents/Card/Card.tsx @@ -0,0 +1,10 @@ +import React, { forwardRef } from 'react'; +import { default as MaterialUICard, CardProps } from '@material-ui/core/Card'; + +type CardRef = HTMLDivElement; + +const Card = forwardRef(function Card(props, ref) { + return ; +}); + +export default Card; diff --git a/src/muiComponents/Card/index.ts b/src/muiComponents/Card/index.ts new file mode 100644 index 0000000..c68311d --- /dev/null +++ b/src/muiComponents/Card/index.ts @@ -0,0 +1 @@ +export { default } from './Card';