update data.js

master
mahdi 3 years ago
parent 6165264f15
commit 6df562137d
  1. 25
      src/components/QuestionAnswer/index.js
  2. 11
      src/redux/data.js

@ -0,0 +1,25 @@
import React, { useState } from "react";
import QandA from "./QandA";
function QuestionAnswer() {
const list = {
1: <QandA />,
};
const [type, setType] = useState(1);
return (
<div className="w-full flex flex-col items-center">
<select
className="mb-10 w-20 bg-gray-200"
onChange={(e) => setType(e.target.value)}
>
{Object.keys(list).map((option, index) => (
<option key={index}>{option}</option>
))}
</select>
{list[type]}
</div>
);
}
export default QuestionAnswer;

@ -27,6 +27,7 @@ import Rating from "../components/Rating";
import Tooltip from "../components/Tooltip";
import ProductSuggestionCard from "../components/ProductSuggestionCard";
import ProductDescriptionTable from "../components/ProductDescriptionTable";
import QuestionAnswer from "../components/QuestionAnswer";
// mini components
import MiniComponents from "../components/MiniComponents";
@ -610,6 +611,16 @@ const components = [
code: null,
},
},
{
name: "QandA",
author: "Ashrafi",
props: [],
content: {
name: "QandA",
component: <QuestionAnswer />,
code: null,
},
},
// mini components
{
name: "Mini Components",

Loading…
Cancel
Save