Skip to content

Commit

Permalink
feat: remove tools
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasticsoul committed Jan 21, 2024
1 parent 44ae79d commit 92b152f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion docs/docs/playground/demos/Playground/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export default React.memo(({ onClick, name, subName }: any) => {
}
};


return (
<div className="topBar" onClick={handleClick}>
<span className='samples'>{renderItems(name, subName)}</span>
Expand Down
20 changes: 9 additions & 11 deletions docs/docs/playground/demos/Playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import TopBar from './TopBar';
import Console from './Console';
import * as codes from './codes';
import './index.less';
import { Tools } from './Tools';
// import { Tools } from './Tools';
import { setCodeContext, codeContext } from './codeContext';
import localforage from 'localforage';

Expand Down Expand Up @@ -70,15 +70,12 @@ export default () => {
const { name } = info;
cachedSubNames[name] = subName;
setCodeContext(draft => {
draft.key = `${name}_${subName}`
})

setInfo({ name, subName })
loadCode(name, subName, setCode)
}, [info.name, info.subName])


draft.key = `${name}_${subName}`;
});

setInfo({ name, subName });
loadCode(name, subName, setCode);
}, [info.name, info.subName]);

return (
<LiveProvider noInline={true} code={code} scope={scope} theme={prism.themes.vsDark}>
Expand All @@ -87,8 +84,9 @@ export default () => {
<ApiMenus onClick={changeCode} name={info.name} />
<div style={{ flex: "1 1 0px", height: '100%' }}>
<TopBar onClick={changeSubName} name={info.name} subName={info.subName} />
<LiveEditor style={{ flexGrow: 1 }} onChange={value => { setCodeContext(draft => { draft.code = value }) }} />
<Tools />
{/* <LiveEditor style={{ flexGrow: 1 }} onChange={value => { setCodeContext(draft => { draft.code = value }) }} /> */}
<LiveEditor style={{ flexGrow: 1 }} />
{/* <Tools /> */}
</div>
<div style={{ flex: "1 1 0px", height: 'calc(100vh - 138px)' }}>
{/* 空占位一个条 */}
Expand Down

0 comments on commit 92b152f

Please sign in to comment.