refactor: rename menu & tab update functions

This commit is contained in:
amhsirak
2024-12-08 21:09:42 +05:30
parent f8f1d926d9
commit 07c1404708

View File

@@ -43,17 +43,17 @@ export const NavBar: React.FC<NavBarProps> = ({ recordingName, isRecording }) =>
} }
}; };
const handleOpen = () => { const handleUpdateOpen = () => {
setOpen(true); setOpen(true);
fetchLatestVersion(); fetchLatestVersion();
}; };
const handleClose = () => { const handleUpdateClose = () => {
setOpen(false); setOpen(false);
setTab(0); // Reset tab to the first tab setTab(0); // Reset tab to the first tab
}; };
const handleTabChange = (newValue: any) => { const handleUpdateTabChange = (newValue: any) => {
setTab(newValue); setTab(newValue);
}; };
@@ -103,10 +103,10 @@ export const NavBar: React.FC<NavBarProps> = ({ recordingName, isRecording }) =>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end' }}> <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end' }}>
{!isRecording ? ( {!isRecording ? (
<> <>
<Button variant="contained" onClick={handleOpen}> <Button variant="contained" onClick={handleUpdateOpen}>
Check for Updates Check for Updates
</Button> </Button>
<Modal open={open} onClose={handleClose}> <Modal open={open} onClose={handleUpdateClose}>
<Box <Box
sx={{ sx={{
position: "absolute", position: "absolute",
@@ -133,7 +133,7 @@ export const NavBar: React.FC<NavBarProps> = ({ recordingName, isRecording }) =>
</Typography> </Typography>
<Tabs <Tabs
value={tab} value={tab}
onChange={handleTabChange} onChange={handleUpdateTabChange}
sx={{ marginTop: 2, marginBottom: 2 }} sx={{ marginTop: 2, marginBottom: 2 }}
centered centered
> >