-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathApp.tsx
More file actions
38 lines (32 loc) · 1.04 KB
/
App.tsx
File metadata and controls
38 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React, { ReactNode } from "react";
import AppBar from "@mui/material/AppBar/AppBar";
import Toolbar from "@mui/material/Toolbar/Toolbar";
import { useNavigate } from "react-router-dom";
import UserButton from "./features/toolbar/components/UserButton";
import { useIsMobile } from "./features/toolbar/hooks/useIsMobile";
import SearchBar from "./features/toolbar/components/SearchBar";
import "./App.css";
export const FUEL_GREEN = "#00f58c";
interface AppProps {
children?: ReactNode;
}
function App({ children }: AppProps) {
const navigate = useNavigate();
const isMobile = useIsMobile();
return (
<div className="app-container">
<AppBar position="static">
<Toolbar className="app-toolbar">
<div className="app-logo" onClick={() => navigate("/")}>
forc.pub
</div>
{!isMobile && <SearchBar />}
<UserButton />
</Toolbar>
{isMobile && <SearchBar />}
</AppBar>
<div className="app-content">{children}</div>
</div>
);
}
export default App;