- Added more panels and lists;

- Added the ability to view more information on the user;
- Added the ability to update the user's expiry date
This commit is contained in:
Tiago Ribeiro
2023-10-26 22:41:24 +01:00
parent 8515eaf4ee
commit bdb0ffde95
7 changed files with 563 additions and 71 deletions

View File

@@ -6,7 +6,8 @@ import countryCodes from "country-codes-list";
interface Props {
value?: string;
onChange: (value: string) => void;
onChange?: (value: string) => void;
disabled?: boolean;
}
const mapCountries = (codes: string[]) => {
@@ -18,7 +19,7 @@ const mapCountries = (codes: string[]) => {
}));
};
export default function CountrySelect({value, onChange}: Props) {
export default function CountrySelect({value, disabled = false, onChange}: Props) {
const [query, setQuery] = useState("");
const filteredCountries =
@@ -32,11 +33,11 @@ export default function CountrySelect({value, onChange}: Props) {
return (
<>
<Combobox value={value} onChange={onChange}>
<Combobox value={value} onChange={onChange} disabled={disabled}>
<div className="relative mt-1">
<div className="relative w-full cursor-default overflow-hidden ">
<Combobox.Input
className="py-6 w-full px-8 text-sm font-normal placeholder:text-mti-gray-cool bg-white rounded-full border border-mti-gray-platinum focus:outline-none"
className="py-6 w-full px-8 text-sm font-normal placeholder:text-mti-gray-cool bg-white disabled:bg-mti-gray-platinum/40 rounded-full border border-mti-gray-platinum focus:outline-none"
onChange={(e) => setQuery(e.target.value)}
displayValue={(code: string) => {
const country = countries[code as unknown as keyof TCountries];