fix: spotify widget wrong size (#1579)

This commit is contained in:
Yohann Leon authored and GitHub committed 2020-10-09 19:02:09 -07:00
1 parent 9c8f125668
commit a6dc708fc0
1 file changed
+12 -2
+12 -2
View File
@@ -25,11 +25,21 @@ export default class Spotify extends React.Component<Props> {
render() {
const normalizedPath = this.pathname.replace(/^\/embed/, "/");
var height;
if (normalizedPath.includes("episode") || normalizedPath.includes("show")) {
height = 232;
} else if (normalizedPath.includes("track")) {
height = 80;
} else {
height = 380;
}
return (
<Frame
{...this.props}
width="300px"
height="380px"
width="100%"
height={`${height}px`}
src={`https://open.spotify.com/embed${normalizedPath}`}
title="Spotify Embed"
allow="encrypted-media"