Skip to content

Commit

Permalink
removing tooltip og ai bot after 5 sec:wq
Browse files Browse the repository at this point in the history
  • Loading branch information
LianaHus authored and Aniket-Engg committed Dec 2, 2024
1 parent 23de490 commit f190093
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions libs/remix-ui/statusbar/src/lib/components/aiStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ export default function AIStatus(props: AIStatusProps) {

}, [])

const [visible, setVisible] = useState(true);

useEffect(() => {
// Set a timeout to make UI message disappear after 3 seconds
const timer = setTimeout(() => {
setVisible(false);
}, 5000);

return () => clearTimeout(timer);
}, []);

useEffect(() => {
const run = async () => {
props.plugin.on('settings', 'copilotChoiceUpdated', async (isChecked) => {
Expand Down Expand Up @@ -66,14 +77,16 @@ export default function AIStatus(props: AIStatusProps) {
color: 'var(--ai)',
alignItems: 'self-end',
}}>
<span className='p-1 text-info alert alert-secondary' style={{
boxShadow: "0 1px 7px var(--secondary)",
zIndex: '200',
marginRight: '1.8rem',
marginBottom: '-7px'
}}>
👋 I'm here to help you!
</span>
{ visible &&
<span className='p-1 text-info alert alert-secondary' style={{
boxShadow: "0 1px 7px var(--secondary)",
zIndex: '200',
marginRight: '1.8rem',
marginBottom: '-7px'
}}>
👋 I'm here to help you!
</span>
}
<button
style={{
backgroundColor: 'var(--brand-dark-blue)',
Expand Down

0 comments on commit f190093

Please sign in to comment.