Skip to content
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

Increase the size of the mobile drawer 'resize' button #616

Merged
merged 5 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Components/SideDrawer/HorizonResizerButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ export default function HorizonResizerButton({
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
cursor: 'col-resize',
resize: 'horizontal',
...(isOnLeft ? {
left: 0,
Expand All @@ -178,6 +177,7 @@ export default function HorizonResizerButton({
justifyContent: 'center',
gap: `${gripSize}px`,
background: theme.palette.primary.background,
cursor: 'col-resize',
}}
ref={resizerRef}
data-testid="x_resizer"
Expand Down
2 changes: 1 addition & 1 deletion src/Components/SideDrawer/SideDrawer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export default function SideDrawer() {
display: 'flex',
flexDirection: 'row',
width: '100%',
borderLeft: isMobile ? 'none' : `solid 1px ${borderColor}`,
borderRadius: 0,
background: theme.palette.primary.background,
}}
ref={sidebarRef}
onMouseDown={(e) => e.preventDefault()}
Expand Down
12 changes: 7 additions & 5 deletions src/Components/SideDrawer/VerticalResizerButton.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, {useEffect, useState, useCallback, useRef} from 'react'
import {useDoubleTap} from 'use-double-tap'
import Box from '@mui/material/Box'
import Paper from '@mui/material/Paper'
import useTheme from '@mui/styles/useTheme'
import {MOBILE_HEIGHT} from '../../utils/constants'
import {isNumber} from '../../utils/strings'
Expand Down Expand Up @@ -29,8 +30,6 @@ export default function VerticalResizerButton({
const theme = useTheme()
const gripButtonRatio = 0.5
const gripSize = thickness * gripButtonRatio
// eslint-disable-next-line no-magic-numbers
const verticalPadding = (thickness - gripSize) / 2

const startResizing = useCallback(() => {
setIsResizing(true)
Expand Down Expand Up @@ -168,15 +167,18 @@ export default function VerticalResizerButton({
}),
}}
>
<Box
<Paper
sx={{
padding: `${verticalPadding}px ${gripSize}px`,
width: '150px',
paddingTop: `10px`,
paddingBottom: '40px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: `${gripSize}px`,
background: theme.palette.primary.background,
}}
elevation={0}
ref={resizerRef}
data-testid="y_resizer"
onMouseDown={startResizing}
Expand All @@ -194,7 +196,7 @@ export default function VerticalResizerButton({
}}
/>,
)}
</Box>
</Paper>
</Box>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const MOBILE_WIDTH = 500
export const MOBILE_HEIGHT = '50vh'
export const MOBILE_HEIGHT = '70vh'