mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-21 07:28:30 +03:00
Skeleton: fix grid styling on hidden sidebar
Fixes urbit/landscape#1006
This commit is contained in:
parent
aa8551a3ab
commit
5e2f4215a8
@ -14,11 +14,12 @@ class AsyncFallback extends React.Component<
|
||||
this.state = { error: false };
|
||||
}
|
||||
|
||||
componentDidCatch() {
|
||||
this.setState({ error: true });
|
||||
return false;
|
||||
static getDerivedStateFromError(error) {
|
||||
return { error: true };
|
||||
}
|
||||
|
||||
componentDidCatch(error, info) {}
|
||||
|
||||
render() {
|
||||
const { fallback, children } = this.props;
|
||||
return (
|
||||
|
@ -20,22 +20,26 @@ export const Skeleton = React.memo((props: SkeletonProps): ReactElement => {
|
||||
setSidebar(s => !s);
|
||||
}, []));
|
||||
|
||||
return !sidebar ? (<Body> {props.children} </Body>) : (
|
||||
return (
|
||||
<Body
|
||||
display="grid"
|
||||
gridTemplateColumns={
|
||||
['100%', 'minmax(150px, 1fr) 3fr', 'minmax(250px, 1fr) 4fr']
|
||||
sidebar
|
||||
? ['100%', 'minmax(150px, 1fr) 3fr', 'minmax(250px, 1fr) 4fr']
|
||||
: '100%'
|
||||
}
|
||||
gridTemplateRows="100%"
|
||||
>
|
||||
<ErrorBoundary>
|
||||
<Sidebar
|
||||
recentGroups={props.recentGroups}
|
||||
selected={props.selected}
|
||||
baseUrl={props.baseUrl}
|
||||
mobileHide={props.mobileHide}
|
||||
workspace={props.workspace}
|
||||
/>
|
||||
{ sidebar && (
|
||||
<Sidebar
|
||||
recentGroups={props.recentGroups}
|
||||
selected={props.selected}
|
||||
baseUrl={props.baseUrl}
|
||||
mobileHide={props.mobileHide}
|
||||
workspace={props.workspace}
|
||||
/>
|
||||
)}
|
||||
</ErrorBoundary>
|
||||
{props.children}
|
||||
</Body>
|
||||
|
Loading…
Reference in New Issue
Block a user