feat: show button based on recording state

This commit is contained in:
karishmas6
2024-10-10 21:47:23 +05:30
parent e670461799
commit c5312e3d2f

View File

@@ -70,11 +70,30 @@ export const NavBar: React.FC<NavBarProps> = ({ newRecording, recordingName, isR
}}> }}>
{ {
!isRecording ? ( !isRecording ? (
<IconButton <>
aria-label="new" <IconButton
size={"small"} aria-label="new"
onClick={handleNewRecording} size={"small"}
sx={{ onClick={handleNewRecording}
sx={{
width: '140px',
borderRadius: '5px',
padding: '8px',
background: '#ff00c3',
color: 'white',
marginRight: '10px',
fontFamily: '"Roboto","Helvetica","Arial",sans-serif',
fontWeight: '500',
fontSize: '0.875rem',
lineHeight: '1.75',
letterSpacing: '0.02857em',
'&:hover': { color: 'white', backgroundColor: '#ff00c3' }
}
}
>
<Add sx={{ marginRight: '5px' }} /> Create Robot
</IconButton>
<IconButton sx={{
width: '140px', width: '140px',
borderRadius: '5px', borderRadius: '5px',
padding: '8px', padding: '8px',
@@ -87,11 +106,10 @@ export const NavBar: React.FC<NavBarProps> = ({ newRecording, recordingName, isR
lineHeight: '1.75', lineHeight: '1.75',
letterSpacing: '0.02857em', letterSpacing: '0.02857em',
'&:hover': { color: 'white', backgroundColor: '#ff00c3' } '&:hover': { color: 'white', backgroundColor: '#ff00c3' }
} }} onClick={logout}>
} <Logout sx={{ marginRight: '5px' }} />
> Logout</IconButton>
<Add sx={{ marginRight: '5px' }} /> Create Robot </>
</IconButton>
) : "" ) : ""
} }
{ {
@@ -113,22 +131,6 @@ export const NavBar: React.FC<NavBarProps> = ({ newRecording, recordingName, isR
<MeetingRoomIcon sx={{ marginRight: '5px' }} /> <MeetingRoomIcon sx={{ marginRight: '5px' }} />
exit</Button> exit</Button>
: null} : null}
<IconButton sx={{
width: '140px',
borderRadius: '5px',
padding: '8px',
background: '#ff00c3',
color: 'white',
marginRight: '10px',
fontFamily: '"Roboto","Helvetica","Arial",sans-serif',
fontWeight: '500',
fontSize: '0.875rem',
lineHeight: '1.75',
letterSpacing: '0.02857em',
'&:hover': { color: 'white', backgroundColor: '#ff00c3' }
}} onClick={logout}>
<Logout sx={{ marginRight: '5px' }} />
Logout</IconButton>
</div> </div>
</> </>
) : "" ) : ""