@mindly/ui-components 0.1.2 → 0.1.3
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/package.json +8 -1
- package/.eslintrc.json +0 -47
- package/.idea/codeStyles/Project.xml +0 -45
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/jsLinters/eslint.xml +0 -6
- package/.idea/mindly-components.iml +0 -13
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.storybook/main.js +0 -11
- package/.storybook/preview.js +0 -9
- package/babel.config.json +0 -18
- package/ionic.config.json +0 -5
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/src/fonts/Lato-Bold.ttf +0 -0
- package/src/fonts/Lato-Regular.ttf +0 -0
- package/src/fonts/Lato-Semibold.ttf +0 -0
- package/src/lib/Theme/global.css +0 -191
- package/src/lib/Theme/mindly_constants.ts +0 -20
- package/src/lib/button/Button.style.ts +0 -83
- package/src/lib/button/Button.tsx +0 -29
- package/src/lib/consultation-card/consultationCard.tsx +0 -18
- package/src/lib/floating-button/floating button.svg +0 -6
- package/src/lib/floating-button/floatingButton.style.ts +0 -21
- package/src/lib/floating-button/floatingButton.tsx +0 -29
- package/src/lib/footer-for-booking/FooterForBooking.style.ts +0 -42
- package/src/lib/footer-for-booking/FooterForBooking.tsx +0 -43
- package/src/lib/index.tsx +0 -9
- package/src/lib/list-button/listButton.style.ts +0 -19
- package/src/lib/list-button/listButton.tsx +0 -19
- package/src/lib/navigation-bar/NavigationBar.style.ts +0 -56
- package/src/lib/navigation-bar/NavigationBar.tsx +0 -26
- package/src/lib/tab-bar/tabBar.style.ts +0 -15
- package/src/lib/tab-bar/tabBar.tsx +0 -31
- package/src/lib/therapist-card/TherapistCard.style.ts +0 -140
- package/src/lib/therapist-card/TherapistCard.tsx +0 -97
- package/src/react-app-env.d.ts +0 -1
- package/src/stories/Button.stories.tsx +0 -37
- package/src/stories/Button.tsx +0 -48
- package/src/stories/Header.stories.tsx +0 -19
- package/src/stories/Header.tsx +0 -47
- package/src/stories/Introduction.stories.mdx +0 -211
- package/src/stories/Page.stories.tsx +0 -22
- package/src/stories/Page.tsx +0 -67
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -26
- package/src/stories/page.css +0 -69
- package/tsconfig.json +0 -26
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
interface ContainerProps{
|
|
4
|
-
bottomHeight: number,
|
|
5
|
-
rightWidth: number
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const Container = styled.a<ContainerProps>`
|
|
9
|
-
display: block;
|
|
10
|
-
width: 54px;
|
|
11
|
-
height: 54px;
|
|
12
|
-
position: fixed;
|
|
13
|
-
bottom: ${(props) => props.bottomHeight}px;
|
|
14
|
-
right: ${(props) => props.rightWidth}px;
|
|
15
|
-
z-index: 100000000;
|
|
16
|
-
|
|
17
|
-
img {
|
|
18
|
-
background: none;
|
|
19
|
-
border-radius: 50%;
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {Container} from './floatingButton.style';
|
|
3
|
-
import img from './floating button.svg';
|
|
4
|
-
|
|
5
|
-
interface FloatingButtonType {
|
|
6
|
-
bottomHeight: number;
|
|
7
|
-
rightWidth: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const FloatingButton: React.FC<FloatingButtonType> = (
|
|
11
|
-
{
|
|
12
|
-
bottomHeight = 0,
|
|
13
|
-
rightWidth = 0,
|
|
14
|
-
}) => {
|
|
15
|
-
return (
|
|
16
|
-
<Container
|
|
17
|
-
href="https://t.me/MindlySupport"
|
|
18
|
-
bottomHeight={bottomHeight}
|
|
19
|
-
rightWidth={rightWidth}
|
|
20
|
-
>
|
|
21
|
-
<img
|
|
22
|
-
src={img}
|
|
23
|
-
alt="support mindly"
|
|
24
|
-
/>
|
|
25
|
-
</Container>
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default FloatingButton;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import {IonIcon} from '@ionic/react';
|
|
3
|
-
import {colorConstants} from '../Theme/mindly_constants';
|
|
4
|
-
|
|
5
|
-
interface ContainerProps {
|
|
6
|
-
isIos: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const Container = styled.div<ContainerProps>`
|
|
10
|
-
padding: ${(props) => props.isIos ? '16px 24px 50px' : '16px 24px'};
|
|
11
|
-
box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.12);
|
|
12
|
-
display: flex;
|
|
13
|
-
position: fixed;
|
|
14
|
-
bottom: 0;
|
|
15
|
-
justify-content: space-between;
|
|
16
|
-
align-items: center;
|
|
17
|
-
width: 100%;
|
|
18
|
-
|
|
19
|
-
button {
|
|
20
|
-
height: 44px;
|
|
21
|
-
width: 132px;
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
export const InfoContainer = styled.div`
|
|
26
|
-
h4 {
|
|
27
|
-
color: ${colorConstants.secondaryTextColor};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
h4:first-child {
|
|
31
|
-
margin-bottom: 4px;
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
export const SmallIcon = styled(IonIcon)`
|
|
36
|
-
margin: 0 5px -4px 0;
|
|
37
|
-
font-size: 18px;
|
|
38
|
-
|
|
39
|
-
&.ion-color {
|
|
40
|
-
--ion-color-base: ${colorConstants.primaryColor} !important;
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {Container, InfoContainer, SmallIcon} from './FooterForBooking.style';
|
|
3
|
-
import Button from '../button/Button';
|
|
4
|
-
import {timeOutline, cardOutline} from 'ionicons/icons';
|
|
5
|
-
import {isPlatform} from '@ionic/react';
|
|
6
|
-
|
|
7
|
-
interface FooterForBookingProps {
|
|
8
|
-
eventHandler: () => void,
|
|
9
|
-
time: string,
|
|
10
|
-
price: string,
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const FooterForBooking: React.FC<FooterForBookingProps> = (props)=> {
|
|
14
|
-
return (
|
|
15
|
-
<Container isIos={isPlatform('ios')}>
|
|
16
|
-
<InfoContainer>
|
|
17
|
-
<h4>
|
|
18
|
-
<SmallIcon icon={timeOutline} color='primary' />
|
|
19
|
-
<>
|
|
20
|
-
{props.time}
|
|
21
|
-
</>
|
|
22
|
-
</h4>
|
|
23
|
-
<h4>
|
|
24
|
-
<SmallIcon icon={cardOutline} color='primary' />
|
|
25
|
-
<>
|
|
26
|
-
{props.price}
|
|
27
|
-
</>
|
|
28
|
-
</h4>
|
|
29
|
-
</InfoContainer>
|
|
30
|
-
<Button
|
|
31
|
-
buttonType={'primary'}
|
|
32
|
-
isDisabled={false}
|
|
33
|
-
onClick={props.eventHandler}
|
|
34
|
-
>
|
|
35
|
-
<h4 className='semiBold'>
|
|
36
|
-
Записаться
|
|
37
|
-
</h4>
|
|
38
|
-
</Button>
|
|
39
|
-
</Container>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default FooterForBooking;
|
package/src/lib/index.tsx
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import Button from './button/Button';
|
|
2
|
-
import ConsultationCard from './consultation-card/consultationCard';
|
|
3
|
-
import FloatingButton from './floating-button/floatingButton';
|
|
4
|
-
import FooterForBooking from './footer-for-booking/FooterForBooking';
|
|
5
|
-
import ListButton from './list-button/listButton';
|
|
6
|
-
import NavigationBar from './navigation-bar/NavigationBar';
|
|
7
|
-
import {TabBar} from './tab-bar/tabBar';
|
|
8
|
-
|
|
9
|
-
export {Button, ConsultationCard, FloatingButton, FooterForBooking, ListButton, NavigationBar, TabBar};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import {colorConstants} from '../Theme/mindly_constants';
|
|
3
|
-
import {IonIcon} from '@ionic/react';
|
|
4
|
-
|
|
5
|
-
export const Container = styled.button`
|
|
6
|
-
display: flex;
|
|
7
|
-
justify-content: space-between;
|
|
8
|
-
color: ${colorConstants.secondaryTextColor};
|
|
9
|
-
border: 0;
|
|
10
|
-
border-bottom: 1px solid ${colorConstants.AccentDivider};
|
|
11
|
-
width: 100%;
|
|
12
|
-
padding: 10px 16px;
|
|
13
|
-
background: inherit;
|
|
14
|
-
`;
|
|
15
|
-
|
|
16
|
-
export const Image = styled(IonIcon)`
|
|
17
|
-
width: 21px;
|
|
18
|
-
height: 21px;
|
|
19
|
-
`;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import '../Theme/global.css';
|
|
3
|
-
import {Container, Image} from './listButton.style';
|
|
4
|
-
|
|
5
|
-
interface ListButtonProps {
|
|
6
|
-
text: string,
|
|
7
|
-
icon: string,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const ListButton: React.FC<ListButtonProps> = (props) => {
|
|
11
|
-
return (
|
|
12
|
-
<Container>
|
|
13
|
-
<h4>{props.text}</h4>
|
|
14
|
-
<Image icon={props.icon}/>
|
|
15
|
-
</Container>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default ListButton;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import styled, {css} from 'styled-components';
|
|
2
|
-
import {IonHeader} from '@ionic/react';
|
|
3
|
-
import {colorConstants} from '../Theme/mindly_constants';
|
|
4
|
-
|
|
5
|
-
interface ContainerProps {
|
|
6
|
-
isIos: boolean
|
|
7
|
-
isInternetConnected: boolean
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const Container = styled(IonHeader)<ContainerProps>`
|
|
11
|
-
padding: ${(props) => props.isInternetConnected ? '10px' : '40px 10px 10px'};
|
|
12
|
-
background: #ffffff;
|
|
13
|
-
position: fixed;
|
|
14
|
-
display: flex;
|
|
15
|
-
z-index: 1000;
|
|
16
|
-
text-align: center;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
min-height: ${(props) => props.isInternetConnected ? '44px' : '74px'};
|
|
19
|
-
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
|
|
20
|
-
color: ${colorConstants.primaryTextColor};
|
|
21
|
-
|
|
22
|
-
.left {
|
|
23
|
-
position: absolute;
|
|
24
|
-
color: ${colorConstants.primaryColor};
|
|
25
|
-
left: 10px;
|
|
26
|
-
top: ${(props: ContainerProps) => props.isInternetConnected ? 'calc(50% - 12px)' : 'calc(50% + 3px)'};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.right {
|
|
30
|
-
color: ${colorConstants.primaryColor};
|
|
31
|
-
position: absolute;
|
|
32
|
-
right: 10px;
|
|
33
|
-
top: ${(props: ContainerProps) => props.isInternetConnected ? 'calc(50% - 12px)' : 'calc(50% + 3px)'};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&:after {
|
|
37
|
-
background-image: none;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
${(props: ContainerProps) => props.isIos && css`
|
|
41
|
-
padding: ${props.isInternetConnected ? '54px 10px 10px' : '64px 10px 10px'};
|
|
42
|
-
min-height: ${props.isInternetConnected ? '88px' : '98px'};
|
|
43
|
-
|
|
44
|
-
.left {
|
|
45
|
-
position: absolute;
|
|
46
|
-
left: 10px;
|
|
47
|
-
top: ${props.isInternetConnected ? 'calc(50% + 10px)' : 'calc(50% + 15px)'};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.right {
|
|
51
|
-
position: absolute;
|
|
52
|
-
right: 10px;
|
|
53
|
-
top: ${props.isInternetConnected ? 'calc(50% + 10px)' : 'calc(50% + 15px)'};
|
|
54
|
-
}
|
|
55
|
-
`}
|
|
56
|
-
`;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {Container} from './NavigationBar.style';
|
|
3
|
-
import '../Theme/global.css';
|
|
4
|
-
import {isPlatform} from '@ionic/react';
|
|
5
|
-
|
|
6
|
-
interface NavigationBar {
|
|
7
|
-
isInternetConnected: boolean,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const NavigationBar: React.FC<NavigationBar> = (props) => {
|
|
11
|
-
return (
|
|
12
|
-
<Container isIos={isPlatform('ios')} isInternetConnected={props.isInternetConnected}>
|
|
13
|
-
<h4 className='left'>
|
|
14
|
-
first
|
|
15
|
-
</h4>
|
|
16
|
-
<h4 className='second'>
|
|
17
|
-
second
|
|
18
|
-
</h4>
|
|
19
|
-
<h4 className='right'>
|
|
20
|
-
third
|
|
21
|
-
</h4>
|
|
22
|
-
</Container>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default NavigationBar;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import {IonTabBar} from '@ionic/react';
|
|
3
|
-
|
|
4
|
-
interface ContainerProps {
|
|
5
|
-
isIos: boolean
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const Container = styled(IonTabBar)<ContainerProps>`
|
|
9
|
-
box-shadow: 0px -2px 5px rgba(0, 0, 0, 0.08);
|
|
10
|
-
position: fixed;
|
|
11
|
-
bottom: 0;
|
|
12
|
-
width: 100%;
|
|
13
|
-
border: none;
|
|
14
|
-
padding-bottom: ${(props) => props.isIos ? '34px' : '0'};
|
|
15
|
-
`;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {IonTabButton, IonIcon, IonLabel, IonBadge, isPlatform} from '@ionic/react';
|
|
3
|
-
import {calendar, personCircle, map, informationCircle} from 'ionicons/icons';
|
|
4
|
-
import {Container} from './tabBar.style';
|
|
5
|
-
|
|
6
|
-
export const TabBar: React.FC = () => (
|
|
7
|
-
<>
|
|
8
|
-
<Container isIos={isPlatform('ios')} slot="bottom">
|
|
9
|
-
<IonTabButton tab="schedule">
|
|
10
|
-
<IonIcon icon={calendar} />
|
|
11
|
-
<IonLabel>Schedule</IonLabel>
|
|
12
|
-
<IonBadge>6</IonBadge>
|
|
13
|
-
</IonTabButton>
|
|
14
|
-
|
|
15
|
-
<IonTabButton tab="speakers">
|
|
16
|
-
<IonIcon icon={personCircle} />
|
|
17
|
-
<IonLabel>Speakers</IonLabel>
|
|
18
|
-
</IonTabButton>
|
|
19
|
-
|
|
20
|
-
<IonTabButton tab="map">
|
|
21
|
-
<IonIcon icon={map} />
|
|
22
|
-
<IonLabel>Map</IonLabel>
|
|
23
|
-
</IonTabButton>
|
|
24
|
-
|
|
25
|
-
<IonTabButton tab="about">
|
|
26
|
-
<IonIcon icon={informationCircle} />
|
|
27
|
-
<IonLabel>About</IonLabel>
|
|
28
|
-
</IonTabButton>
|
|
29
|
-
</Container>
|
|
30
|
-
</>
|
|
31
|
-
);
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IonCard,
|
|
3
|
-
IonCardContent,
|
|
4
|
-
IonCardHeader,
|
|
5
|
-
IonCardSubtitle,
|
|
6
|
-
IonCardTitle,
|
|
7
|
-
IonCol,
|
|
8
|
-
IonIcon, IonSkeletonText,
|
|
9
|
-
} from '@ionic/react';
|
|
10
|
-
import styled from 'styled-components';
|
|
11
|
-
import {colorConstants} from '../Theme/mindly_constants';
|
|
12
|
-
|
|
13
|
-
export const IonColWithoutPadding = styled(IonCol)`
|
|
14
|
-
padding: 0;
|
|
15
|
-
margin: 0;
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
interface ContainerProps {
|
|
19
|
-
isIos: boolean
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const Container = styled.div<ContainerProps>`
|
|
23
|
-
margin: 0 16px 24px;
|
|
24
|
-
border-radius: 8px;
|
|
25
|
-
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.1);
|
|
26
|
-
|
|
27
|
-
&:first-child {
|
|
28
|
-
margin-top: ${(props) => (props.isIos ? '28px' : '20px')};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&:last-of-type {
|
|
32
|
-
margin-bottom: 80px;
|
|
33
|
-
}
|
|
34
|
-
`;
|
|
35
|
-
|
|
36
|
-
type SkeletonProps = {
|
|
37
|
-
isLoading: boolean
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const Skeleton = styled.div<SkeletonProps>`
|
|
41
|
-
visibility: ${(props) => (props.isLoading ? 'visible' : 'hidden')};
|
|
42
|
-
position: absolute;
|
|
43
|
-
width: 100%;
|
|
44
|
-
top: 0;
|
|
45
|
-
`;
|
|
46
|
-
|
|
47
|
-
type HideProps = {
|
|
48
|
-
isLoading: boolean
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export const Hide = styled.div<HideProps>`
|
|
52
|
-
visibility: ${(props) => (props.isLoading ? 'hidden' : 'visible')};
|
|
53
|
-
`;
|
|
54
|
-
|
|
55
|
-
export const PsychologistCardIonCard = styled(IonCard)`
|
|
56
|
-
height: 100%;
|
|
57
|
-
border-radius: 8px;
|
|
58
|
-
margin: 0;
|
|
59
|
-
position: relative;
|
|
60
|
-
box-shadow: none;
|
|
61
|
-
|
|
62
|
-
img {
|
|
63
|
-
height: 222px;
|
|
64
|
-
width: 100%;
|
|
65
|
-
object-fit: cover;
|
|
66
|
-
}
|
|
67
|
-
`;
|
|
68
|
-
|
|
69
|
-
export const PsychologistCardIonCardHeader = styled(IonCardHeader)`
|
|
70
|
-
padding: 16px 16px 0;
|
|
71
|
-
`;
|
|
72
|
-
|
|
73
|
-
export const PsychologistCardIonCardSubtitle = styled(IonCardSubtitle)`
|
|
74
|
-
display: flex;
|
|
75
|
-
align-items: flex-start;
|
|
76
|
-
text-transform: none;
|
|
77
|
-
letter-spacing: 0;
|
|
78
|
-
margin: 4px 0 16px;
|
|
79
|
-
color: ${colorConstants.primaryTextColor};
|
|
80
|
-
`;
|
|
81
|
-
|
|
82
|
-
export const PsychologistCardIonCardTitle = styled(IonCardTitle)`
|
|
83
|
-
color: ${colorConstants.secondaryTextColor};
|
|
84
|
-
margin: 0;
|
|
85
|
-
`;
|
|
86
|
-
|
|
87
|
-
export const PsychologistCardIonCardContent = styled(IonCardContent)`
|
|
88
|
-
padding: 0 16px 16px;
|
|
89
|
-
`;
|
|
90
|
-
|
|
91
|
-
export const PsychologistCardIcons = styled(IonIcon)`
|
|
92
|
-
color: ${colorConstants.primaryColor};
|
|
93
|
-
width: 20px;
|
|
94
|
-
height: 20px;
|
|
95
|
-
margin: 0;
|
|
96
|
-
|
|
97
|
-
@media (max-width: 320px) {
|
|
98
|
-
width: 19px;
|
|
99
|
-
}
|
|
100
|
-
`;
|
|
101
|
-
|
|
102
|
-
export const IconsContainer = styled.div`
|
|
103
|
-
display: flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
padding: 0;
|
|
106
|
-
margin: 0;
|
|
107
|
-
|
|
108
|
-
p {
|
|
109
|
-
color: ${colorConstants.secondaryTextColor};
|
|
110
|
-
font-size: 14px;
|
|
111
|
-
padding-left: 5px;
|
|
112
|
-
margin: 0;
|
|
113
|
-
|
|
114
|
-
@media (max-width: 320px) {
|
|
115
|
-
font-size: 11.5px;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
`;
|
|
119
|
-
|
|
120
|
-
export const InfoContainer = styled.div`
|
|
121
|
-
display: flex;
|
|
122
|
-
justify-content: space-between;
|
|
123
|
-
`;
|
|
124
|
-
|
|
125
|
-
interface SkeletonTextProps{
|
|
126
|
-
height: number
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export const SkeletonText = styled(IonSkeletonText)<SkeletonTextProps>`
|
|
130
|
-
width: 100%;
|
|
131
|
-
height: ${(props) => props.height + 'px'};
|
|
132
|
-
|
|
133
|
-
&:first-child {
|
|
134
|
-
margin-bottom: 16px;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
&:last-child{
|
|
138
|
-
margin-top: 16px;
|
|
139
|
-
}
|
|
140
|
-
`;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import React, {useState} from 'react';
|
|
2
|
-
import {timeOutline, cardOutline, briefcaseOutline} from 'ionicons/icons';
|
|
3
|
-
import {
|
|
4
|
-
PsychologistCardIonCardContent,
|
|
5
|
-
PsychologistCardIonCardHeader,
|
|
6
|
-
PsychologistCardIonCardSubtitle,
|
|
7
|
-
PsychologistCardIonCardTitle,
|
|
8
|
-
PsychologistCardIcons,
|
|
9
|
-
PsychologistCardIonCard,
|
|
10
|
-
IconsContainer,
|
|
11
|
-
Container,
|
|
12
|
-
Skeleton,
|
|
13
|
-
Hide,
|
|
14
|
-
InfoContainer,
|
|
15
|
-
SkeletonText,
|
|
16
|
-
} from './TherapistCard.style';
|
|
17
|
-
import {isPlatform} from '@ionic/react';
|
|
18
|
-
|
|
19
|
-
interface TherapistCardProps {
|
|
20
|
-
psychologistName: string
|
|
21
|
-
psychologistLastName: string
|
|
22
|
-
psychologistType: string
|
|
23
|
-
psychologistPhoto: string
|
|
24
|
-
psychologistPrice: number
|
|
25
|
-
psychologistDuration: number
|
|
26
|
-
psychologistExperience: number
|
|
27
|
-
handleClick: React.MouseEventHandler,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const TherapistCard: React.FC<TherapistCardProps> = ({
|
|
32
|
-
psychologistName,
|
|
33
|
-
psychologistLastName,
|
|
34
|
-
psychologistType,
|
|
35
|
-
psychologistPhoto,
|
|
36
|
-
psychologistPrice,
|
|
37
|
-
psychologistDuration,
|
|
38
|
-
psychologistExperience,
|
|
39
|
-
handleClick,
|
|
40
|
-
}) => {
|
|
41
|
-
const [isLoading, setIsLoading] = useState<boolean>(true);
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<Container isIos={isPlatform('ios')}>
|
|
45
|
-
<PsychologistCardIonCard onClick={handleClick}>
|
|
46
|
-
<Hide isLoading={isLoading}>
|
|
47
|
-
<img src={psychologistPhoto}
|
|
48
|
-
onLoad={() => setIsLoading(false)}
|
|
49
|
-
alt='psychologistPhoto'
|
|
50
|
-
/>
|
|
51
|
-
<PsychologistCardIonCardHeader>
|
|
52
|
-
<PsychologistCardIonCardTitle>
|
|
53
|
-
<h1 className='bold'>
|
|
54
|
-
{`${psychologistName} ${psychologistLastName}`}
|
|
55
|
-
</h1>
|
|
56
|
-
</PsychologistCardIonCardTitle>
|
|
57
|
-
<PsychologistCardIonCardSubtitle>
|
|
58
|
-
<h3 className='semiBold'>
|
|
59
|
-
{psychologistType}
|
|
60
|
-
</h3>
|
|
61
|
-
</PsychologistCardIonCardSubtitle>
|
|
62
|
-
</PsychologistCardIonCardHeader>
|
|
63
|
-
<PsychologistCardIonCardContent>
|
|
64
|
-
<InfoContainer>
|
|
65
|
-
<IconsContainer>
|
|
66
|
-
<PsychologistCardIcons icon={timeOutline} />
|
|
67
|
-
<p className='semiBold'>{`${psychologistDuration} минут`}</p>
|
|
68
|
-
</IconsContainer>
|
|
69
|
-
<IconsContainer>
|
|
70
|
-
<PsychologistCardIcons icon={cardOutline} />
|
|
71
|
-
<p className='semiBold'>{`${psychologistPrice} грн`}</p>
|
|
72
|
-
</IconsContainer>
|
|
73
|
-
<IconsContainer>
|
|
74
|
-
<PsychologistCardIcons icon={briefcaseOutline} />
|
|
75
|
-
<p className='semiBold'>
|
|
76
|
-
{psychologistExperience >= 5 ?
|
|
77
|
-
`${psychologistExperience} лет опыта` :
|
|
78
|
-
psychologistExperience === 1 ?
|
|
79
|
-
`${psychologistExperience} год опыта` :
|
|
80
|
-
`${psychologistExperience} года опыта`}
|
|
81
|
-
</p>
|
|
82
|
-
</IconsContainer>
|
|
83
|
-
</InfoContainer>
|
|
84
|
-
</PsychologistCardIonCardContent>
|
|
85
|
-
</Hide>
|
|
86
|
-
|
|
87
|
-
<Skeleton isLoading={isLoading}>
|
|
88
|
-
<SkeletonText height={222} animated/>
|
|
89
|
-
<SkeletonText animated height={60} />
|
|
90
|
-
<SkeletonText animated height={22} />
|
|
91
|
-
</Skeleton>
|
|
92
|
-
</PsychologistCardIonCard>
|
|
93
|
-
</Container>
|
|
94
|
-
);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export default TherapistCard;
|
package/src/react-app-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="react-scripts" />
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import { Button } from './Button';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Example/Button',
|
|
8
|
-
component: Button,
|
|
9
|
-
argTypes: {
|
|
10
|
-
backgroundColor: { control: 'color' },
|
|
11
|
-
},
|
|
12
|
-
} as ComponentMeta<typeof Button>;
|
|
13
|
-
|
|
14
|
-
const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />;
|
|
15
|
-
|
|
16
|
-
export const Primary = Template.bind({});
|
|
17
|
-
Primary.args = {
|
|
18
|
-
primary: true,
|
|
19
|
-
label: 'Button',
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const Secondary = Template.bind({});
|
|
23
|
-
Secondary.args = {
|
|
24
|
-
label: 'Button',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const Large = Template.bind({});
|
|
28
|
-
Large.args = {
|
|
29
|
-
size: 'large',
|
|
30
|
-
label: 'Button',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const Small = Template.bind({});
|
|
34
|
-
Small.args = {
|
|
35
|
-
size: 'small',
|
|
36
|
-
label: 'Button',
|
|
37
|
-
};
|
package/src/stories/Button.tsx
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './button.css';
|
|
3
|
-
|
|
4
|
-
interface ButtonProps {
|
|
5
|
-
/**
|
|
6
|
-
* Is this the principal call to action on the page?
|
|
7
|
-
*/
|
|
8
|
-
primary?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* What background color to use
|
|
11
|
-
*/
|
|
12
|
-
backgroundColor?: string;
|
|
13
|
-
/**
|
|
14
|
-
* How large should the button be?
|
|
15
|
-
*/
|
|
16
|
-
size?: 'small' | 'medium' | 'large';
|
|
17
|
-
/**
|
|
18
|
-
* Button contents
|
|
19
|
-
*/
|
|
20
|
-
label: string;
|
|
21
|
-
/**
|
|
22
|
-
* Optional click handler
|
|
23
|
-
*/
|
|
24
|
-
onClick?: () => void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Primary UI component for user interaction
|
|
29
|
-
*/
|
|
30
|
-
export const Button = ({
|
|
31
|
-
primary = false,
|
|
32
|
-
size = 'medium',
|
|
33
|
-
backgroundColor,
|
|
34
|
-
label,
|
|
35
|
-
...props
|
|
36
|
-
}: ButtonProps) => {
|
|
37
|
-
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
38
|
-
return (
|
|
39
|
-
<button
|
|
40
|
-
type="button"
|
|
41
|
-
className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
|
|
42
|
-
style={{ backgroundColor }}
|
|
43
|
-
{...props}
|
|
44
|
-
>
|
|
45
|
-
{label}
|
|
46
|
-
</button>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import { Header } from './Header';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Example/Header',
|
|
8
|
-
component: Header,
|
|
9
|
-
} as ComponentMeta<typeof Header>;
|
|
10
|
-
|
|
11
|
-
const Template: ComponentStory<typeof Header> = (args) => <Header {...args} />;
|
|
12
|
-
|
|
13
|
-
export const LoggedIn = Template.bind({});
|
|
14
|
-
LoggedIn.args = {
|
|
15
|
-
user: {},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const LoggedOut = Template.bind({});
|
|
19
|
-
LoggedOut.args = {};
|