@autobusal/common 0.0.34 → 0.0.36
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.
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Item, LinkLogo, ContainerLogo, About, LinkCompany, ContainerCompany, Description } from './styles';
|
|
2
|
+
import { OperatorData } from '@autobusal/providers/types/operators';
|
|
3
|
+
import { AgentData } from '@autobusal/providers/types/agents';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
item: OperatorData | AgentData
|
|
7
|
+
type: 'agent' | 'operator'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const BrowseCompanyItem = ({ item, type }: Props): JSX.Element => {
|
|
11
|
+
const isColumn = item.column === 1;
|
|
12
|
+
const isBanner = item.banner === 1;
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Item className="box" $column={ isColumn } $banner={ isBanner }>
|
|
16
|
+
{ type === 'operator'
|
|
17
|
+
? (
|
|
18
|
+
<LinkLogo to={ item.link }>
|
|
19
|
+
<img src={ item.logo_url } />
|
|
20
|
+
</LinkLogo>
|
|
21
|
+
)
|
|
22
|
+
: (
|
|
23
|
+
<ContainerLogo>
|
|
24
|
+
<img src={ item.logo_url } />
|
|
25
|
+
</ContainerLogo>
|
|
26
|
+
) }
|
|
27
|
+
|
|
28
|
+
<About $banner={ isBanner }>
|
|
29
|
+
{ type === 'operator'
|
|
30
|
+
? <LinkCompany to={ item.link }>{ item.company }</LinkCompany>
|
|
31
|
+
: <ContainerCompany>{ item.company }</ContainerCompany>
|
|
32
|
+
}
|
|
33
|
+
<Description>{ item.description }</Description>
|
|
34
|
+
</About>
|
|
35
|
+
</Item>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default BrowseCompanyItem;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
export const Item = styled.div<{
|
|
5
|
+
$column: boolean
|
|
6
|
+
$banner: boolean
|
|
7
|
+
}>`
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 10px;
|
|
11
|
+
align-items: center;
|
|
12
|
+
flex-basis: 100%;
|
|
13
|
+
padding: 10px;
|
|
14
|
+
|
|
15
|
+
${ props => props.$column === false && css`
|
|
16
|
+
background: none;
|
|
17
|
+
box-shadow: none;
|
|
18
|
+
` }
|
|
19
|
+
|
|
20
|
+
@media (min-width: 480px) {
|
|
21
|
+
flex-basis: calc(50% - 10px);
|
|
22
|
+
|
|
23
|
+
${ props => props.$banner && css`
|
|
24
|
+
flex-basis: 100% !important;
|
|
25
|
+
flex-direction: row !important;
|
|
26
|
+
gap: 15px !important;
|
|
27
|
+
` }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (min-width: 768px) {
|
|
31
|
+
flex-basis: calc(33.3333% - 14px);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media (min-width: 1024px) {
|
|
35
|
+
flex-basis: calc(25% - 15px);
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
const LogoCss = css`
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
|
|
43
|
+
& > img {
|
|
44
|
+
display: block;
|
|
45
|
+
width: 120px;
|
|
46
|
+
border-radius: ${ props => props.theme.borderRadius };
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
export const LinkLogo = styled(Link)`
|
|
51
|
+
${ LogoCss }
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
export const ContainerLogo = styled.div`
|
|
55
|
+
${ LogoCss }
|
|
56
|
+
`;
|
|
57
|
+
|
|
58
|
+
export const About = styled.div<{ $banner: boolean }>`
|
|
59
|
+
display: flex;
|
|
60
|
+
gap: 2px;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
align-items: center;
|
|
63
|
+
|
|
64
|
+
@media (min-width: 480px) {
|
|
65
|
+
${ props => props.$banner && css`
|
|
66
|
+
align-items: flex-start !important;
|
|
67
|
+
` }
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
export const LinkCompany = styled(Link)`
|
|
72
|
+
font-weight: 700;
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
export const ContainerCompany = styled.div`
|
|
76
|
+
font-weight: 700;
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
export const Description = styled.div`
|
|
80
|
+
color: ${ props => props.theme.font.faded };
|
|
81
|
+
font-size: ${ props => props.theme.size.s };
|
|
82
|
+
`;
|
package/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import Autocomplete from './Autocomplete/Autocomplete';
|
|
2
2
|
import BackTo from './BackTo';
|
|
3
|
+
import BlogItem from './BlogItem/BlogItem';
|
|
4
|
+
import BrowseCompanyItem from './BrowseCompanyItem/BrowseCompanyItem';
|
|
3
5
|
import Calendar from './Calendar/Calendar';
|
|
4
6
|
import CookieNotification from './CookieNotification/CookieNotification';
|
|
5
7
|
import ChangeLanguage from './ChangeLanguage/ChangeLanguage';
|
|
@@ -18,6 +20,8 @@ import RouteItem from './RouteItem/RouteItem';
|
|
|
18
20
|
export {
|
|
19
21
|
Autocomplete,
|
|
20
22
|
BackTo,
|
|
23
|
+
BlogItem,
|
|
24
|
+
BrowseCompanyItem,
|
|
21
25
|
Button,
|
|
22
26
|
Calendar,
|
|
23
27
|
CookieNotification,
|