@autobusal/common 0.0.23 → 0.0.25

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.
Files changed (3) hide show
  1. package/Gender.tsx +39 -0
  2. package/index.ts +4 -0
  3. package/package.json +1 -1
package/Gender.tsx ADDED
@@ -0,0 +1,39 @@
1
+ import { TFunction } from 'i18next';
2
+ import { UseFormRegister } from 'react-hook-form';
3
+
4
+ interface Props {
5
+ name: string
6
+ defaultValue?: number
7
+ t: TFunction<'common'>
8
+ refs: UseFormRegister<any>
9
+ }
10
+
11
+ const Gender = ({ name, defaultValue, t, refs }: Props) => (
12
+ <div className="row">
13
+ <div className="list">
14
+ <label>
15
+ <input
16
+ type="radio"
17
+ value={ 0 }
18
+ defaultChecked={ defaultValue === undefined || defaultValue == 0 }
19
+ { ...refs(name) }
20
+ />
21
+
22
+ { t('data.gender.male') }
23
+ </label>
24
+
25
+ <label>
26
+ <input
27
+ type="radio"
28
+ value={ 1 }
29
+ defaultChecked={ defaultValue == 1 }
30
+ { ...refs(name) }
31
+ />
32
+
33
+ { t('data.gender.female') }
34
+ </label>
35
+ </div>
36
+ </div>
37
+ );
38
+
39
+ export default Gender;
package/index.ts CHANGED
@@ -4,11 +4,13 @@ import Calendar from './Calendar/Calendar';
4
4
  import CookieNotification from './CookieNotification/CookieNotification';
5
5
  import ChangeLanguage from './ChangeLanguage/ChangeLanguage';
6
6
  import { Button } from './Button/Button';
7
+ import Gender from './Gender';
7
8
  import { General, Inline, Paragraph } from './Loading/Loading';
8
9
  import Modal from './Modal/Modal';
9
10
  import Meta from './Meta';
10
11
  import Pagination from './Pagination/Pagination';
11
12
  import Passengers from './Passengers/Passengers';
13
+ import Policy from './Policy/Policy';
12
14
  import RouteFeature from './RouteFeature/RouteFeature';
13
15
  import RouteItem from './RouteItem/RouteItem';
14
16
 
@@ -19,6 +21,7 @@ export {
19
21
  Calendar,
20
22
  CookieNotification,
21
23
  ChangeLanguage,
24
+ Gender,
22
25
  General,
23
26
  Inline,
24
27
  Meta,
@@ -26,6 +29,7 @@ export {
26
29
  Pagination,
27
30
  Paragraph,
28
31
  Passengers,
32
+ Policy,
29
33
  RouteFeature,
30
34
  RouteItem
31
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/common",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "type": "module",
5
5
  "main": "index.ts"
6
6
  }