mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
May not be able to use child trick to prevent excess navbar space usage, log a debug warning.
This commit is contained in:
parent
af5d4dfd51
commit
dd35cf591f
1 changed files with 6 additions and 1 deletions
|
|
@ -61,7 +61,12 @@ function MenuLink({link}) {
|
|||
|
||||
function NavIconWrapper({children}) {
|
||||
// Do not add margins around empty react element to avoid filling up navbar.
|
||||
const emptyChild = !children || isReactChildNull(children);
|
||||
let emptyChild = false;
|
||||
try {
|
||||
emptyChild = !children || isReactChildNull(children);
|
||||
} catch (e) {
|
||||
console.debug('Failed to get children of react element');
|
||||
}
|
||||
const style = emptyChild ? {} : {marginTop: '0.8em', marginLeft: '1.5em'};
|
||||
return <div style={style}>{children}</div>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue