Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ...existing imports
- export default function HelpPage() {
- // ...existing code
- const [cardIsExpanded, setCardIsExpanded] = useState([]);
- const [isClickable, setIsClickable] = useState(true); // Add new state for controlling clickability
- const handleCardClick = (index) => {
- if (isClickable) {
- setIsClickable(false); // Disable clickability
- setCardIsExpanded((prevExpanded) => {
- const expanded = [...prevExpanded];
- expanded[index] = !expanded[index];
- return expanded;
- });
- setTimeout(() => {
- setIsClickable(true); // Enable clickability after 1 second
- }, 1000);
- }
- };
- // ...existing code
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement