fix: spotify widget wrong size (#1579)
This commit is contained in:
@@ -25,11 +25,21 @@ export default class Spotify extends React.Component<Props> {
|
|||||||
render() {
|
render() {
|
||||||
const normalizedPath = this.pathname.replace(/^\/embed/, "/");
|
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 (
|
return (
|
||||||
<Frame
|
<Frame
|
||||||
{...this.props}
|
{...this.props}
|
||||||
width="300px"
|
width="100%"
|
||||||
height="380px"
|
height={`${height}px`}
|
||||||
src={`https://open.spotify.com/embed${normalizedPath}`}
|
src={`https://open.spotify.com/embed${normalizedPath}`}
|
||||||
title="Spotify Embed"
|
title="Spotify Embed"
|
||||||
allow="encrypted-media"
|
allow="encrypted-media"
|
||||||
|
|||||||
Reference in New Issue
Block a user