Skip to content

fix: info menu overflows on mobile, issue #221 #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions src/components/DriveView/Media.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,30 @@ const styles = (theme) => ({
},
},
},
viewCabanaUploadsSmall: {
display: 'flex',
alignItems: 'center',
fontSize: '0.5rem',
padding: '0 6px 0 2px',
borderRadius: 4,
backgroundColor: Colors.white08,
marginLeft: 8,
'& svg': {
height: 12,
},
'& button': {
marginLeft: 6,
marginRight: -6,
color: Colors.white,
fontSize: '0.5rem',
padding: '4px 0',
minHeight: 19,
backgroundColor: Colors.white05,
'&:hover': {
backgroundColor: Colors.white10,
},
},
},
shareButton: {
display: 'flex',
alignItems: 'center',
Expand Down Expand Up @@ -663,13 +687,23 @@ class Media extends Component {
transformOrigin={{ vertical: 'top', horizontal: 'right' }}>
<MenuItem className={ classes.copySegment } onClick={ this.copySegmentName }
style={{ fontSize: windowWidth > 400 ? '0.8rem' : '0.7rem' }}>
<div>{ currentSegment ? `${currentSegment.route}--${this.currentSegmentNum()}` : '---' }</div>
{ windowWidth > 400 ? (
<div>
{ currentSegment ? `${currentSegment.route}--${this.currentSegmentNum()}` : '---' }
</div>
) : (
<div>
{ currentSegment ? `${currentSegment.route}--${this.currentSegmentNum()}`.substring(0,21) + '...' : '---' }
</div>
)}
<ContentCopyIcon />
</MenuItem>
<MenuItem onClick={ this.openInCabana } id="openInCabana" >
<div style={{ fontSize: windowWidth > 400 ? '1rem' : '0.8rem' }}>
View in cabana
</div>
{ Boolean(files && stats && stats.canRequestRlog) &&
<div className={ classes.viewCabanaUploads }>
<div className={ windowWidth > 400 ? classes.viewCabanaUploads : classes.viewCabanaUploadsSmall }>
<WarningIcon /> missing { stats.canRequestRlog } logs
<Button onClick={ (ev) => { this.uploadFilesAll(['logs']); ev.stopPropagation(); } }>upload</Button>
</div>
Expand All @@ -681,7 +715,9 @@ class Media extends Component {
}
</MenuItem>
<MenuItem onClick={ this.openInUseradmin }>
<div style={{ fontSize: windowWidth > 400 ? '1rem' : '0.8rem' }}>
View in useradmin
</div>
</MenuItem>
{ typeof navigator.share !== 'undefined' &&
<MenuItem onClick={ this.shareCurrentRoute } className={ classes.shareButton }>
Expand Down