diff --git a/website/src/repl/components/button/action-button.jsx b/website/src/repl/components/button/action-button.jsx index 169aebd4b..52ae2f84c 100644 --- a/website/src/repl/components/button/action-button.jsx +++ b/website/src/repl/components/button/action-button.jsx @@ -8,40 +8,3 @@ export function ActionButton({ children, label, labelIsHidden, className, ...but ); } - -export function SpecialActionButton(props) { - const { className, ...buttonProps } = props; - - return ( - - ); -} - -export function IconButton(props) { - const { Icon, label, children, labelIsHidden, className, ...buttonProps } = props; - - return ( - - ); -} - -export function ActionInput({ label, className, ...props }) { - return ( - - ); -} - -export function SpecialActionInput({ className, ...props }) { - return {props.label}} />; -} diff --git a/website/src/repl/components/panel/ImportPrebakeScriptButton.jsx b/website/src/repl/components/panel/ImportPrebakeScriptButton.jsx index 50d62aa11..8ba31dc79 100644 --- a/website/src/repl/components/panel/ImportPrebakeScriptButton.jsx +++ b/website/src/repl/components/panel/ImportPrebakeScriptButton.jsx @@ -1,8 +1,6 @@ import { errorLogger } from '@strudel/core'; -import { useSettings, storePrebakeScript } from '../../../settings.mjs'; -import { SpecialActionInput } from '../button/action-button'; +import { storePrebakeScript } from '../../../settings.mjs'; import { confirmDialog, PREBAKE_CHANGE_MSG } from '@src/repl/util.mjs'; -import { DocumentArrowDownIcon } from '@heroicons/react/16/solid'; async function importScript(script, updateEditor) { const reader = new FileReader(); @@ -31,25 +29,22 @@ export async function exportScript(script) { } export function ImportPrebakeScriptButton({ updateEditor }) { - const settings = useSettings(); - + const handleChange = async (e) => { + const file = e.target.files[0]; + const confirmed = await confirmDialog(PREBAKE_CHANGE_MSG); + if (!confirmed) { + return; + } + try { + await importScript(file, updateEditor); + } catch (e) { + errorLogger(e); + } + }; return ( - { - const file = e.target.files[0]; - const confirmed = await confirmDialog(PREBAKE_CHANGE_MSG); - if (!confirmed) { - return; - } - try { - await importScript(file, updateEditor); - } catch (e) { - errorLogger(e); - } - }} - /> + ); } diff --git a/website/src/repl/components/panel/SettingsTab.jsx b/website/src/repl/components/panel/SettingsTab.jsx index 90bb7ad67..4b7bd0aa6 100644 --- a/website/src/repl/components/panel/SettingsTab.jsx +++ b/website/src/repl/components/panel/SettingsTab.jsx @@ -7,7 +7,7 @@ import { AudioDeviceSelector } from './AudioDeviceSelector.jsx'; import { AudioEngineTargetSelector } from './AudioEngineTargetSelector.jsx'; import { confirmDialog } from '../../util.mjs'; import { DEFAULT_MAX_POLYPHONY, setMaxPolyphony, setMultiChannelOrbits } from '@strudel/webaudio'; -import { ActionButton, SpecialActionButton } from '../button/action-button.jsx'; +import { ActionButton } from '../button/action-button.jsx'; import { exportScript, ImportPrebakeScriptButton } from './ImportPrebakeScriptButton.jsx'; import { useEffect, useRef } from 'react'; @@ -340,7 +340,7 @@ function MainSettingsContent({ started }) { Try clicking the logo in the top left! - { confirmDialog('Sure?').then((r) => { if (r) { @@ -349,9 +349,10 @@ function MainSettingsContent({ started }) { } }); }} + className="bg-background p-2 max-w-[300px] hover:opacity-50" > restore default settings - + ); @@ -387,7 +388,7 @@ function PrebakeSettingsContent() { value={includePrebakeScriptInShare} />
- editorRef.current?.editor.setCode(code)} /> + editorRef?.current.setCode(code)} /> exportScript(prebakeScript)}>export editorRef.current?.savePrebake()}>save