import { Link, routes } from '@redwoodjs/router' import { useAuth } from '@redwoodjs/auth' import { Flash } from '@redwoodjs/web' import Tooltip from '@material-ui/core/Tooltip'; import { useQuery } from '@redwoodjs/web' export const QUERY = gql` query FIND_USER_BY_ID($id: String!) { user: user(id: $id) { id image } } ` import avatar from 'src/assets/harold.jpg' import Svg from 'src/components/Svg' import ImageUploader from 'src/components/ImageUploader' import logo from 'src/layouts/MainLayout/Logo_2.jpg' const MainLayout = ({ children }) => { const { logIn, logOut, isAuthenticated, currentUser } = useAuth() const {data, loading} = useQuery(QUERY, {variables: {id: currentUser?.sub}}) return ( <> {/* Because of how specific these styles are to this heading/logo and it doesn't need to be replicated else where as well as it's very precise with the placement of "pre-alpha" I think it's appropriate. */} CadHub pre-alpha {/* */} {/* */} { isAuthenticated ? {!loading && {}} aspectRatio={1} imageUrl={data?.user?.image} width={80} />} : Sign in/up } {children} > ) } export default MainLayout