Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit 6ffa416

Browse files
committed
Revert to showing single sample conversations on loading landing page
The visual jitter at regular intervals is hard to constrain. The height changes based on the amount of text in each conversation sample and the viewport size. Keep it simple for now. Later move to showing the tabbed view like on the Whatsapp page
1 parent ffea83f commit 6ffa416

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/pages/Home.tsx

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
import '../styles/Home.css';
2-
import { useState, useEffect } from 'react';
32
import { Button } from 'antd';
43
import { Link } from "react-router-dom";
54
import { DISCORD_LINK, DEV_DOCS, CLOUD_LINK } from '../common/constants';
65
import ChatBubbles from '../components/ChatBubbles';
76
import IconDisplay from '../components/IconsDisplay';
87

98
export function Home() {
10-
const [currentConversationIndex, setCurrentConversationIndex] = useState(0);
11-
12-
useEffect(() => {
13-
const intervalId = setInterval(() => {
14-
setCurrentConversationIndex((currentConversationIndex + 1) % conversationSamples.length);
15-
}, 15000); // Change conversation every 5 seconds
16-
17-
// Clear interval on component unmount
18-
return () => clearInterval(intervalId);
19-
}, [currentConversationIndex]);
209

2110
function copyToClipboardAction() {
2211
const codeSnippetElements = document.getElementsByClassName('self-host-code');
@@ -75,6 +64,10 @@ export function Home() {
7564
]
7665
]
7766

67+
function getRandomConvo() {
68+
return conversationSamples[Math.floor(Math.random() * conversationSamples.length)];
69+
}
70+
7871
return (
7972
<section className='core-page'>
8073
<div className='hero-container'>
@@ -103,7 +96,7 @@ export function Home() {
10396
</div>
10497
<div className='hero-container-right'>
10598
<div className='product-description-bubbles'>
106-
<ChatBubbles conversation={conversationSamples[currentConversationIndex]} />
99+
<ChatBubbles conversation={getRandomConvo()} />
107100
</div>
108101
</div>
109102
</div>

0 commit comments

Comments
 (0)