Skip to content

Commit

Permalink
refactor: move script into component
Browse files Browse the repository at this point in the history
  • Loading branch information
octokatherine authored Oct 29, 2021
1 parent fd929b2 commit 29f7eee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 0 additions & 5 deletions example-nextjs/components/CodeRunnerUI.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react'
import Script from 'next/script'
import GithubButton from './GithubButton'
import Navbar from './Navbar'
import Editor from './Editor'
Expand Down Expand Up @@ -37,10 +36,6 @@ export default function CodeRunnerUI(props: Props) {
<Navbar current={languageLabel} />
<div className="max-w-4xl px-4 py-8 mx-auto sm:px-6 lg:px-8">
<div className="max-w-3xl mx-auto">
<Script
src="https://cdn.jsdelivr.net/pyodide/v0.18.1/full/pyodide.js"
strategy="beforeInteractive"
/>
<main className="mx-auto mb-12 max-w-7xl sm:mt-12">
<div className="text-left">
<h1 className="text-3xl tracking-tight text-gray-900 dark:text-white sm:text-5xl md:text-5xl">
Expand Down
5 changes: 5 additions & 0 deletions example-nextjs/components/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react'
import Script from 'next/script'
import MonacoEditor, { Monaco } from '@monaco-editor/react'
import { addKeyBinding, CustomKeyBinding } from '../utils'

Expand Down Expand Up @@ -50,6 +51,10 @@ export default function Editor(props: Props) {

return (
<>
<Script
src="https://cdn.jsdelivr.net/pyodide/v0.18.1/full/pyodide.js"
strategy="beforeInteractive"
/>
<div>
<div>
<label className="block pb-4 text-sm font-medium text-gray-700 dark:text-gray-450">
Expand Down

0 comments on commit 29f7eee

Please sign in to comment.