1
0
Fork 0

wip(shared): Changes to layouts

This will break the org build, but we need to rip out sanity anyway so
I don't think it's worth obsessing over it now.

I've essentially changes the default layout and added a new navigation
component.
This commit is contained in:
joostdecock 2023-07-15 16:55:22 +02:00
parent 8b79de2bd6
commit 5a9f2f8d40
26 changed files with 318 additions and 172 deletions

View file

@ -9,11 +9,13 @@ import { Pattern, PatternXray } from '@freesewing/react-components'
// Get code from children
export const asText = (reactEl) => {
if (typeof reactEl.props.children === 'string') return reactEl.props.children
if (Array.isArray(reactEl.props.children)) {
return reactEl.props.children.map((el) => (typeof el === 'string' ? el : asText(el))).join('')
if (reactEl) {
if (typeof reactEl.props.children === 'string') return reactEl.props.children
if (Array.isArray(reactEl.props.children)) {
return reactEl.props.children.map((el) => (typeof el === 'string' ? el : asText(el))).join('')
}
if (typeof reactEl.props.children === 'object') return asText(reactEl.props.children)
}
if (typeof reactEl.props.children === 'object') return asText(reactEl.props.children)
return ''
}