Skip to content
This repository was archived by the owner on Jan 16, 2022. It is now read-only.

Commit 2bc49f3

Browse files
priscilawebdevjuanpicado
authored andcommitted
fix(162): added forwardRef Card (#216)
1 parent ade548a commit 2bc49f3

File tree

6 files changed

+15
-4
lines changed

6 files changed

+15
-4
lines changed

src/components/Dependencies/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import styled from 'react-emotion';
2-
import Card from '@material-ui/core/Card';
32
import Chip from '@material-ui/core/Chip';
43

54
import { fontWeight } from '../../utils/styles/sizes';
65
import Text from '../../muiComponents/Text';
6+
import Card from '../../muiComponents/Card';
77

88
export const CardWrap = styled(Card)({
99
'&&': {

src/components/DetailSidebar/DetailSidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { ReactElement } from 'react';
2-
import Card from '@material-ui/core/Card';
32
import CardContent from '@material-ui/core/CardContent';
43

54
import { ActionBar } from '../ActionBar/ActionBar';
@@ -11,6 +10,7 @@ import Install from '../Install';
1110
import Repository from '../Repository/Repository';
1211
import { DetailContext } from '../../pages/Version';
1312
import List from '../../muiComponents/List';
13+
import Card from '../../muiComponents/Card';
1414

1515
import { TitleListItem, TitleListItemText, PackageDescription, PackageVersion } from './styles';
1616

src/components/Help/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import Card from '@material-ui/core/Card';
21
import styled from 'react-emotion';
32

43
import { default as Typography } from '../../muiComponents/Heading';
4+
import Card from '../../muiComponents/Card';
55

66
export const CardStyled = styled(Card)({
77
'&&': {

src/components/NotFound/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { default as MuiCard } from '@material-ui/core/Card';
21
import styled from 'react-emotion';
32

43
import { default as Typography } from '../../muiComponents/Heading';
54
import List from '../../muiComponents/List';
5+
import { default as MuiCard } from '../../muiComponents/Card';
66

77
export const Wrapper = styled('div')({
88
display: 'flex',

src/muiComponents/Card/Card.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React, { forwardRef } from 'react';
2+
import { default as MaterialUICard, CardProps } from '@material-ui/core/Card';
3+
4+
type CardRef = HTMLDivElement;
5+
6+
const Card = forwardRef<CardRef, CardProps>(function Card(props, ref) {
7+
return <MaterialUICard {...props} ref={ref} />;
8+
});
9+
10+
export default Card;

src/muiComponents/Card/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './Card';

0 commit comments

Comments
 (0)