Skip to content
This repository was archived by the owner on Mar 7, 2024. It is now read-only.

Commit 0261942

Browse files
committed
Change the bottom block
1 parent 0ce8268 commit 0261942

File tree

2 files changed

+6
-35
lines changed

2 files changed

+6
-35
lines changed

src/views/pages/Course/ApplyModal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export default function ApplyModal() {
9797
variant="contained"
9898
onClick={handleClickOpen}
9999
>
100-
Enquire
100+
Enquire Now
101101
</Button>
102102
<Dialog
103103
fullWidth

src/views/pages/Course/FinalAction.js

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import React, { useState } from 'react';
1+
import React from 'react';
22
import { makeStyles } from '@material-ui/core/styles';
33
import { Box, Grid, Typography, Card, Button } from '@material-ui/core';
44
import DetailsBottom from './partials/DetailsBottom';
55

6-
import { login } from 'src/actions/accountActions';
7-
import axios from 'src/utils/axios';
8-
import { useDispatch, useSelector } from 'react-redux';
6+
import ApplyModal from './ApplyModal';
97

108
const useStyles = makeStyles(theme => ({
119
icon: {
@@ -89,23 +87,6 @@ const useStyles = makeStyles(theme => ({
8987

9088
export default function FinalAction({ course, batch }) {
9189
const classes = useStyles();
92-
const [applyState, setApplyState] = useState('Enquire');
93-
94-
const user = useSelector(state => state.account.user);
95-
const baseUrl =
96-
'https://us-central1-codeforcauseorg.cloudfunctions.net/widgets/applications';
97-
const dispatch = useDispatch();
98-
const handleApply = () => {
99-
const url = `${baseUrl}/${batch.courseId}`;
100-
if (!user) {
101-
dispatch(login());
102-
} else {
103-
setApplyState('Generating...');
104-
axios.post(url).then(result => {
105-
window.location.href = `/applications?id=${result.data.id}`;
106-
});
107-
}
108-
};
10990

11091
return (
11192
<Grid container className={classes.root}>
@@ -230,19 +211,9 @@ export default function FinalAction({ course, batch }) {
230211
</Box>
231212
</Box>
232213
</Card>
233-
234-
<Button
235-
variant="contained"
236-
color="secondary"
237-
onClick={handleApply}
238-
fullWidth
239-
style={{
240-
marginTop: '24px',
241-
textTransform: 'capitalize'
242-
}}
243-
>
244-
{applyState}
245-
</Button>
214+
215+
<ApplyModal />
216+
246217
</Box>
247218
</Grid>
248219
</Grid>

0 commit comments

Comments
 (0)