Skip to content
Snippets Groups Projects
Commit fad8948e authored by Aggarwal Himanshu's avatar Aggarwal Himanshu
Browse files

Make radio components modular

parent d66060c9
No related branches found
No related tags found
2 merge requests!17Merge develop into main,!15Modular components
......@@ -2,7 +2,7 @@ import { ArrowRightIcon } from "@heroicons/react/outline";
import classNames from "classnames";
import React, { useState, useEffect, useRef } from "react";
import Button from "../button/Button";
import { RadioInputForm } from "../radio/RadioForm";
import RadioInputForm from "../radio/RadioForm";
import { CSSTransition } from "react-transition-group";
export function FilterDropdown({
......
import React from "react";
import classNames from "classnames";
function Radio({ selected, radioValue, radioLabel, onChange }) {
return (
<label className="inline-flex items-center w-full">
<input
type="radio"
className="form-radio h-4 w-4 accent-indigo-600 hover:accent-indigo-700"
value={radioValue}
checked={selected === radioValue}
onChange={onChange}
/>
<span
className={classNames("font-poppins ml-2 text-base", {
"dark:text-white font-extralight": selected !== radioValue,
"dark:text-indigo-500": selected === radioValue,
})}
>
{radioLabel}
</span>
</label>
);
}
export default Radio;
import classNames from "classnames";
import React from "react";
import Input from "../inputs/Input";
import Radio from "./Radio";
export function RadioInputForm({
function RadioInputForm({
inputLeftSymbol,
inputRightSymbol,
inputType,
......@@ -46,24 +46,4 @@ export function RadioInputForm({
);
}
export function Radio({ selected, radioValue, radioLabel, onChange }) {
return (
<label className="inline-flex items-center w-full">
<input
type="radio"
className="form-radio h-4 w-4 accent-indigo-600 hover:accent-indigo-700"
value={radioValue}
checked={selected === radioValue}
onChange={onChange}
/>{" "}
<span
className={classNames("font-poppins ml-2 text-base", {
"dark:text-white font-extralight": selected !== radioValue,
"dark:text-indigo-500": selected === radioValue,
})}
>
{radioLabel}
</span>
</label>
);
}
export default RadioInputForm;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment