-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPackages.jsx
More file actions
185 lines (174 loc) · 5.61 KB
/
Copy pathPackages.jsx
File metadata and controls
185 lines (174 loc) · 5.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
import * as React from 'react';
import { createTheme, ThemeProvider } from '@mui/material/styles';
import AppBar from '@mui/material/AppBar';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import Card from '@mui/material/Card';
import CardActions from '@mui/material/CardActions';
import CardContent from '@mui/material/CardContent';
import CardHeader from '@mui/material/CardHeader';
import CssBaseline from '@mui/material/CssBaseline';
import Grid from '@mui/material/Grid';
import StarIcon from '@mui/icons-material/StarBorder';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
import Link from '@mui/material/Link';
import GlobalStyles from '@mui/material/GlobalStyles';
import Container from '@mui/material/Container';
import { useNavigate } from 'react-router-dom';
import { useSelector } from 'react-redux';
function Copyright(props) {
return (
<Typography variant="body2" color="text.secondary" align="center" {...props}>
{'Copyright © '}
<Link color="inherit" href="https://mui.com/">
Your Website
</Link>{' '}
{new Date().getFullYear()}
{'.'}
</Typography>
);
}
const tiers = [
{
title: 'Basic',
price: '399',
description: [
'Consultation with doctor',
'Laboratory and diagnostic tests',
'Two home visits a year',
'Email support',
],
buttonText: 'Pay Now',
buttonVariant: 'contained',
},
{
title: 'Pro',
subheader: 'Most popular',
price: '599',
description: [
'ALL from BASIC +',
'Day and night emergency care',
'Help center access',
'Two more home visits a year',
],
buttonText: 'Pay Now',
buttonVariant: 'contained',
},
{
title: 'Enterprise',
price: '999',
description: [
'ALL from PRO +',
'Rehabilitation after injury',
'Full-body check-up',
'Detailed health report',
'Four more home visits a year',
],
buttonText: 'Pay Now',
buttonVariant: 'contained',
},
];
const defaultTheme = createTheme();
export default function Pricing() {
const isAuth=useSelector((store)=>store.AuthReducer.isAuth);
const navigate = useNavigate();
const handlePayNowClick = () => {
if(isAuth){
navigate("/pay");
}
else{
navigate('/signin');
}
};
return (
<ThemeProvider theme={defaultTheme} >
<GlobalStyles styles={{ ul: { margin: 0, padding: 0, listStyle: 'none' } }} />
<CssBaseline />
{/* Hero unit */}
<Container disableGutters maxWidth="md" component="main" sx={{ pt: 4, pb: 6 }}>
<Typography
component="h1"
variant="h4"
align="center"
color="green"
gutterBottom
>
Health Packages
</Typography>
<Typography variant="p" align="center" color="text.secondary" component="p">
Discover our specially curated healthcare packages designed to provide comprehensive and specialized care for our patients. We believe in making healthcare accessible and tailored to your needs, and our packages are a testament to that commitment.
</Typography>
</Container>
{/* End hero unit */}
<Container maxWidth="md" component="main">
<Grid container spacing={5} alignItems="flex-end">
{tiers.map((tier) => (
// Enterprise card is full width at sm breakpoint
<Grid
item
key={tier.title}
xs={12}
sm={tier.title === 'Enterprise' ? 12 : 6}
md={4}
>
<Card>
<CardHeader
title={tier.title}
subheader={tier.subheader}
titleTypographyProps={{ align: 'center' }}
action={tier.title === 'Pro' ? <StarIcon /> : null}
subheaderTypographyProps={{
align: 'center',
}}
sx={{
backgroundColor: (theme) =>
theme.palette.mode === 'light'
? theme.palette.grey[200]
: theme.palette.grey[700],
}}
/>
<CardContent>
<Box
sx={{
display: 'flex',
justifyContent: 'center',
alignItems: 'baseline',
mb: 2,
}}
>
<Typography component="h2" variant="h3" color="green">
₹ {tier.price}
</Typography>
<Typography variant="h6" color="green">
/mo
</Typography>
</Box>
<ul>
{tier.description.map((line) => (
<Typography
component="li"
variant="subtitle1"
align="center"
key={line}
>
{line}
</Typography>
))}
</ul>
</CardContent>
<CardActions>
<Button style={{backgroundColor:"#009E60"}} fullWidth variant={tier.buttonVariant}
onClick={() => handlePayNowClick(tier.title)}
>
{tier.buttonText}
</Button>
</CardActions>
</Card>
</Grid>
))}
</Grid>
</Container>
</ThemeProvider>
);
}