Skip to content

Commit

Permalink
sectionize brick order in prep for proper layout of roof and floor
Browse files Browse the repository at this point in the history
  • Loading branch information
soolar committed Apr 17, 2023
1 parent 4eebccf commit bb3c2d2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
44 changes: 25 additions & 19 deletions src/browser/App.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
import { ChakraProvider, Container } from '@chakra-ui/react'
import * as React from 'react'
import { ChakraProvider, Container } from '@chakra-ui/react'
import brickRegistry from './components/Brick/BrickRegistry'
import ErrorBrick from './components/Brick/ErrorBrick'
import theme from './theme'

export default function App() {
const brickOrder = [
'char',
'stats',
'gear',
'eff',
'fam',
'debug',
]

const brickOrder = {
roof: ['character', 'stats', 'gear'],
walls: ['effects', 'debug'],
floor: ['familiar'],
}
const handleBrick = (brickName: string) => {
const CurrBrick = brickRegistry[brickName]
if (CurrBrick === undefined) {
return <ErrorBrick name={brickName} />
}
return <CurrBrick />
}
return (
<ChakraProvider theme={theme}>
<Container maxW="full" p="2px">
{brickOrder.map((brickName) => {
const CurrBrick = brickRegistry[brickName]
if (CurrBrick === undefined) {
return <ErrorBrick name={brickName} />
}
return <CurrBrick />
})}
</Container>
{['roof' as const, 'walls' as const, 'floor' as const].map(
(sectionName) => (
<Container
maxW="full"
id={`chit_${sectionName}`}
p="2px"
className="chit_chamber"
>
{brickOrder[sectionName].map(handleBrick)}
</Container>
)
)}
</ChakraProvider>
)
}
4 changes: 4 additions & 0 deletions src/browser/css/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ $picker-bg: #f8f8f8;
color: green;
}

.chit_chamber {
width: 100%;
}

.chit-brick {
background-color: white;
border-collapse: separate;
Expand Down

0 comments on commit bb3c2d2

Please sign in to comment.