Skip to content

Commit

Permalink
fix: Resolve frameSrc not found warning (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcompiles committed Jun 2, 2020
1 parent 8fc0b83 commit 28b1f9a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
11 changes: 11 additions & 0 deletions src/Playroom/Frames/frameSrc.d.ts
@@ -0,0 +1,11 @@
interface FrameParams {
code: string;
themeName: string;
}

declare function frameSrc(
frameParams: FrameParams,
config: InternalPlayroomConfig
): string;

export default frameSrc;
11 changes: 11 additions & 0 deletions src/Playroom/Frames/frameSrc.js
@@ -0,0 +1,11 @@
// eslint-disable-next-line import/no-unresolved
const frameConfig = require('__PLAYROOM_ALIAS__FRAME_COMPONENT__');

const defaultFrameSrc = ({ code, themeName }, { baseUrl, paramType }) =>
`${baseUrl}frame.html${
paramType === 'hash' ? '#' : ''
}?themeName=${encodeURIComponent(themeName)}&code=${encodeURIComponent(
code
)}`;

module.exports = frameConfig.frameSrc ? frameConfig.frameSrc : defaultFrameSrc;
19 changes: 0 additions & 19 deletions src/Playroom/Frames/frameSrc.ts

This file was deleted.

0 comments on commit 28b1f9a

Please sign in to comment.