style fixes + remove lastShared state
This commit is contained in:
parent
4c337a5114
commit
53484db768
4 changed files with 17 additions and 7 deletions
|
|
@ -18,7 +18,6 @@ export function Header({ context }) {
|
|||
started,
|
||||
pending,
|
||||
isDirty,
|
||||
lastShared,
|
||||
activeCode,
|
||||
handleTogglePlay,
|
||||
handleUpdate,
|
||||
|
|
@ -119,7 +118,7 @@ export function Header({ context }) {
|
|||
onClick={handleShare}
|
||||
>
|
||||
<LinkIcon className="w-6 h-6" />
|
||||
<span>share{lastShared && lastShared === (activeCode || code) ? 'd!' : ''}</span>
|
||||
<span>share</span>
|
||||
</button>
|
||||
)}
|
||||
{!isEmbedded && (
|
||||
|
|
|
|||
|
|
@ -209,7 +209,6 @@ export function Repl({ embedded = false }) {
|
|||
started,
|
||||
pending,
|
||||
isDirty,
|
||||
lastShared,
|
||||
activeCode,
|
||||
handleChangeCode,
|
||||
handleTogglePlay,
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import { Panel } from './panel/Panel';
|
|||
import { useStore } from '@nanostores/react';
|
||||
import { prebake /* , resetSounds */ } from './prebake.mjs';
|
||||
import { getRandomTune, initCode, loadModules, shareCode } from './util.mjs';
|
||||
import './Repl.css';
|
||||
|
||||
const { code: randomTune, name } = getRandomTune();
|
||||
export const ReplContext = createContext(null);
|
||||
|
|
@ -50,7 +51,6 @@ if (typeof window !== 'undefined') {
|
|||
export function Repl2({ embedded = false }) {
|
||||
//const isEmbedded = embedded || window.location !== window.parent.location;
|
||||
const isEmbedded = false;
|
||||
const [lastShared, setLastShared] = useState();
|
||||
const { panelPosition, isZen } = useSettings();
|
||||
/* const replState = useStore($replstate);
|
||||
const isDirty = useStore($repldirty); */
|
||||
|
|
@ -89,6 +89,7 @@ export function Repl2({ embedded = false }) {
|
|||
setLatestCode(code);
|
||||
window.location.hash = '#' + code2hash(code);
|
||||
},
|
||||
bgFill: false,
|
||||
});
|
||||
// init settings
|
||||
initCode().then((decoded) => {
|
||||
|
|
@ -185,7 +186,6 @@ export function Repl2({ embedded = false }) {
|
|||
started,
|
||||
pending,
|
||||
isDirty,
|
||||
lastShared,
|
||||
activeCode,
|
||||
handleTogglePlay,
|
||||
handleUpdate,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue