forked from TypeCellOS/BlockNote
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFooter.tsx
More file actions
157 lines (151 loc) · 5.17 KB
/
Footer.tsx
File metadata and controls
157 lines (151 loc) · 5.17 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import cn from "classnames";
import Link from "next/link";
import { ThemeSwitch } from "nextra-theme-docs";
import type { ReactElement, ReactNode } from "react";
import { Logo } from "./Logo";
function FooterLink({ href, children }: { href: string; children: ReactNode }) {
const classes =
"text-sm text-[#666666] dark:text-[#888888] no-underline betterhover:hover:text-gray-700 betterhover:hover:dark:text-white transition";
if (href.startsWith("http")) {
return (
<a className={classes} href={href}>
{children}
</a>
);
}
return (
<Link className={classes} href={href}>
{children}
</Link>
);
}
function FooterHeader({ children }: { children: ReactNode }) {
return <h3 className="text-sm text-black dark:text-white">{children}</h3>;
}
const navigation = {
general: [
{ name: "Documentation", href: "/docs" },
{ name: "Examples", href: "/examples" },
{
name: "Releases",
href: "https://github.com/TypeCellOS/BlockNote/releases",
},
],
community: [
{
name: "GitHub",
href: "https://github.com/TypeCellOS/BlockNote",
},
{
name: "Discord",
href: "https://discord.com/invite/Qc2QTTH5dF",
},
],
collaborate: () => [
{ name: "Partner with us", href: `/about#partner-with-us` },
{
name: "Sponsorships",
href: `/about#sponsorships`,
},
{
name: "Contribute",
href: `/about#contribute`,
},
],
};
export function FooterContent() {
return (
<div aria-labelledby="footer-heading" className="w-full">
<h2 className="sr-only" id="footer-heading">
Footer
</h2>
<div className="mx-auto w-full py-8">
<div className="xl:grid xl:grid-cols-3 xl:gap-16">
<div className="">
{/* <FooterHeader>Subscribe to our newsletter</FooterHeader> */}
<Logo />
<p className="mt-4 text-sm text-gray-600 dark:text-[#888888]">
BlockNote is an extensible React rich text editor with support for
block-based editing, collaboration and comes with ready-to-use
customizable UI components.
</p>
{/* <SubmitForm /> */}
</div>
<div className="grid grid-cols-1 gap-8 xl:col-span-2">
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 md:gap-8">
<div className="mt-12 xl:!mt-0">
<FooterHeader>Learn</FooterHeader>
<ul className="ml-0 mt-4 list-none space-y-1.5">
{navigation.general.map((item) => (
<li key={item.name}>
<FooterLink href={item.href}>{item.name}</FooterLink>
</li>
))}
</ul>
</div>
<div className="mt-12 xl:!mt-0">
<FooterHeader>Collaborate</FooterHeader>
<ul className="ml-0 mt-4 list-none space-y-1.5">
{navigation.collaborate().map((item) => (
<li key={item.name}>
<FooterLink href={item.href}>{item.name}</FooterLink>
</li>
))}
</ul>
</div>
<div className="mt-12 xl:!mt-0">
<FooterHeader>Community</FooterHeader>
<ul className="ml-0 mt-4 list-none space-y-1.5">
{navigation.community.map((item) => (
<li key={item.name}>
<FooterLink href={item.href}>{item.name}</FooterLink>
</li>
))}
</ul>
</div>
<div className="mt-12 xl:!mt-0">
<FooterHeader>Theme</FooterHeader>
<ul className="ml-0 mt-4 list-none space-y-1.5">
<li>
<ThemeSwitch />
</li>
</ul>
{/* <ThemeSwitch /> */}
</div>
</div>
</div>
</div>
<div className="mt-8 pt-8 sm:flex sm:items-center sm:justify-between">
<div>
<p className="mt-4 text-xs text-gray-500 dark:text-[#888888]">
© {new Date().getFullYear()} BlockNote maintainers. All
rights reserved.
</p>
</div>
</div>
</div>
</div>
);
}
export function Footer({ menu }: { menu?: boolean }): ReactElement {
return (
<footer className="relative bg-[#FAFAFA] pb-[env(safe-area-inset-bottom)] dark:bg-[#111111]">
{/* <div className="pointer-events-none absolute top-0 h-12 w-full -translate-y-full bg-gradient-to-t from-[#FAFAFA] to-transparent dark:from-black" /> */}
{/* <div
className={cn(
"mx-auto flex max-w-[90rem] gap-2 px-4 py-2",
menu ? "flex" : "hidden",
)}>
<ThemeSwitch />
</div>
<hr className="dark:border-neutral-800" /> */}
<div
className={cn(
"mx-auto flex max-w-[90rem] justify-center py-12 text-black dark:text-white md:justify-center",
"pl-[max(env(safe-area-inset-left),1.5rem)] pr-[max(env(safe-area-inset-right),1.5rem)]",
)}>
<FooterContent />
</div>
</footer>
);
}