refactor settings to nanostores
This commit is contained in:
parent
ff99dbcd22
commit
b67b049802
11 changed files with 81 additions and 122 deletions
|
|
@ -4,7 +4,7 @@ import { useEffect, useState } from 'react';
|
|||
import { prebake } from '../repl/prebake';
|
||||
import { themes, settings } from '../repl/themes.mjs';
|
||||
import './MiniRepl.css';
|
||||
import useStore from '../useStore.mjs';
|
||||
import { useSettings } from '../settings.mjs';
|
||||
|
||||
let modules;
|
||||
if (typeof window !== 'undefined') {
|
||||
|
|
@ -28,9 +28,7 @@ if (typeof window !== 'undefined') {
|
|||
|
||||
export function MiniRepl({ tune, drawTime, punchcard, canvasHeight = 100 }) {
|
||||
const [Repl, setRepl] = useState();
|
||||
const {
|
||||
state: { theme },
|
||||
} = useStore();
|
||||
const { theme } = useSettings();
|
||||
useEffect(() => {
|
||||
// we have to load this package on the client
|
||||
// because codemirror throws an error on the server
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue