Skip to content

Commit 8f239ef

Browse files
Revert "Onetrust cookie banner (#1354)" (#1356)
This reverts commit e0398a6.
1 parent e26cfdd commit 8f239ef

File tree

20 files changed

+693
-333
lines changed

20 files changed

+693
-333
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ To add, edit, or delete content in our documentation, you have to modify Markdow
7070
- `kb/` Contains `.md` files that populate the Knowledge Base.
7171
- `library/` Contains `.md` files that populate the Streamlit Library section.
7272
- `streamlit-cloud/`Contains `.md` files that populate the Streamlit Community Cloud section.
73+
- `gdpr-banner.md` You'll never have to edit this file.
7374
- `index.md` Contains text that populates the index page.
7475
- `menu.md` This is a special file containing only front matter that defines the docs Menu. You will need to add an entry on this file for each new page you create within the docs' site.
7576

components/navigation/cookiePolicyButton.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

components/navigation/footer.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
import Link from "next/link";
2-
import dynamic from "next/dynamic";
32

43
import styles from "./footer.module.css";
54

6-
const CookiePolicyButton = dynamic(() => import("./cookiePolicyButton"), {
7-
ssr: false,
8-
});
9-
10-
const Footer = () => {
5+
const Footer = ({ setIsTelemetryModalVisible }) => {
116
return (
127
<footer className={styles.Container}>
138
<section className={styles.InnerContainer}>
@@ -186,9 +181,12 @@ const Footer = () => {
186181
</section>
187182
<div className={styles.Copyright}>
188183
<span>&copy; {new Date().getFullYear()} Snowflake Inc.</span>
189-
<CookiePolicyButton className="hover:opacity-80 ml-2">
184+
<button
185+
className="hover:opacity-80 ml-2"
186+
onClick={() => setIsTelemetryModalVisible(true)}
187+
>
190188
Cookie policy
191-
</CookiePolicyButton>
189+
</button>
192190
</div>
193191
</section>
194192
</footer>

components/utilities/breadCrumbs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const BreadCrumbs = ({ slug, menu }) => {
6868
}
6969

7070
// Then, we add a couple pages that don't need breadcrumbs, such as /menu, /index, etc.
71-
filesToExclude.push("index", "menu");
71+
filesToExclude.push("index", "gdpr-banner", "menu", "cookie-settings");
7272

7373
// Now, we throw the error if any page that's not on the filesToExclude array is missing in menu.md
7474
if (path.length === 0 && !filesToExclude.includes(slug[0])) {
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import classNames from "classnames";
2+
3+
import content from "../../content/cookie-settings.md";
4+
5+
import styles from "./cookieSettingsModal.module.css";
6+
7+
export default function CookieSettingsModal({
8+
setIsTelemetryModalVisible,
9+
declineTelemetryAndCloseBanner,
10+
allowTelemetryAndCloseBanner,
11+
}) {
12+
return (
13+
<div className="fixed w-full h-full z-40 bg-gray-90 bg-opacity-90 top-0 flex items-center justify-center">
14+
<div
15+
className={classNames(
16+
styles.Container,
17+
"relative",
18+
"bg-white rounded-xl",
19+
"p-8 md:p-12",
20+
"w-full max-w-4xl",
21+
"overscroll-none overflow-y-auto",
22+
"max-h-screen",
23+
)}
24+
>
25+
<button
26+
className="absolute right-4 top-4 md:right-11 md:top-11 fill-gray-70"
27+
onClick={() => setIsTelemetryModalVisible(false)}
28+
>
29+
<svg
30+
xmlns="http://www.w3.org/2000/svg"
31+
viewBox="0 -960 960 960"
32+
className="mt-2 w-8 h-8 hover:bg-gray-30 rounded"
33+
>
34+
<path d="m253.897-229.795-24.102-24.102L455.897-480 229.795-706.103l24.102-24.102L480-504.103l226.103-226.102 24.102 24.102L504.103-480l226.102 226.103-24.102 24.102L480-455.897 253.897-229.795Z" />
35+
</svg>
36+
</button>
37+
<div dangerouslySetInnerHTML={{ __html: content.html }} />
38+
<button
39+
className={classNames(
40+
"mt-4 md:mt-8",
41+
"py-2 px-3",
42+
"text-gray-90",
43+
"border-gray-90 border",
44+
"rounded",
45+
"hover:bg-gray-90",
46+
"hover:text-white",
47+
"active:bg-gray-90",
48+
"active:text-white",
49+
)}
50+
onClick={declineTelemetryAndCloseBanner}
51+
>
52+
Reject all
53+
</button>
54+
<button
55+
className={classNames(
56+
"mt-4 md:mt-8 ml-4",
57+
"py-2 px-3",
58+
"text-gray-90",
59+
"border-gray-90 border",
60+
"rounded",
61+
"hover:bg-gray-90",
62+
"hover:text-white",
63+
"active:bg-gray-90",
64+
"active:text-white",
65+
)}
66+
onClick={allowTelemetryAndCloseBanner}
67+
>
68+
Accept all
69+
</button>
70+
</div>
71+
</div>
72+
);
73+
}
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
.Container > div {
2+
@apply text-gray-90 grid grid-cols-1 gap-4 text-base leading-loose;
3+
}
4+
5+
.Container h1,
6+
.Container h2,
7+
.Container h3,
8+
.Container h4,
9+
.Container h5,
10+
.Container h6 {
11+
@apply scroll-mt-0 md:scroll-mt-32;
12+
}
13+
14+
.Container h2,
15+
.Container h3,
16+
.Container h4,
17+
.Container h5 {
18+
@apply mt-4 text-lg font-bold text-gray-90;
19+
}
20+
21+
.Container h2 {
22+
@apply text-xl;
23+
}
24+
25+
.Container h3 {
26+
@apply text-2xl;
27+
}
28+
29+
.Container h2:first-child,
30+
.Container h3:first-child,
31+
.Container h4:first-child,
32+
.Container h5:first-child {
33+
@apply mt-0;
34+
}
35+
36+
.Container p {
37+
@apply text-gray-90;
38+
}
39+
40+
.Container a {
41+
@apply underline;
42+
}
43+
44+
.Container a:hover {
45+
@apply opacity-80;
46+
}
47+
48+
.Container ol {
49+
@apply list-decimal pl-8 grid grid-cols-1 gap-4;
50+
}
51+
52+
.Container section ol {
53+
@apply list-none pl-0 gap-0 mb-5;
54+
}
55+
56+
.Container ul {
57+
@apply list-disc pl-8 grid grid-cols-1 gap-4;
58+
}
59+
60+
.Container li {
61+
@apply pl-2;
62+
}
63+
64+
.Container blockquote {
65+
@apply p-6 md:p-8 lg:p-16
66+
-mx-6 md:-mx-8 lg:-mx-16
67+
my-0 md:my-4 lg:my-12
68+
grid grid-cols-1 gap-4
69+
bg-lightBlue-10
70+
text-gray-80
71+
rounded-lg;
72+
}
73+
74+
.PrivacyContainer blockquote ~ h4 {
75+
@apply mt-12 md:mt-8 lg:mt-0 text-gray-90;
76+
}
77+
78+
.PrivacyContainer blockquote h2 {
79+
@apply hidden;
80+
}
81+
82+
.Container blockquote h2 {
83+
@apply text-gray-90 text-3xl;
84+
}
85+
86+
.Container hr {
87+
@apply border-gray-40 border-t-0 border-l-0 border-r-0 border-b my-8;
88+
}
89+
90+
.Container address {
91+
@apply whitespace-pre-line pl-4 border-l-2 border-gray-30 mt-4;
92+
}
93+
94+
.Container pre {
95+
@apply bg-gray-10 p-4 rounded-md overflow-x-auto text-gray-90;
96+
}
97+
98+
.Container pre code {
99+
@apply text-lg;
100+
}
101+
102+
.Container figure {
103+
@apply flex flex-col items-start;
104+
}
105+
106+
.Container figure img {
107+
@apply h-24 ml-2 mb-2;
108+
}
109+
110+
.Container figure figcaption {
111+
@apply text-sm text-gray-70;
112+
}
113+
114+
/* For table in Privacy notice */
115+
.Container table {
116+
@apply table-fixed my-8 w-full;
117+
}
118+
119+
.Container table thead tr th {
120+
@apply px-4 py-3 text-left bg-gray-20 bg-opacity-50 border border-gray-30 text-gray-90 font-semibold text-lg leading-normal align-top;
121+
}
122+
123+
.Container table tbody tr td {
124+
@apply px-4 py-3 border border-gray-30 text-gray-90 text-lg leading-normal align-top;
125+
}
126+
127+
.DeploymentTerms ul,
128+
.DeploymentTerms ol {
129+
@apply list-none;
130+
}
131+
132+
/* Specific classes for colors */
133+
.Container:global(.red) a {
134+
@apply text-red-70;
135+
}
136+
137+
.Container:global(.orange) a {
138+
@apply text-orange-70;
139+
}
140+
141+
.Container:global(.yellow) a {
142+
@apply text-yellow-90;
143+
}
144+
145+
.Container:global(.green) a {
146+
@apply text-green-70;
147+
}
148+
149+
.Container:global(.acqua) a {
150+
@apply text-acqua-70;
151+
}
152+
153+
.Container:global(.lightBlue) a {
154+
@apply text-lightBlue-70;
155+
}
156+
157+
.Container:global(.darkBlue) a {
158+
@apply text-darkBlue-70;
159+
}
160+
161+
.Container:global(.indigo) a {
162+
@apply text-indigo-70;
163+
}
164+
165+
.Container:global(.gray) a {
166+
@apply text-gray-70;
167+
}

0 commit comments

Comments
 (0)