@vincentgraul/react-components 1.0.30 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CountrySelector.d.ts","sourceRoot":"","sources":["../../src/country-selector/CountrySelector.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAI9D,UAAU,KAAK;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"CountrySelector.d.ts","sourceRoot":"","sources":["../../src/country-selector/CountrySelector.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAI9D,UAAU,KAAK;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,KAAK,2CA6CnD"}
|
|
@@ -12,8 +12,14 @@ import { useEffect, useState } from "react";
|
|
|
12
12
|
import Select from "../select/Select";
|
|
13
13
|
import { capitalize } from "@vincentgraul/utils/word";
|
|
14
14
|
export default function CountrySelector(props) {
|
|
15
|
-
const { className, languages, onChange } = props;
|
|
15
|
+
const { className, languages, onChange, flagWidth = "30px" } = props;
|
|
16
16
|
const [options, setOptions] = useState(null);
|
|
17
|
+
const FlagStyle = {
|
|
18
|
+
display: "block",
|
|
19
|
+
width: flagWidth,
|
|
20
|
+
margin: "auto",
|
|
21
|
+
borderRadius: "2px",
|
|
22
|
+
};
|
|
17
23
|
useEffect(() => {
|
|
18
24
|
const fetchIcon = (name) => __awaiter(this, void 0, void 0, function* () {
|
|
19
25
|
const { default: Flag } = yield import(`./icons/${capitalize(name)}.js`);
|
|
@@ -35,9 +41,3 @@ export default function CountrySelector(props) {
|
|
|
35
41
|
}
|
|
36
42
|
return (_jsx(Select, { className: `country-selector ${className}`, options: options, onChange: onChange }));
|
|
37
43
|
}
|
|
38
|
-
const FlagStyle = {
|
|
39
|
-
display: "block",
|
|
40
|
-
width: "30px",
|
|
41
|
-
margin: "auto",
|
|
42
|
-
borderRadius: "2px",
|
|
43
|
-
};
|