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

Commit 933fc4b

Browse files
committed
Update state change on course application
1 parent cc9fd22 commit 933fc4b

File tree

5 files changed

+34
-24
lines changed

5 files changed

+34
-24
lines changed

public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5+
<meta name="color-scheme" content="dark light">
56
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
67
<meta
78
name="viewport"

src/views/pages/Courses/FinalAction.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, {useState} 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';
@@ -89,6 +89,7 @@ const useStyles = makeStyles(theme => ({
8989

9090
export default function FinalAction({ course, batch }) {
9191
const classes = useStyles();
92+
const [applyState, setApplyState] = useState("Apply");
9293

9394
const user = useSelector(state => state.account.user);
9495
const baseUrl =
@@ -99,6 +100,7 @@ export default function FinalAction({ course, batch }) {
99100
if (!user) {
100101
dispatch(login());
101102
} else {
103+
setApplyState("Generating...");
102104
axios.post(url).then(result => {
103105
window.location.href = `/applications?id=${result.data.id}`;
104106
});
@@ -239,7 +241,7 @@ export default function FinalAction({ course, batch }) {
239241
textTransform: 'capitalize'
240242
}}
241243
>
242-
Apply Now
244+
{applyState}
243245
</Button>
244246
</Box>
245247
</Grid>

src/views/pages/Courses/Schedule.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, {useState} from 'react';
22
import {
33
Grid,
44
Typography,
@@ -97,6 +97,8 @@ export default function Schedule({ course }) {
9797
function BatchDropBox({ course, batch, batchIndex, expanded, setExpanded }) {
9898

9999
const user = useSelector(state => state.account.user);
100+
const [applyState, setApplyState] = useState("Apply");
101+
100102
const baseUrl =
101103
'https://us-central1-codeforcauseorg.cloudfunctions.net/widgets/applications';
102104
const dispatch = useDispatch();
@@ -105,6 +107,7 @@ function BatchDropBox({ course, batch, batchIndex, expanded, setExpanded }) {
105107
if (!user) {
106108
dispatch(login());
107109
} else {
110+
setApplyState("Generating...");
108111
axios.post(url).then(result => {
109112
window.location.href = `/applications?id=${result.data.id}`;
110113
});
@@ -318,7 +321,7 @@ function BatchDropBox({ course, batch, batchIndex, expanded, setExpanded }) {
318321
}}
319322
>
320323
<Typography>
321-
<Box fontWeight={500}>Apply</Box>
324+
<Box fontWeight={500}>{applyState}</Box>
322325
</Typography>
323326
</Button>
324327
<Button

src/views/pages/CoursesView/Hero.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,27 @@ function Hero({ className, ...rest }) {
105105
</Hidden>
106106
<Box mt={5}>
107107
{!!user ? (
108-
<Typography variant="body1">It's the time to learn from Experts.</Typography>
108+
<Typography variant="h4">
109+
It's the time to learn from Experts.
110+
</Typography>
109111
) : (
110-
<Typography variant="body1">
112+
<Typography variant="h4">
111113
Login To get regular Updates.
112114
</Typography>
113115
)}
114116
</Box>
115-
<Box mt={4}>
117+
<Box mt={2} mb={3}>
116118
<Grid container xs={12} md={12}>
117119
<Grid item xs={12} md={12}>
118120
{!!user ? (
119-
<Button
120-
className={classes.btn}
121-
onClick={handleLoginOpen}
122-
size="large"
123-
variant="contained"
121+
<Typography
122+
variant="h4"
123+
style={{
124+
color: '#ffffff'
125+
}}
124126
>
125-
Check Your Enrollments
126-
</Button>
127+
Explore our courses below
128+
</Typography>
127129
) : (
128130
<Button
129131
className={classes.btn}

src/views/pages/EventsView/Hero.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,25 +106,27 @@ function Hero({ className, ...rest }) {
106106
</Hidden>
107107
<Box mt={5}>
108108
{!!user ? (
109-
<Typography variant="body1">It's the time to learn from Experts.</Typography>
109+
<Typography variant="h4">
110+
It's the time to learn from Experts.
111+
</Typography>
110112
) : (
111-
<Typography variant="body1">
113+
<Typography variant="h4">
112114
Login To get regular Updates.
113115
</Typography>
114116
)}
115117
</Box>
116-
<Box mt={4}>
118+
<Box mt={2} mb={3}>
117119
<Grid container xs={12} md={12}>
118120
<Grid item xs={12} md={12}>
119121
{!!user ? (
120-
<Button
121-
className={classes.btn}
122-
onClick={handleLoginOpen}
123-
size="large"
124-
variant="contained"
122+
<Typography
123+
variant="h4"
124+
style={{
125+
color: '#ffffff'
126+
}}
125127
>
126-
Check Your Enrollments
127-
</Button>
128+
Explore our live events below
129+
</Typography>
128130
) : (
129131
<Button
130132
className={classes.btn}

0 commit comments

Comments
 (0)