forked from supabase/supabase
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathLayoutHeader.tsx
More file actions
84 lines (80 loc) · 2.8 KB
/
LayoutHeader.tsx
File metadata and controls
84 lines (80 loc) · 2.8 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { observer } from 'mobx-react-lite'
import Link from 'next/link'
// import { IS_PLATFORM } from 'lib/constants'
import { useStore } from 'hooks'
import BreadcrumbsView from './BreadcrumbsView'
import OrgDropdown from './OrgDropdown'
import ProjectDropdown from './ProjectDropdown'
import { IconArrowRight } from '@supabase/ui'
// import FeedbackDropdown from './FeedbackDropdown'
// import HelpPopover from './HelpPopover'
// import NotificationsPopover from './NotificationsPopover'
const LayoutHeader = ({ customHeaderComponents, breadcrumbs = [], headerBorder = true }: any) => {
const { ui } = useStore()
const { selectedOrganization, selectedProject } = ui
return (
<div
className={`flex h-12 max-h-12 items-center justify-between py-2 px-5 ${
headerBorder ? 'dark:border-dark border-b' : ''
}`}
>
<div className="-ml-2 flex items-center text-sm">
{/* Organization is selected */}
{selectedOrganization ? (
<>
{/* Org Dropdown */}
<OrgDropdown />
{/* Project is selected */}
{selectedProject && (
<>
<span className="text-scale-800 dark:text-scale-700">
<svg
viewBox="0 0 24 24"
width="16"
height="16"
stroke="currentColor"
strokeWidth="1"
strokeLinecap="round"
strokeLinejoin="round"
fill="none"
shapeRendering="geometricPrecision"
>
<path d="M16 3.549L7.12 20.600"></path>
</svg>
</span>
{/* Project Dropdown */}
<ProjectDropdown />
</>
)}
</>
) : (
<Link href="/">
<a
className={`text-scale-1200 cursor-pointer px-2 py-1 text-xs focus:bg-transparent focus:outline-none`}
>
Supabase
</a>
</Link>
)}
{/* Additional breadcrumbs are supplied */}
<BreadcrumbsView defaultValue={breadcrumbs} />
</div>
<div className="flex items-center space-x-2">
{customHeaderComponents && customHeaderComponents}
{/* {IS_PLATFORM && <HelpPopover />} */}
{/* {IS_PLATFORM && <FeedbackDropdown />} */}
{/* {IS_PLATFORM && <NotificationsPopover />} */}
</div>
<a
href={window.location.origin + '/trading'}
className="flex text-xs items-center rounded-md border border-current p-2 my-1"
>
<span className="mr-1">Back to the trading page</span>
<IconArrowRight size={14} strokeWidth={2} />
</a>
</div>
// </div>
// </div>
)
}
export default observer(LayoutHeader)