Advertisement
VladNitu

chatGPT_Problema_Ciacu

Jun 5th, 2023
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. // ...existing imports
  2.  
  3. export default function HelpPage() {
  4. // ...existing code
  5.  
  6. const [cardIsExpanded, setCardIsExpanded] = useState([]);
  7. const [isClickable, setIsClickable] = useState(true); // Add new state for controlling clickability
  8.  
  9. const handleCardClick = (index) => {
  10. if (isClickable) {
  11. setIsClickable(false); // Disable clickability
  12. setCardIsExpanded((prevExpanded) => {
  13. const expanded = [...prevExpanded];
  14. expanded[index] = !expanded[index];
  15. return expanded;
  16. });
  17. setTimeout(() => {
  18. setIsClickable(true); // Enable clickability after 1 second
  19. }, 1000);
  20. }
  21. };
  22.  
  23. // ...existing code
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement