mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-26 04:58:27 +00:00
fix activeFooter state
This commit is contained in:
parent
21503c0c38
commit
aa76419eda
@ -107,6 +107,7 @@ export const AppContext = createContext();
|
|||||||
function App() {
|
function App() {
|
||||||
const [view, setView] = useState(); // codemirror view
|
const [view, setView] = useState(); // codemirror view
|
||||||
const [lastShared, setLastShared] = useState();
|
const [lastShared, setLastShared] = useState();
|
||||||
|
const [activeFooter, setActiveFooter] = useState('console');
|
||||||
|
|
||||||
const { code, setCode, scheduler, evaluate, activateCode, isDirty, activeCode, pattern, started, stop } = useStrudel({
|
const { code, setCode, scheduler, evaluate, activateCode, isDirty, activeCode, pattern, started, stop } = useStrudel({
|
||||||
initialCode: '// LOADING',
|
initialCode: '// LOADING',
|
||||||
@ -229,6 +230,8 @@ function App() {
|
|||||||
isDirty,
|
isDirty,
|
||||||
lastShared,
|
lastShared,
|
||||||
activeCode,
|
activeCode,
|
||||||
|
activeFooter,
|
||||||
|
setActiveFooter,
|
||||||
handleChangeCode,
|
handleChangeCode,
|
||||||
handleTogglePlay,
|
handleTogglePlay,
|
||||||
handleUpdate,
|
handleUpdate,
|
||||||
|
|||||||
@ -2,11 +2,12 @@ import XMarkIcon from '@heroicons/react/20/solid/XMarkIcon';
|
|||||||
import { logger } from '@strudel.cycles/core';
|
import { logger } from '@strudel.cycles/core';
|
||||||
import { cx } from '@strudel.cycles/react';
|
import { cx } from '@strudel.cycles/react';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
import React, { useContext, useCallback, useLayoutEffect, useRef, useState } from 'react';
|
||||||
import { useEvent, loadedSamples } from './App';
|
import { useEvent, loadedSamples, AppContext } from './App';
|
||||||
|
|
||||||
export function Footer() {
|
export function Footer() {
|
||||||
const [activeFooter, setActiveFooter] = useState('console');
|
// const [activeFooter, setActiveFooter] = useState('console');
|
||||||
|
const { activeFooter, setActiveFooter } = useContext(AppContext);
|
||||||
const footerContent = useRef();
|
const footerContent = useRef();
|
||||||
const [log, setLog] = useState([]);
|
const [log, setLog] = useState([]);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user