mirror of
https://github.com/SomboChea/ui
synced 2026-01-19 01:25:51 +07:00
fix: typography Component - Introduced ForwardRef (#179)
* refactor: introduced forwardref * refacttor: updated ref's * fix: fixed func's name * fix: fixed snapshots * fix: updated snap
This commit is contained in:
committed by
Juan Picado @jotadeveloper
parent
82d7107de7
commit
a8deeb9b9d
@@ -6,7 +6,7 @@ import NoItems from '../NoItems';
|
||||
import { formatDateDistance } from '../../utils/package';
|
||||
import ListItem from '../../muiComponents/ListItem';
|
||||
|
||||
import { Heading, Spacer, ListItemText } from './styles';
|
||||
import { StyledText, Spacer, ListItemText } from './styles';
|
||||
|
||||
const UpLinks: React.FC = () => {
|
||||
const { packageMeta } = useContext(DetailContext);
|
||||
@@ -23,7 +23,7 @@ const UpLinks: React.FC = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Heading variant="subtitle1">{'Uplinks'}</Heading>
|
||||
<StyledText variant="subtitle1">{'Uplinks'}</StyledText>
|
||||
<List>
|
||||
{Object.keys(uplinks)
|
||||
.reverse()
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
exports[`<UpLinks /> component should render the component in default state 1`] = `null`;
|
||||
|
||||
exports[`<UpLinks /> component should render the component with uplinks 1`] = `"<h6 class=\\"MuiTypography-root css-1ikpjfo e14i1sy10 MuiTypography-subtitle1\\">Uplinks</h6><ul class=\\"MuiList-root MuiList-padding\\"><li class=\\"MuiListItem-root MuiListItem-gutters\\"><div class=\\"MuiListItemText-root css-5tz9yo e14i1sy12\\"><span class=\\"MuiTypography-root MuiListItemText-primary MuiTypography-body1\\">npmjs</span></div><div class=\\"css-1l1cv61 e14i1sy11\\"></div><div class=\\"MuiListItemText-root css-5tz9yo e14i1sy12\\"><span class=\\"MuiTypography-root MuiListItemText-primary MuiTypography-body1\\">over 1 year ago</span></div></li></ul>"`;
|
||||
exports[`<UpLinks /> component should render the component with uplinks 1`] = `"<h6 class=\\"MuiTypography-root css-1vg6q84 e14i1sy10 MuiTypography-subtitle1\\">Uplinks</h6><ul class=\\"MuiList-root MuiList-padding\\"><li class=\\"MuiListItem-root MuiListItem-gutters\\"><div class=\\"MuiListItemText-root css-5tz9yo e14i1sy12\\"><span class=\\"MuiTypography-root MuiListItemText-primary MuiTypography-body1\\">npmjs</span></div><div class=\\"css-1l1cv61 e14i1sy11\\"></div><div class=\\"MuiListItemText-root css-5tz9yo e14i1sy12\\"><span class=\\"MuiTypography-root MuiListItemText-primary MuiTypography-body1\\">over 1 year ago</span></div></li></ul>"`;
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import styled from 'react-emotion';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import { default as MuiListItemText } from '@material-ui/core/ListItemText';
|
||||
|
||||
import Text from '../../muiComponents/Text';
|
||||
import { fontWeight } from '../../utils/styles/sizes';
|
||||
|
||||
export const Heading = styled(Typography)({
|
||||
'&&': {
|
||||
fontWeight: fontWeight.bold,
|
||||
},
|
||||
export const StyledText = styled(Text)({
|
||||
fontWeight: fontWeight.bold,
|
||||
});
|
||||
|
||||
export const Spacer = styled('div')({
|
||||
|
||||
Reference in New Issue
Block a user