11import { MantineTransition , SimpleGrid , Transition } from '@mantine/core' ;
22import PouchDB from 'pouchdb-browser' ;
3- import { useEffect , useState } from 'react' ;
3+ import { useContext , useEffect , useState } from 'react' ;
44import { useParams } from 'react-router-dom' ;
55import { CENTER_INDEX } from '../../common/constants' ;
66import ShortcutType from '../../common/enums/ShortcutType' ;
@@ -15,6 +15,7 @@ import Back from './shortcuts/Back';
1515import Container from './shortcuts/Container' ;
1616import Hotkey from './shortcuts/Hotkey' ;
1717import Script from './shortcuts/Script' ;
18+ import ToolSizeContext from '../context/ToolSizeContext' ;
1819
1920// prettier-ignore
2021const TRANSITIONS = [
@@ -29,6 +30,7 @@ export default function StageProvider() {
2930 const { id : stageID } = useParams < { id ?: string } > ( ) ;
3031 const [ shortcuts , setShortcuts ] = useState < Shortcut [ ] > ( [ ] ) ;
3132 const [ mounted , setMounted ] = useState ( false ) ;
33+ const { expand } = useContext ( ToolSizeContext ) ;
3234
3335 const loadStage = async ( id : string ) => {
3436 setShortcuts ( [ ] ) ;
@@ -52,6 +54,10 @@ export default function StageProvider() {
5254 } , 10 ) ;
5355 } , [ stageID ] ) ;
5456
57+ useEffect ( ( ) => {
58+ expand ( ) ;
59+ } , [ expand ] ) ; // TODO: continue here
60+
5561 return (
5662 < SimpleGrid cols = { 3 } h = "100%" p = "xs" >
5763 { shortcuts . flatMap ( ( shortcut , index ) => {
0 commit comments