Skip to content

Commit

Permalink
bug fixing : added render . combined renderer fn
Browse files Browse the repository at this point in the history
  • Loading branch information
nuoxoxo committed Dec 13, 2023
1 parent 9c6116a commit b25a30a
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions src/includes/Aoc2313.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,30 +167,28 @@ var Aoc2313 = () => {
}

const Renderer = () => {
return combinedArrays
}

const combinedArrays = A.map((elemA, i) => {
elemA = [Array(elemA[0].length).fill([' ']), Array(elemA[0].length).fill([' ']), ...elemA]
// 👆 unshift 2 blank lines now the left block (which is the orignal block) looks better
const elemB = B[i]
const elemC = C[i]
return A.map((elemA, i) => {
elemA = [Array(elemA[0].length).fill([' ']), Array(elemA[0].length).fill([' ']), ...elemA]
// 👆 unshift 2 blank lines now the left block (which is the orignal block) looks better
const elemB = B[i]
const elemC = C[i]

// Return JSX or components if you want to render them
return (
<div key={i} style={{
display:'flex',
flexDirection:'row',
justifyContent:'center',
alignContent:'center',
paddingBottom:'21px'
}}>
<div>{elemA.map((row)=>row.join('')).join('\n')}</div>
<div>{elemB.map((row)=>row.join('')).join('\n')}</div>
<div>{elemC.map((row)=>row.join('')).join('\n')}</div>
</div>
)
})
// Return JSX or components if you want to render them
return (
<div key={i} style={{
display:'flex',
flexDirection:'row',
justifyContent:'center',
alignContent:'center',
paddingBottom:'21px'
}}>
<div>{elemA.map((row)=>row.join('')).join('\n')}</div>
<div>{elemB.map((row)=>row.join('')).join('\n')}</div>
<div>{elemC.map((row)=>row.join('')).join('\n')}</div>
</div>
)
})
}

return (
<>
Expand Down

0 comments on commit b25a30a

Please sign in to comment.