1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-17 08:35:47 +07:00

fix: introduced forwardRef (#163)

This commit is contained in:
Priscila Oliveira
2019-10-06 18:30:05 +02:00
committed by Juan Picado @jotadeveloper
parent 909a8d9fb8
commit 626bcce5cb
13 changed files with 105 additions and 71 deletions

View File

@@ -1,13 +1,14 @@
import React, { FC, useContext } from 'react';
import Avatar from '@material-ui/core/Avatar';
import List from '@material-ui/core/List';
import { DetailContext } from '../../pages/Version';
import { Heading, AuthorListItem, AuthorListItemText } from './styles';
import { isEmail } from '../../utils/url';
const Authors: FC = () => {
import Avatar from '../../muiComponents/Avatar';
const Author: FC = () => {
const { packageMeta } = useContext(DetailContext);
if (!packageMeta) {
@@ -41,4 +42,4 @@ const Authors: FC = () => {
);
};
export default Authors;
export default Author;

View File

@@ -1,9 +1,9 @@
import React, { FC } from 'react';
import Avatar from '@material-ui/core/Avatar';
import { isEmail } from '../../utils/url';
import Tooltip from '../../muiComponents/Tooltip';
import Avatar from '../../muiComponents/Avatar';
export interface AvatarDeveloper {
name: string;

View File

@@ -107,25 +107,29 @@ exports[`test Developers should render the component for contributors with items
target="_top"
title="dmethvin"
>
<WithStyles(ForwardRef(Avatar))
<ForwardRef(Avatar)
aria-label="dmethvin"
>
<ForwardRef(Avatar)
<WithStyles(ForwardRef(Avatar))
aria-label="dmethvin"
classes={
Object {
"colorDefault": "MuiAvatar-colorDefault",
"img": "MuiAvatar-img",
"root": "MuiAvatar-root",
}
}
>
<div
<ForwardRef(Avatar)
aria-label="dmethvin"
className="MuiAvatar-root MuiAvatar-colorDefault"
/>
</ForwardRef(Avatar)>
</WithStyles(ForwardRef(Avatar))>
classes={
Object {
"colorDefault": "MuiAvatar-colorDefault",
"img": "MuiAvatar-img",
"root": "MuiAvatar-root",
}
}
>
<div
aria-label="dmethvin"
className="MuiAvatar-root MuiAvatar-colorDefault"
/>
</ForwardRef(Avatar)>
</WithStyles(ForwardRef(Avatar))>
</ForwardRef(Avatar)>
</a>
<ForwardRef(Popper)
anchorEl={
@@ -199,25 +203,29 @@ exports[`test Developers should render the component for contributors with items
target="_top"
title="mgol"
>
<WithStyles(ForwardRef(Avatar))
<ForwardRef(Avatar)
aria-label="mgol"
>
<ForwardRef(Avatar)
<WithStyles(ForwardRef(Avatar))
aria-label="mgol"
classes={
Object {
"colorDefault": "MuiAvatar-colorDefault",
"img": "MuiAvatar-img",
"root": "MuiAvatar-root",
}
}
>
<div
<ForwardRef(Avatar)
aria-label="mgol"
className="MuiAvatar-root MuiAvatar-colorDefault"
/>
</ForwardRef(Avatar)>
</WithStyles(ForwardRef(Avatar))>
classes={
Object {
"colorDefault": "MuiAvatar-colorDefault",
"img": "MuiAvatar-img",
"root": "MuiAvatar-root",
}
}
>
<div
aria-label="mgol"
className="MuiAvatar-root MuiAvatar-colorDefault"
/>
</ForwardRef(Avatar)>
</WithStyles(ForwardRef(Avatar))>
</ForwardRef(Avatar)>
</a>
<ForwardRef(Popper)
anchorEl={
@@ -357,25 +365,29 @@ exports[`test Developers should render the component for maintainers with items
target="_top"
title="dmethvin"
>
<WithStyles(ForwardRef(Avatar))
<ForwardRef(Avatar)
aria-label="dmethvin"
>
<ForwardRef(Avatar)
<WithStyles(ForwardRef(Avatar))
aria-label="dmethvin"
classes={
Object {
"colorDefault": "MuiAvatar-colorDefault",
"img": "MuiAvatar-img",
"root": "MuiAvatar-root",
}
}
>
<div
<ForwardRef(Avatar)
aria-label="dmethvin"
className="MuiAvatar-root MuiAvatar-colorDefault"
/>
</ForwardRef(Avatar)>
</WithStyles(ForwardRef(Avatar))>
classes={
Object {
"colorDefault": "MuiAvatar-colorDefault",
"img": "MuiAvatar-img",
"root": "MuiAvatar-root",
}
}
>
<div
aria-label="dmethvin"
className="MuiAvatar-root MuiAvatar-colorDefault"
/>
</ForwardRef(Avatar)>
</WithStyles(ForwardRef(Avatar))>
</ForwardRef(Avatar)>
</a>
<ForwardRef(Popper)
anchorEl={
@@ -449,25 +461,29 @@ exports[`test Developers should render the component for maintainers with items
target="_top"
title="mgol"
>
<WithStyles(ForwardRef(Avatar))
<ForwardRef(Avatar)
aria-label="mgol"
>
<ForwardRef(Avatar)
<WithStyles(ForwardRef(Avatar))
aria-label="mgol"
classes={
Object {
"colorDefault": "MuiAvatar-colorDefault",
"img": "MuiAvatar-img",
"root": "MuiAvatar-root",
}
}
>
<div
<ForwardRef(Avatar)
aria-label="mgol"
className="MuiAvatar-root MuiAvatar-colorDefault"
/>
</ForwardRef(Avatar)>
</WithStyles(ForwardRef(Avatar))>
classes={
Object {
"colorDefault": "MuiAvatar-colorDefault",
"img": "MuiAvatar-img",
"root": "MuiAvatar-root",
}
}
>
<div
aria-label="mgol"
className="MuiAvatar-root MuiAvatar-colorDefault"
/>
</ForwardRef(Avatar)>
</WithStyles(ForwardRef(Avatar))>
</ForwardRef(Avatar)>
</a>
<ForwardRef(Popper)
anchorEl={

View File

@@ -1,12 +1,14 @@
import React, { Component, ReactElement } from 'react';
import Avatar from '@material-ui/core/Avatar';
import Grid from '@material-ui/core/Grid';
import List from '@material-ui/core/List';
import ListItemText from '@material-ui/core/ListItemText';
import { VersionPageConsumerProps, DetailContextConsumer } from '../../pages/Version';
import { Heading, EngineListItem } from './styles';
import Avatar from '../../muiComponents/Avatar';
// @ts-ignore
import node from './img/node.png';
import npm from '../Install/img/npm.svg';

View File

@@ -1,10 +1,10 @@
import React from 'react';
import styled from 'react-emotion';
import Avatar from '@material-ui/core/Avatar';
import ListItem from '@material-ui/core/ListItem';
import ListItemText from '@material-ui/core/ListItemText';
import CopyToClipBoard from '../CopyToClipBoard';
import Avatar from '../../muiComponents/Avatar';
// logos of package managers
import npmLogo from './img/npm.svg';

View File

@@ -4,7 +4,6 @@ import { Link } from 'react-router-dom';
import Grid from '@material-ui/core/Grid';
import List from '@material-ui/core/List';
import ListItemText from '@material-ui/core/ListItemText';
import Photo from '@material-ui/core/Avatar';
import Typography from '@material-ui/core/Typography';
import { breakpoints } from '../../utils/styles/media';
@@ -13,6 +12,7 @@ import Label from '../Label';
import colors from '../../utils/styles/colors';
import { fontWeight } from '../../utils/styles/sizes';
import { default as MuiIconButton } from '../../muiComponents/IconButton';
import { default as Photo } from '../../muiComponents/Avatar';
export const OverviewItem = styled('span')`
&& {

View File

@@ -1,7 +1,6 @@
/* eslint react/jsx-max-depth: 0 */
import React, { Component, Fragment, ReactElement } from 'react';
import Avatar from '@material-ui/core/Avatar';
import List from '@material-ui/core/List';
import { DetailContextConsumer } from '../../pages/Version';
@@ -12,6 +11,8 @@ import { Heading, GithubLink, RepositoryListItem, RepositoryListItemText } from
import git from './img/git.png';
import { isURL } from '../../utils/url';
import Avatar from '../../muiComponents/Avatar';
class Repository extends Component {
public render(): ReactElement<HTMLElement> {
return (