feat: Add Valtown embed support
This commit is contained in:
19
shared/editor/embeds/Valtown.tsx
Normal file
19
shared/editor/embeds/Valtown.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import * as React from "react";
|
||||
import Frame from "../components/Frame";
|
||||
import { EmbedProps as Props } from ".";
|
||||
|
||||
export default function Valtown(props: Props) {
|
||||
const { matches } = props.attrs;
|
||||
const valId = matches[1];
|
||||
|
||||
return (
|
||||
<Frame
|
||||
{...props}
|
||||
src={`https://www.val.town/embed/${valId}`}
|
||||
title="Valtown"
|
||||
border
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Valtown.ENABLED = [/^https?:\/\/(?:www.)?val\.town\/(?:v|embed)\/(.*)$/];
|
||||
Reference in New Issue
Block a user