@autobusal/common 0.0.13 → 0.0.15

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.
package/BackTo.tsx ADDED
@@ -0,0 +1,35 @@
1
+ import { TFunction } from 'i18next';
2
+ import { Link } from 'react-router-dom';
3
+ import styled from 'styled-components';
4
+ import { BiChevronLeftCircle } from 'react-icons/bi';
5
+
6
+ interface Props {
7
+ to: string
8
+ t: TFunction<'general'>
9
+ }
10
+
11
+ const LinkStyled = styled(Link)`
12
+ display: inline-flex;
13
+ gap: 5px;
14
+ align-items: center;
15
+ padding: 4px 12px;
16
+ font-size: calc(${ props => props.theme.size.info } - 1px);
17
+ text-transform: uppercase;
18
+ background: ${ props => props.theme.neutral };
19
+ border-radius: ${ props => props.theme.borderRadius };
20
+ transition: all 0.3s ease;
21
+
22
+ &:hover {
23
+ text-decoration: none;
24
+ background: ${ props => props.theme.primaryTransparent };
25
+ }
26
+ `;
27
+
28
+ const BackTo = ({ to, t }: Props): JSX.Element => (
29
+ <LinkStyled to={ to }>
30
+ <BiChevronLeftCircle />
31
+ { t('general:back') }
32
+ </LinkStyled>
33
+ );
34
+
35
+ export default BackTo;
package/Meta.tsx CHANGED
@@ -4,7 +4,7 @@ interface Props {
4
4
  title: string
5
5
  keywords?: string
6
6
  description?: string
7
- children: JSX.Element | JSX.Element[] | string | null | false
7
+ children: JSX.Element | JSX.Element[] | string | null | false | boolean
8
8
  }
9
9
 
10
10
  const Meta = ({ title, keywords, description, children }: Props): JSX.Element => (
package/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import BackTo from './BackTo';
1
2
  import CookieNotification from './CookieNotification/CookieNotification';
2
3
  import ChangeLanguage from './ChangeLanguage/ChangeLanguage';
3
4
  import { Button } from './Button/Button';
@@ -6,6 +7,7 @@ import Modal from './Modal/Modal';
6
7
  import Meta from './Meta';
7
8
 
8
9
  export {
10
+ BackTo,
9
11
  Button,
10
12
  CookieNotification,
11
13
  ChangeLanguage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/common",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "dependencies": {
@@ -11,6 +11,7 @@
11
11
  "react-helmet": "^6.1.0",
12
12
  "react-icons": "^5.0.1",
13
13
  "react-loading-skeleton": "^3.3.1",
14
+ "react-router-dom": "^6.21.3",
14
15
  "spinners-react": "^1.0.7",
15
16
  "styled-components": "^6.1.8"
16
17
  }