Skip to content

Commit 5af3693

Browse files
(chore)[]: resolve unit test issues (#2226)
* resolve jsx test failures * resolve dependency conflicts * Revert uneccessary package.json changes * revert unneccessary CodeBlock.tsx updates * revert whitespace changes
1 parent 180a622 commit 5af3693

4 files changed

Lines changed: 39 additions & 29 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public
6262
.DS_Store
6363

6464
# Yarn
65+
yarn.lock
6566
yarn-error.log
6667
.pnp/
6768
.pnp.js

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@
105105
"react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825": {
106106
"react": "^18.2.0"
107107
}
108+
},
109+
"resolutions": {
110+
"@types/react": "^18.2.0",
111+
"@types/react-dom": "^18.2.0"
108112
},
109113
"scripts": {
110114
"lint": "eslint 'src/**/*' 'lib/**/*' 'gatsby/**/*'",

src/components/ExternalLink.tsx

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import * as React from "react"
22

3-
import { styled } from '@mui/material/styles';
3+
import { styled } from "@mui/material/styles"
44

5-
import { Tooltip } from "@mui/material"
5+
import { Tooltip } from "@mui/material"
66

77
import { Launch } from "@mui/icons-material"
88
import clsx from "classnames"
9-
import {PropsWithChildren} from 'react';
9+
import { PropsWithChildren } from "react"
1010

11-
const PREFIX = 'ExternalLink';
11+
const PREFIX = "ExternalLink"
1212

1313
const classes = {
1414
link: `${PREFIX}-link`,
1515
icon: `${PREFIX}-icon`,
16-
hover: `${PREFIX}-hover`
17-
};
16+
hover: `${PREFIX}-hover`,
17+
}
1818

19-
const Root = styled('div')(() => ({
19+
const Root = styled("span")(() => ({
2020
[`& .${classes.link}`]: {
2121
display: "inline-flex",
2222
alignItems: "center",
@@ -32,36 +32,40 @@ const Root = styled('div')(() => ({
3232
opacity: 1.0,
3333
},
3434
opacity: 0.3,
35-
}
36-
}));
35+
},
36+
}))
3737

3838
type Props = {
3939
href: string
4040
title?: string
4141
hover?: true | undefined
4242
}
4343

44-
const ExternalLink: React.FC<PropsWithChildren<Props>> = ({ href, title, children, hover }) => {
45-
44+
const ExternalLink: React.FC<PropsWithChildren<Props>> = ({
45+
href,
46+
title,
47+
children,
48+
hover,
49+
}) => {
4650
return (
47-
<Root>
48-
<Tooltip title={title || ""}>
49-
<a
50-
className={clsx({ [classes.hover]: hover }, classes.link)}
51-
href={href}
52-
target="_blank"
53-
rel="noreferrer"
54-
>
55-
{children}
56-
<Launch
57-
className={clsx({ [classes.icon]: children !== undefined })}
58-
color="action"
59-
fontSize={children === undefined ? undefined : "inherit"}
60-
/>
61-
</a>
62-
</Tooltip>
63-
</Root>
64-
);
51+
<Root>
52+
<Tooltip title={title || ""}>
53+
<a
54+
className={clsx({ [classes.hover]: hover }, classes.link)}
55+
href={href}
56+
target="_blank"
57+
rel="noreferrer"
58+
>
59+
{children}
60+
<Launch
61+
className={clsx({ [classes.icon]: children !== undefined })}
62+
color="action"
63+
fontSize={children === undefined ? undefined : "inherit"}
64+
/>
65+
</a>
66+
</Tooltip>
67+
</Root>
68+
)
6569
}
6670

6771
export default ExternalLink

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
114114
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
115115
"baseUrl": "./src",
116+
"noEmit": true,
116117
"paths": {
117118
"@/*": ["./*"]
118119
}

0 commit comments

Comments
 (0)