File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
client/src/components/MainLayout Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
import * as React from 'react'
2
2
import { View } from 'react-native'
3
3
import styled from 'styled-components'
4
+ import { useMeQuery } from '../../generated/graphql'
4
5
import Sidebar from './Sidebar'
5
6
import MenuIcon from './MenuIcon'
6
7
@@ -10,6 +11,19 @@ const Wrapper = styled(View)`
10
11
height: 100%;
11
12
min-height: 100vh;
12
13
background: var(--light-grayish-blue);
14
+
15
+ @keyframes fadeIn {
16
+ 0% {
17
+ opacity: 0;
18
+ }
19
+ 100% {
20
+ opacity: 1;
21
+ }
22
+ }
23
+
24
+ animation-name: fadeIn;
25
+ animation-duration: 0.3s;
26
+ animation-timing-function: ease-in;
13
27
`
14
28
15
29
interface MainLayoutProps {
@@ -19,7 +33,10 @@ interface MainLayoutProps {
19
33
export const SidebarContext = React . createContext ( { sidebarOpen : false } )
20
34
21
35
const MainLayout = ( { children } : MainLayoutProps ) => {
22
- const [ sidebarOpen , setSidebarOpen ] = React . useState ( true )
36
+ const { data } = useMeQuery ( )
37
+
38
+ const [ sidebarOpen , setSidebarOpen ] = React . useState ( ! ! ( data && data . me && data . me . isOnboarded ) )
39
+
23
40
return (
24
41
< SidebarContext . Provider value = { { sidebarOpen } } >
25
42
< Wrapper >
You can’t perform that action at this time.
0 commit comments