@mindly/ui-components 3.1.4 → 3.1.6
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/dist/index.ts +88 -0
- package/dist/lib/AppHeader/AppHeader.style.ts +19 -0
- package/dist/lib/AppHeader/AppHeader.tsx +23 -0
- package/dist/lib/AppHeader/index.ts +1 -0
- package/dist/lib/Avatar/Avatar.style.ts +17 -0
- package/dist/lib/Avatar/Avatar.tsx +46 -0
- package/dist/lib/Avatar/index.ts +1 -0
- package/dist/lib/Container/Container.styled.ts +15 -0
- package/dist/lib/Container/Container.tsx +15 -0
- package/dist/lib/Container/index.ts +1 -0
- package/dist/lib/EntryNotFound/EntryNotFound.style.ts +14 -0
- package/dist/lib/EntryNotFound/EntryNotFound.tsx +21 -0
- package/dist/lib/EntryNotFound/calendar.svg +69 -0
- package/dist/lib/EntryNotFound/index.ts +1 -0
- package/dist/lib/Filters/ListSelect/ListSelect.style.ts +38 -0
- package/dist/lib/Filters/ListSelect/ListSelect.tsx +48 -0
- package/dist/lib/Filters/ListSelect/index.ts +1 -0
- package/dist/lib/Filters/Range/Range.style.ts +41 -0
- package/dist/lib/Filters/Range/Range.tsx +48 -0
- package/dist/lib/Filters/Range/index.ts +1 -0
- package/dist/lib/Filters/RowSelect/RowSelect.style.ts +30 -0
- package/dist/lib/Filters/RowSelect/RowSelect.tsx +38 -0
- package/dist/lib/Filters/RowSelect/index.ts +1 -0
- package/dist/lib/Filters/Toggle/Toggle.style.ts +14 -0
- package/dist/lib/Filters/Toggle/Toggle.tsx +26 -0
- package/dist/lib/Filters/Toggle/index.ts +1 -0
- package/dist/lib/HorisontalCalendar/HorizontalCalendar.styled.ts +117 -0
- package/dist/lib/HorisontalCalendar/HorizontalCalendar.tsx +213 -0
- package/dist/lib/HorisontalCalendar/index.ts +1 -0
- package/dist/lib/ImageWithFallback/ImageWithFallback.tsx +37 -0
- package/dist/lib/LetterAvatar/LetterAvatar.styled.ts +32 -0
- package/dist/lib/LetterAvatar/LetterAvatar.tsx +23 -0
- package/dist/lib/Modal/Modal.style.ts +12 -0
- package/dist/lib/Modal/Modal.tsx +30 -0
- package/dist/lib/Modal/index.ts +1 -0
- package/dist/lib/ModalCalendar/ModalCalendar.styled.ts +123 -0
- package/dist/lib/ModalCalendar/ModalCalendar.tsx +71 -0
- package/dist/lib/PersonDateTimeCard/PersonDateTimeCard.styled.ts +36 -0
- package/dist/lib/PersonDateTimeCard/PersonDateTimeCard.tsx +32 -0
- package/dist/lib/Segment/Segment.style.ts +14 -0
- package/dist/lib/Segment/Segment.tsx +29 -0
- package/dist/lib/Segment/index.ts +2 -0
- package/dist/lib/Segment/types.ts +4 -0
- package/dist/lib/SelectImpressionEmoji/ImpressionEmojiEnum.ts +9 -0
- package/dist/lib/SelectImpressionEmoji/SelectImpressionEmoji.styled.ts +28 -0
- package/dist/lib/SelectImpressionEmoji/SelectImpressionEmoji.tsx +56 -0
- package/dist/lib/SelectImpressionEmoji/SelectImpressionEmojiProps.ts +8 -0
- package/dist/lib/SelectImpressionEmoji/emojis.ts +9 -0
- package/dist/lib/SelectImpressionEmoji/index.tsx +14 -0
- package/dist/lib/Theme/global.css +251 -0
- package/dist/lib/Theme/mindly_constants.ts +23 -0
- package/dist/lib/UsersPsychologistScrollList/UserPsychologistScrollList.styled.ts +61 -0
- package/dist/lib/UsersPsychologistScrollList/UsersPsychologistScrollList.tsx +68 -0
- package/dist/lib/archived-consultation-card/ArchivedConsultation.test.tsx +9 -0
- package/dist/lib/archived-consultation-card/ArchivedConsultationCard.style.ts +72 -0
- package/dist/lib/archived-consultation-card/ArchivedConsultationCard.svg +3 -0
- package/dist/lib/archived-consultation-card/ArchivedConsultationCard.tsx +61 -0
- package/dist/lib/button/Button.style.ts +170 -0
- package/dist/lib/button/Button.test.tsx +39 -0
- package/dist/lib/button/Button.tsx +47 -0
- package/dist/lib/consultation-card/ConsultationCard.style.ts +119 -0
- package/dist/lib/consultation-card/ConsultationCard.test.tsx +65 -0
- package/dist/lib/consultation-card/ConsultationCard.tsx +155 -0
- package/dist/lib/consultation-card/ConsultationCardSkeleton.tsx +114 -0
- package/dist/lib/consultation-card/index.ts +2 -0
- package/dist/lib/content-card/ContentCard.style.ts +59 -0
- package/dist/lib/content-card/ContentCard.test.tsx +29 -0
- package/dist/lib/content-card/ContentCard.tsx +81 -0
- package/dist/lib/date-picker/DatePicker.style.ts +52 -0
- package/dist/lib/date-picker/DatePicker.test.tsx +9 -0
- package/dist/lib/date-picker/DatePicker.tsx +59 -0
- package/dist/lib/floating-button/FloatingButton.style.ts +21 -0
- package/dist/lib/floating-button/FloatingButton.test.tsx +9 -0
- package/dist/lib/floating-button/FloatingButton.tsx +29 -0
- package/dist/lib/floating-button/floating button.svg +6 -0
- package/dist/lib/footer-for-booking/FooterForBooking.style.ts +56 -0
- package/dist/lib/footer-for-booking/FooterForBooking.test.tsx +30 -0
- package/dist/lib/footer-for-booking/FooterForBooking.tsx +53 -0
- package/dist/lib/input/Input.style.ts +37 -0
- package/dist/lib/input/Input.test.tsx +21 -0
- package/dist/lib/input/Input.tsx +73 -0
- package/dist/lib/list-button/ListButton.style.ts +21 -0
- package/dist/lib/list-button/ListButton.test.tsx +26 -0
- package/dist/lib/list-button/ListButton.tsx +30 -0
- package/dist/lib/navigation-bar/NavigationBar.style.ts +81 -0
- package/dist/lib/navigation-bar/NavigationBar.test.tsx +15 -0
- package/dist/lib/navigation-bar/NavigationBar.tsx +31 -0
- package/dist/lib/no-internet-connection/NoInternetConnection.style.ts +26 -0
- package/dist/lib/no-internet-connection/NoInternetConnection.svg +10 -0
- package/dist/lib/no-internet-connection/NoInternetConnection.test.tsx +9 -0
- package/dist/lib/no-internet-connection/NoInternetConnection.tsx +30 -0
- package/dist/lib/notes-card-text/NotesCardText.style.ts +14 -0
- package/dist/lib/notes-card-text/NotesCardText.tsx +32 -0
- package/dist/lib/notes-card-text/index.ts +1 -0
- package/dist/lib/notes-editor/NotesEditor.styled.ts +24 -0
- package/dist/lib/notes-editor/NotesEditor.tsx +16 -0
- package/dist/lib/scroll-tabs/ScrollTabs.style.ts +19 -0
- package/dist/lib/scroll-tabs/ScrollTabs.test.tsx +9 -0
- package/dist/lib/scroll-tabs/ScrollTabs.tsx +42 -0
- package/dist/lib/tab-bar/TabBar.style.tsx +43 -0
- package/dist/lib/tab-bar/TabBar.tsx +11 -0
- package/dist/lib/therapist-card/TherapistCard.style.ts +104 -0
- package/dist/lib/therapist-card/TherapistCard.test.tsx +40 -0
- package/dist/lib/therapist-card/TherapistCard.tsx +96 -0
- package/dist/lib/therapist-information-component/TherapistInformationComponent.style.ts +40 -0
- package/dist/lib/therapist-information-component/TherapistInformationComponent.test.tsx +16 -0
- package/dist/lib/therapist-information-component/TherapistInformationComponent.tsx +51 -0
- package/dist/lib/toast/index.css +13 -0
- package/dist/lib/toast/toast.ts +17 -0
- package/dist/lib/userAppTypes.ts +261 -0
- package/dist/lib/your-local-time-block/YourLocalTimeBlock.styled.ts +28 -0
- package/dist/lib/your-local-time-block/YourLocalTimeBlock.tsx +26 -0
- package/dist/react-app-env.d.ts +1 -0
- package/dist/svg.d.ts +13 -0
- package/package.json +4 -17
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { IonSegment, IonSegmentButton } from '@ionic/react';
|
|
3
|
+
import { colorConstants } from '../Theme/mindly_constants';
|
|
4
|
+
|
|
5
|
+
export const Container = styled(IonSegment)`
|
|
6
|
+
--background: ${colorConstants.AccentTabsBgColor};
|
|
7
|
+
`;
|
|
8
|
+
|
|
9
|
+
export const Button = styled(IonSegmentButton)`
|
|
10
|
+
--background-checked: ${colorConstants.White};
|
|
11
|
+
--background-focused: ${colorConstants.White};
|
|
12
|
+
--background-hover: ${colorConstants.White};
|
|
13
|
+
--color: ${colorConstants.primaryTextColor};
|
|
14
|
+
--color-checked: ${colorConstants.primaryTextColor};
|
|
15
|
+
--color-focused: ${colorConstants.primaryTextColor};
|
|
16
|
+
--color-hover: ${colorConstants.primaryTextColor};
|
|
17
|
+
--transition: 0;
|
|
18
|
+
--indicator-transform: 0;
|
|
19
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ScrollTabs } from './ScrollTabs';
|
|
4
|
+
|
|
5
|
+
describe('Test scroll tabs', () => {
|
|
6
|
+
test('Smoke test', () => {
|
|
7
|
+
render(<ScrollTabs setActiveTab={() => false} value="video" />);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IonLabel } from '@ionic/react';
|
|
3
|
+
import { Button, Container } from './ScrollTabs.style';
|
|
4
|
+
import '../Theme/global.css';
|
|
5
|
+
|
|
6
|
+
export interface ScrollTabsProps {
|
|
7
|
+
/*
|
|
8
|
+
* Assumes passing a setter for the active tab value
|
|
9
|
+
*/
|
|
10
|
+
setActiveTab: (e?: string) => void;
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Active tab value
|
|
14
|
+
*/
|
|
15
|
+
value: 'profile' | 'video' | 'articles';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const ScrollTabs: React.FC<ScrollTabsProps> = (props) => {
|
|
19
|
+
return (
|
|
20
|
+
<Container
|
|
21
|
+
value={props.value}
|
|
22
|
+
mode="ios"
|
|
23
|
+
onIonChange={(e) => props.setActiveTab(e.detail.value)}
|
|
24
|
+
>
|
|
25
|
+
<Button value="profile" data-testid="profile">
|
|
26
|
+
<IonLabel>
|
|
27
|
+
<h5>Профіль</h5>
|
|
28
|
+
</IonLabel>
|
|
29
|
+
</Button>
|
|
30
|
+
<Button value="video" data-testid="video">
|
|
31
|
+
<IonLabel>
|
|
32
|
+
<h5>Відео</h5>
|
|
33
|
+
</IonLabel>
|
|
34
|
+
</Button>
|
|
35
|
+
<Button value="articles" data-testid="articles">
|
|
36
|
+
<IonLabel>
|
|
37
|
+
<h5>Статті</h5>
|
|
38
|
+
</IonLabel>
|
|
39
|
+
</Button>
|
|
40
|
+
</Container>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { colorConstants } from '../Theme/mindly_constants';
|
|
3
|
+
|
|
4
|
+
interface ContainerProps {
|
|
5
|
+
isIos: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const Container = styled.div<ContainerProps>`
|
|
9
|
+
display: flex;
|
|
10
|
+
box-shadow: 0px -2px 5px rgba(0, 0, 0, 0.08);
|
|
11
|
+
position: fixed;
|
|
12
|
+
bottom: -1px;
|
|
13
|
+
width: 100vw;
|
|
14
|
+
border: none;
|
|
15
|
+
padding-bottom: ${(props) => (props.isIos ? '34px' : '10px')};
|
|
16
|
+
color: ${colorConstants.secondaryTextColor};
|
|
17
|
+
padding-top: 10px;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
background: white;
|
|
20
|
+
|
|
21
|
+
div {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
align-items: center;
|
|
25
|
+
max-width: 150px;
|
|
26
|
+
flex-grow: 1;
|
|
27
|
+
flex-basis: 0;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ion-icon {
|
|
32
|
+
font-size: 28px;
|
|
33
|
+
margin: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ion-label {
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
font-size: 10px;
|
|
39
|
+
margin: 0;
|
|
40
|
+
line-height: 14px;
|
|
41
|
+
font-family: 'Lato Bold', sans-serif;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Container } from './TabBar.style';
|
|
3
|
+
|
|
4
|
+
export interface TabBarProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
isIos: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const TabBar: React.FC<TabBarProps> = (props) => {
|
|
10
|
+
return <Container isIos={props.isIos}>{props.children}</Container>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { IonIcon } from '@ionic/react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { colorConstants } from '../Theme/mindly_constants';
|
|
4
|
+
|
|
5
|
+
export const Container = styled.div`
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15);
|
|
9
|
+
position: relative;
|
|
10
|
+
padding: 11px;
|
|
11
|
+
|
|
12
|
+
@media (min-width: 600px) {
|
|
13
|
+
max-width: 452px;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
export const Card = styled.div`
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
align-content: center;
|
|
21
|
+
align-items: center;
|
|
22
|
+
|
|
23
|
+
.img-container {
|
|
24
|
+
max-height: 102px;
|
|
25
|
+
max-width: 102px;
|
|
26
|
+
flex: 1 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.card-content {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
flex: 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.img {
|
|
36
|
+
width: 102px;
|
|
37
|
+
height: 102px;
|
|
38
|
+
object-fit: cover;
|
|
39
|
+
border-radius: 4px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
h1 {
|
|
43
|
+
margin: 0px 16px 0;
|
|
44
|
+
color: ${colorConstants.primaryTextColor};
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
line-height: 20px;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
text-overflow: ellipsis;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
h3 {
|
|
53
|
+
margin: 4px 16px 0;
|
|
54
|
+
color: ${colorConstants.secondaryTextColor};
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
line-height: 16px;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
61
|
+
export const PsychologistCardIcons = styled<any>(IonIcon)`
|
|
62
|
+
// #skipcq
|
|
63
|
+
color: ${colorConstants.primaryColor};
|
|
64
|
+
font-size: 20px;
|
|
65
|
+
margin: 0;
|
|
66
|
+
|
|
67
|
+
@media (max-width: 320px) {
|
|
68
|
+
font-size: 19px;
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
|
|
72
|
+
export const IconsContainer = styled.div`
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
padding: 0;
|
|
76
|
+
margin-right: 12px;
|
|
77
|
+
margin-top: 4px;
|
|
78
|
+
|
|
79
|
+
.color-green {
|
|
80
|
+
// #skipcq
|
|
81
|
+
color: ${colorConstants.AccentTickColor};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
p {
|
|
85
|
+
color: ${colorConstants.primaryTextColor};
|
|
86
|
+
font-size: 12px;
|
|
87
|
+
line-height: 16px;
|
|
88
|
+
padding-left: 4px;
|
|
89
|
+
margin: 0;
|
|
90
|
+
font-family: 'Lato Regular', sans-serif;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
|
|
93
|
+
@media (max-width: 320px) {
|
|
94
|
+
font-size: 10.5px;
|
|
95
|
+
line-height: 14px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
|
|
100
|
+
export const InfoContainer = styled.div`
|
|
101
|
+
display: flex;
|
|
102
|
+
margin-left: 16px;
|
|
103
|
+
flex-wrap: wrap;
|
|
104
|
+
`;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TherapistCard } from './TherapistCard';
|
|
4
|
+
|
|
5
|
+
describe('Test therapist card', () => {
|
|
6
|
+
test('Smoke test', () => {
|
|
7
|
+
render(
|
|
8
|
+
<TherapistCard
|
|
9
|
+
handleClick={() => false}
|
|
10
|
+
psychologistDuration={50}
|
|
11
|
+
psychologistExperience={11}
|
|
12
|
+
psychologistLastName="Test"
|
|
13
|
+
psychologistName="User"
|
|
14
|
+
psychologistPhoto=""
|
|
15
|
+
psychologistPrice={500}
|
|
16
|
+
psychologistType="Therapist"
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test('Try click on card', () => {
|
|
22
|
+
const handleClick = jest.fn();
|
|
23
|
+
expect(handleClick).toHaveBeenCalledTimes(0);
|
|
24
|
+
render(
|
|
25
|
+
<TherapistCard
|
|
26
|
+
handleClick={handleClick}
|
|
27
|
+
psychologistDuration={50}
|
|
28
|
+
psychologistExperience={11}
|
|
29
|
+
psychologistLastName="Test"
|
|
30
|
+
psychologistName="User"
|
|
31
|
+
psychologistPhoto=""
|
|
32
|
+
psychologistPrice={500}
|
|
33
|
+
psychologistType="Therapist"
|
|
34
|
+
data-testid="container"
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
screen.getByTestId('container').click();
|
|
38
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IonSkeletonText } from '@ionic/react';
|
|
3
|
+
import { timeOutline, cardOutline, briefcaseOutline } from 'ionicons/icons';
|
|
4
|
+
import {
|
|
5
|
+
PsychologistCardIcons,
|
|
6
|
+
IconsContainer,
|
|
7
|
+
Container,
|
|
8
|
+
InfoContainer,
|
|
9
|
+
Card,
|
|
10
|
+
} from './TherapistCard.style';
|
|
11
|
+
|
|
12
|
+
export interface TherapistCardProps {
|
|
13
|
+
psychologistName: string;
|
|
14
|
+
psychologistLastName: string;
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* The direction of psychologist work
|
|
18
|
+
*/
|
|
19
|
+
psychologistType: string;
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
* Link to psychologist photo
|
|
23
|
+
*/
|
|
24
|
+
psychologistPhoto: string;
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* Consultation price
|
|
28
|
+
*/
|
|
29
|
+
psychologistPrice: number;
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* Duration of consultation
|
|
33
|
+
*/
|
|
34
|
+
psychologistDuration: number;
|
|
35
|
+
psychologistExperience: number;
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
* The function that is called when clicking on the card
|
|
39
|
+
*/
|
|
40
|
+
handleClick: (props?: React.SyntheticEvent) => void;
|
|
41
|
+
['data-testid']?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const TherapistCard: React.FC<TherapistCardProps> = (props) => {
|
|
45
|
+
const [imageLoaded, setImageLoaded] = React.useState(false);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Container data-testid={props['data-testid']} onClick={props.handleClick}>
|
|
49
|
+
<Card>
|
|
50
|
+
<div className="img-container">
|
|
51
|
+
<img
|
|
52
|
+
className="img"
|
|
53
|
+
src={props.psychologistPhoto}
|
|
54
|
+
alt="psychologistPhoto"
|
|
55
|
+
onLoad={() => setImageLoaded(true)}
|
|
56
|
+
style={{ display: imageLoaded ? 'block' : 'none' }}
|
|
57
|
+
/>
|
|
58
|
+
|
|
59
|
+
<IonSkeletonText
|
|
60
|
+
animated
|
|
61
|
+
className="img"
|
|
62
|
+
style={{ display: imageLoaded ? 'none' : 'block' }}
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div className="card-content">
|
|
67
|
+
<h1 className="bold">
|
|
68
|
+
{`${props.psychologistName} ${props.psychologistLastName}`}
|
|
69
|
+
</h1>
|
|
70
|
+
<h3 className="semiBold">{props.psychologistType}</h3>
|
|
71
|
+
<InfoContainer>
|
|
72
|
+
<IconsContainer>
|
|
73
|
+
<PsychologistCardIcons icon={timeOutline} />
|
|
74
|
+
<p className="semiBold">{`${props.psychologistDuration} хвилин`}</p>
|
|
75
|
+
</IconsContainer>
|
|
76
|
+
<IconsContainer>
|
|
77
|
+
<PsychologistCardIcons icon={briefcaseOutline} />
|
|
78
|
+
<p className="semiBold">
|
|
79
|
+
{props.psychologistExperience >= 5
|
|
80
|
+
? `${props.psychologistExperience} років досвіду`
|
|
81
|
+
: props.psychologistExperience === 1
|
|
82
|
+
? `${props.psychologistExperience} рік досвіду`
|
|
83
|
+
: `${props.psychologistExperience} роки досвіду`}
|
|
84
|
+
</p>
|
|
85
|
+
</IconsContainer>
|
|
86
|
+
<IconsContainer>
|
|
87
|
+
<PsychologistCardIcons icon={cardOutline} className="color-green" />
|
|
88
|
+
<p className="semiBold color-green">{`${props.psychologistPrice} грн`}</p>
|
|
89
|
+
</IconsContainer>
|
|
90
|
+
</InfoContainer>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
</Card>
|
|
94
|
+
</Container>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { colorConstants } from '../Theme/mindly_constants';
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
width: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
|
|
9
|
+
img {
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 222px;
|
|
12
|
+
border-radius: 8px;
|
|
13
|
+
object-fit: cover;
|
|
14
|
+
|
|
15
|
+
@media (min-width: 600px) {
|
|
16
|
+
height: auto;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (min-width: 1024px) {
|
|
20
|
+
height: auto;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
export const Info = styled.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
margin-top: 16px;
|
|
29
|
+
|
|
30
|
+
h3 {
|
|
31
|
+
color: ${colorConstants.primaryTextColor};
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
|
|
35
|
+
ion-icon {
|
|
36
|
+
margin-right: 4px;
|
|
37
|
+
font-size: 24px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TherapistInformationComponent } from './TherapistInformationComponent';
|
|
4
|
+
|
|
5
|
+
describe('Test therapist information component', () => {
|
|
6
|
+
test('Smoke test', () => {
|
|
7
|
+
render(
|
|
8
|
+
<TherapistInformationComponent
|
|
9
|
+
price="1200 грн"
|
|
10
|
+
avatar=""
|
|
11
|
+
duration="50 хв"
|
|
12
|
+
experience="4 роки"
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Container, Info } from './TherapistInformationComponent.style';
|
|
3
|
+
import { timeOutline, cardOutline, briefcaseOutline } from 'ionicons/icons';
|
|
4
|
+
import { IonIcon } from '@ionic/react';
|
|
5
|
+
import '../Theme/global.css';
|
|
6
|
+
|
|
7
|
+
export interface TherapistInformationComponentProps {
|
|
8
|
+
/*
|
|
9
|
+
* Link to psychologist avatar
|
|
10
|
+
*/
|
|
11
|
+
avatar: string;
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Psychologist's experience
|
|
15
|
+
*/
|
|
16
|
+
experience: string;
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* Consultation duration
|
|
20
|
+
*/
|
|
21
|
+
duration: string;
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* Consultation cost
|
|
25
|
+
*/
|
|
26
|
+
price: string;
|
|
27
|
+
['data-testid']?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const TherapistInformationComponent: React.FC<TherapistInformationComponentProps> =
|
|
31
|
+
(props) => {
|
|
32
|
+
return (
|
|
33
|
+
<Container data-testid={props['data-testid']}>
|
|
34
|
+
<img src={props.avatar} alt="therapist avatar" />
|
|
35
|
+
<Info>
|
|
36
|
+
<h3 className="semiBold">
|
|
37
|
+
<IonIcon icon={briefcaseOutline} color="primary" />
|
|
38
|
+
{props.experience}
|
|
39
|
+
</h3>
|
|
40
|
+
<h3 className="semiBold">
|
|
41
|
+
<IonIcon icon={timeOutline} color="primary" />
|
|
42
|
+
{props.duration}
|
|
43
|
+
</h3>
|
|
44
|
+
<h3 className="semiBold">
|
|
45
|
+
<IonIcon icon={cardOutline} color="primary" />
|
|
46
|
+
{props.price}
|
|
47
|
+
</h3>
|
|
48
|
+
</Info>
|
|
49
|
+
</Container>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import { isPlatform } from '@ionic/react';
|
|
3
|
+
/**
|
|
4
|
+
* Toast that work line an API, we can call it anywhere, need message text and duration(default 3 seconds)
|
|
5
|
+
*/
|
|
6
|
+
export const toast = (message: string, duration = 4500): Promise<void> => {
|
|
7
|
+
const toastMessage = document.createElement('ion-toast');
|
|
8
|
+
toastMessage.message = message;
|
|
9
|
+
toastMessage.duration = duration;
|
|
10
|
+
toastMessage.position = 'top';
|
|
11
|
+
toastMessage.cssClass = isPlatform('ios')
|
|
12
|
+
? 'toast_classes toast_classes_ios'
|
|
13
|
+
: 'toast_classes';
|
|
14
|
+
|
|
15
|
+
document.getElementById('root')?.appendChild(toastMessage);
|
|
16
|
+
return toastMessage.present();
|
|
17
|
+
};
|