Skip to content

Commit

Permalink
fix(Todos): Fix Franz Todos to be resizable again
Browse files Browse the repository at this point in the history
  • Loading branch information
adlk committed Apr 7, 2022
1 parent c22f871 commit 4b5d2f7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/features/todos/components/TodosWebview.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const styles = theme => ({
root: {
background: theme.colorBackground,
position: 'relative',
borderLeft: ({ isVisible }) => (isVisible ? [`1px solid ${theme.todos.todosLayer.borderLeftColor}`] : 0),
borderLeft: ({ isVisible }) => (isVisible ? [`2px solid ${theme.todos.todosLayer.borderLeftColor}`] : 0),
},
resizeHandler: {
position: 'absolute',
Expand All @@ -47,7 +47,6 @@ const styles = theme => ({
width: 5,
zIndex: 400,
background: theme.todos.dragIndicator.background,

},
premiumContainer: {
display: 'flex',
Expand Down Expand Up @@ -104,7 +103,9 @@ class TodosWebview extends Component {
this.resizeBrowserView();
});

todosContainerRef = React.createRef()
todosContainerRef = React.createRef();

todosResizeContainerRef = React.createRef();

componentWillMount() {
const { width } = this.props;
Expand Down Expand Up @@ -188,14 +189,14 @@ class TodosWebview extends Component {
}

resizeBrowserView() {
if (this.todosContainerRef.current) {
const bounds = this.todosContainerRef.current.getBoundingClientRect();
if (this.todosResizeContainerRef.current) {
const bounds = this.todosResizeContainerRef.current.getBoundingClientRect();

ipcRenderer.send(RESIZE_TODO_VIEW, {
width: bounds.width,
height: bounds.height,
x: bounds.x,
y: this.todosContainerRef.current.offsetTop,
y: this.todosResizeContainerRef.current.offsetTop,
});
}
}
Expand Down Expand Up @@ -246,6 +247,7 @@ class TodosWebview extends Component {
style={{ left: delta }} // This hack is required as resizing with webviews beneath behaves quite bad
/>
)}
<div ref={this.todosResizeContainerRef} />
{!isTodosIncludedInCurrentPlan && (
<Appear>
<div className={classes.premiumContainer}>
Expand Down

0 comments on commit 4b5d2f7

Please sign in to comment.