update src/index.scss

master
mahdi 3 years ago
parent 6df562137d
commit 2a5156a6ba
  1. 16
      src/components/RadioButton/Radio1/index.js
  2. 25
      src/components/RadioButton/index.js

@ -0,0 +1,16 @@
// it has style inside index.scss ---> // Start Radio1 Component && end Radio1 Component
import React from "react";
export default function Radio1(props) {
return (
<div className="container">
<div className="radio flex items-center">
<input id="radio-1" name={props.name} type="radio" />
<label htmlFor="radio-1" className="radio-label text-xs">
{props.label}
</label>
</div>
</div>
);
}

@ -0,0 +1,25 @@
import React, { useState } from "react";
import Design1 from "./Design1";
function Advertisements() {
const list = {
1: <Design1 />,
};
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 Advertisements;
Loading…
Cancel
Save