diff --git a/app/src/components/support/Card.jsx b/app/src/components/support/Card.jsx new file mode 100644 index 0000000..f1f0415 --- /dev/null +++ b/app/src/components/support/Card.jsx @@ -0,0 +1,31 @@ +import React from "react"; + +const Card = ({ cardName, description }) => { + return ( +
+
+

{cardName}

+

{description}

+
+ +
+ ); +}; + +export default Card; diff --git a/app/src/main.jsx b/app/src/main.jsx index 5cc5991..f18b0f0 100644 --- a/app/src/main.jsx +++ b/app/src/main.jsx @@ -1,10 +1,10 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './App' -import './index.css' +import React from "react"; +import ReactDOM from "react-dom/client"; +import App from "./App"; +import "./index.css"; -ReactDOM.createRoot(document.getElementById('root')).render( +ReactDOM.createRoot(document.getElementById("root")).render( - , -) + +); diff --git a/app/src/pages/Support.jsx b/app/src/pages/Support.jsx index e89b508..824a8b6 100644 --- a/app/src/pages/Support.jsx +++ b/app/src/pages/Support.jsx @@ -1,16 +1,92 @@ +import React, { useState } from "react"; +import Card from "../components/support/Card"; const Support = () => { + const [searchQuery, setSearchQuery] = useState(""); + const [originalCards] = useState([ + { + cardName: "Stocks", + description: + "Explore frequently asked questions related to stock trading.", + }, + { + cardName: "Cryptocurrencies", + description: + "Discover frequently asked questions about cryptocurrencies.", + }, + { + cardName: "News", + description: + "Stay updated with frequently asked questions about the latest news.", + }, + { + cardName: "NFT", + description: + "Learn about frequently asked questions regarding Non-Fungible Tokens (NFTs).", + }, + { + cardName: "Trade", + description: + "Get answers to frequently asked questions about trading strategies.", + }, + { + cardName: "Institutional", + description: + "Find information on frequently asked questions related to institutional investments.", + }, + ]); + + const [filteredCards, setFilteredCards] = useState(originalCards); + + const handleSearchChange = (query) => { + setSearchQuery(query); + + // Search query ke basis par cards ko filter karein + const filtered = originalCards.filter((card) => + card.cardName.toLowerCase().includes(query.toLowerCase()) + ); + setFilteredCards(filtered); + }; + return (
-

Support

-

- Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cupiditate, - placeat blanditiis, est non atque cum aut ratione pariatur quas eligendi - iure earum illo quos aspernatur beatae nesciunt expedita. Quidem nam ad - illo blanditiis optio consequuntur quis veritatis laudantium cum - consectetur animi magni nemo eveniet, reiciendis expedita, aperiam - laborum ut quaerat? -

+
+
+ + + + + handleSearchChange(e.target.value)} + className="dark:bg-slate-800 dark:text-white h-14 w-full rounded-md py-4 pr-40 pl-12 outline-none focus:ring-2 ring-slate-900/[.50] dark:ring-0 " + placeholder="Search here" + /> +
+
+ +
+ {filteredCards.map((card, index) => ( + + ))} +
); };