Skip to content

Commit 7d80e1e

Browse files
Merge pull request #694 from Manjusri-A/patch-25
Update App.js
2 parents f09bae9 + ca0ac52 commit 7d80e1e

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Expense Tracker/src/App.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useRef } from 'react';
2-
import { Grid } from '@material-ui/core';
2+
import { Grid } from '@mui/material'; // Ensure correct import based on version
33

44
import { SpeechState, useSpeechContext } from "@speechly/react-client";
55
import { PushToTalkButton, PushToTalkButtonContainer } from '@speechly/react-ui';
@@ -10,9 +10,13 @@ import useStyles from './styles';
1010
const App = () => {
1111
const classes = useStyles();
1212
const { speechState } = useSpeechContext();
13-
const main = useRef(null)
13+
const main = useRef(null);
1414

15-
const executeScroll = () => main.current.scrollIntoView()
15+
const executeScroll = () => {
16+
if (main.current) {
17+
main.current.scrollIntoView();
18+
}
19+
};
1620

1721
useEffect(() => {
1822
if (speechState === SpeechState.Recording) {
@@ -22,7 +26,14 @@ const App = () => {
2226

2327
return (
2428
<div>
25-
<Grid className={classes.grid} container spacing={0} alignItems="center" justify="center" style={{ height: '100vh'}}>
29+
<Grid
30+
className={classes.grid}
31+
container
32+
spacing={0}
33+
alignItems="center"
34+
justifyContent="center" // Change this line based on Material-UI version
35+
style={{ height: '100vh' }}
36+
>
2637
<Grid item xs={12} sm={4} className={classes.mobile}>
2738
<Details title="Income" />
2839
</Grid>

0 commit comments

Comments
 (0)