Skip to content

Commit

Permalink
fix: selects
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum committed Dec 13, 2024
1 parent 7a3d999 commit 348d068
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
23 changes: 15 additions & 8 deletions packages/react-kit/src/components/form/BaseSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { checkIfValueIsEmpty } from "../../lib/object/checkIfValueIsEmpty";
import { theme } from "../../theme";
import { zIndex } from "../ui/zIndex";
import type { BaseSelectProps, SelectDataProps } from "./types";
import { useFixSelectFontSize } from "../../hooks/form/useFixSelectFontSize";

const colors = theme.colors.light;

Expand Down Expand Up @@ -59,14 +60,20 @@ export default function BaseSelect({
const handleChange = (option: SingleValue<SelectDataProps>) => {
onChange?.(option);
};

const { jsx, selectClassName } = useFixSelectFontSize({
selectClassName: "boson-base-select"
});
return (
<Select
styles={customStyles(null)}
{...props}
placeholder={placeholder}
options={options}
onChange={handleChange}
/>
<>
{jsx}
<Select
styles={customStyles(null)}
{...props}
className={selectClassName}
placeholder={placeholder}
options={options}
onChange={handleChange}
/>
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Typography } from "../../../../ui/Typography";
import { FormModel } from "../RedeemFormModel";
import { subgraph } from "@bosonprotocol/core-sdk";
import { Select } from "../../../../form";
import BaseSelect from "../../../../form/BaseSelect";
interface Props {
offer: subgraph.OfferFieldsFragment | null;
isValid: boolean;
Expand Down Expand Up @@ -147,6 +148,7 @@ export default function RedeemForm({
countries={fatfMemberCountries}
/>
</Grid>
<BaseSelect options={[{ label: "hola2", value: "hola" }]} />
<Grid flexDirection="column" alignItems="flex-start">
<Input
name={FormModel.formFields.email.name}
Expand Down

0 comments on commit 348d068

Please sign in to comment.