Skip to content

Commit e3c9f26

Browse files
Make "cookie settings" button clickable by getting Ask AI button out of the way. (#1351)
* Simplify containers of Ask AI button to stop overlapping cookie settings link. * Remove tall z-index of What's New section.
1 parent a3f7298 commit e3c9f26

File tree

4 files changed

+35
-51
lines changed

4 files changed

+35
-51
lines changed

components/navigation/chatSticky.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ import styles from "./chatSticky.module.css";
55
const ChatSticky = () => {
66
return (
77
<div className={classNames(styles.Container)}>
8-
<nav className={styles.Navigation} id="chat-sticky">
9-
<section className={styles.NavigationContainer}>
10-
<Kapa />
11-
</section>
12-
</nav>
8+
<Kapa />
139
</div>
1410
);
1511
};
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
.Container {
2-
@apply fixed bottom-[30px] w-full z-10;
3-
}
4-
5-
.Navigation {
6-
@apply container px-2 xl:px-4 flex items-center justify-between relative transition-all mx-auto h-full left-auto;
7-
}
8-
9-
.NavigationContainer {
10-
@apply flex flex-auto justify-end;
2+
@apply fixed bottom-8 right-2 sm:right-8 z-30;
113
}

components/utilities/kapa.js

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,24 @@ const Kapa = () => {
1515
}
1616
};
1717
let kapaWidget = (
18-
<div className={styles.FooterContainer}>
19-
<section className={styles.AskButtonContainer}>
20-
<button
21-
id="kapa-ai"
22-
type="button"
23-
className={styles.AskButton}
24-
onMouseOver={showTooltip}
25-
onMouseOut={hideTooltip}
26-
>
27-
<i className={styles.AskIcon}>forum</i> Ask AI
28-
</button>
29-
{/* <div className={styles.Tooltip}>
30-
<p>Try our new docs assistant!</p>
31-
</div> */}
32-
<script
33-
src="https://widget.kapa.ai/kapa-widget.bundle.js"
34-
data-website-id="e81c2b35-6c03-4576-a56c-3c825f866e06"
35-
data-project-name="Streamlit"
36-
data-project-color="#000000"
37-
data-project-logo="https://docs.streamlit.io/logo.svg"
38-
data-modal-title="Streamlit docs assistant (beta)"
39-
data-modal-disclaimer="
18+
<>
19+
<button
20+
id="kapa-ai"
21+
type="button"
22+
className={styles.AskButton}
23+
onMouseOver={showTooltip}
24+
onMouseOut={hideTooltip}
25+
>
26+
<i className={styles.AskIcon}>forum</i> Ask AI
27+
</button>
28+
<script
29+
src="https://widget.kapa.ai/kapa-widget.bundle.js"
30+
data-website-id="e81c2b35-6c03-4576-a56c-3c825f866e06"
31+
data-project-name="Streamlit"
32+
data-project-color="#000000"
33+
data-project-logo="https://docs.streamlit.io/logo.svg"
34+
data-modal-title="Streamlit docs assistant (beta)"
35+
data-modal-disclaimer="
4036
This AI chatbot is powered by kapa.ai and public Streamlit information.
4137
Answers may be inaccurate, inefficient, or biased. Any use or decisions
4238
based on such answers should include reasonable practices including
@@ -52,16 +48,15 @@ const Kapa = () => {
5248
“Content”) may be used by Streamlit and kapa.ai to provide, maintain,
5349
develop, and improve their respective offerings. For more information on how
5450
kapa.ai may use your Content, see https://www.kapa.ai/content/terms-of-service."
55-
data-button-hide="true"
56-
data-modal-override-open-id="kapa-ai"
57-
data-modal-lock-scroll="false"
58-
data-modal-border-radius="6px"
59-
data-modal-image-height="18px"
60-
data-answer-feedback-button-active-border="1px solid #808495"
61-
data-user-analytics-cookie-enabled="false"
62-
></script>
63-
</section>
64-
</div>
51+
data-button-hide="true"
52+
data-modal-override-open-id="kapa-ai"
53+
data-modal-lock-scroll="false"
54+
data-modal-border-radius="6px"
55+
data-modal-image-height="18px"
56+
data-answer-feedback-button-active-border="1px solid #808495"
57+
data-user-analytics-cookie-enabled="false"
58+
></script>
59+
</>
6560
);
6661

6762
return kapaWidget;

components/utilities/kapa.module.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@
2222
}
2323
}
2424

25-
.AskButtonContainer {
26-
@apply flex justify-end;
27-
}
28-
2925
.AskButton {
30-
@apply flex items-center justify-center p-0 rounded-md h-8 px-4 cursor-pointer bg-gray-100 text-white hover:opacity-90 hover:shadow-sm;
26+
@apply flex items-center justify-center
27+
rounded-md
28+
h-8
29+
py-0 px-4
30+
cursor-pointer
31+
bg-gray-100 text-white hover:opacity-90 hover:shadow-sm;
3132
animation: wiggle 2s 1;
3233
}
3334

0 commit comments

Comments
 (0)