Skip to content

Commit f190093

Browse files
LianaHusAniket-Engg
authored andcommitted
removing tooltip og ai bot after 5 sec:wq
1 parent 23de490 commit f190093

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

libs/remix-ui/statusbar/src/lib/components/aiStatus.tsx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ export default function AIStatus(props: AIStatusProps) {
2424

2525
}, [])
2626

27+
const [visible, setVisible] = useState(true);
28+
29+
useEffect(() => {
30+
// Set a timeout to make UI message disappear after 3 seconds
31+
const timer = setTimeout(() => {
32+
setVisible(false);
33+
}, 5000);
34+
35+
return () => clearTimeout(timer);
36+
}, []);
37+
2738
useEffect(() => {
2839
const run = async () => {
2940
props.plugin.on('settings', 'copilotChoiceUpdated', async (isChecked) => {
@@ -66,14 +77,16 @@ export default function AIStatus(props: AIStatusProps) {
6677
color: 'var(--ai)',
6778
alignItems: 'self-end',
6879
}}>
69-
<span className='p-1 text-info alert alert-secondary' style={{
70-
boxShadow: "0 1px 7px var(--secondary)",
71-
zIndex: '200',
72-
marginRight: '1.8rem',
73-
marginBottom: '-7px'
74-
}}>
75-
👋 I'm here to help you!
76-
</span>
80+
{ visible &&
81+
<span className='p-1 text-info alert alert-secondary' style={{
82+
boxShadow: "0 1px 7px var(--secondary)",
83+
zIndex: '200',
84+
marginRight: '1.8rem',
85+
marginBottom: '-7px'
86+
}}>
87+
👋 I'm here to help you!
88+
</span>
89+
}
7790
<button
7891
style={{
7992
backgroundColor: 'var(--brand-dark-blue)',

0 commit comments

Comments
 (0)