Skip to content

Commit

Permalink
Replaced react-rnd with re-resizable and fixed detail view position
Browse files Browse the repository at this point in the history
  • Loading branch information
ole1986 committed Dec 7, 2019
1 parent 3e151dc commit a1b7937
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 30 deletions.
7 changes: 3 additions & 4 deletions browser/src/components/LogView/Commit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Author from './Author';
import Avatar from './Avatar';
import { FileEntry } from './FileEntry';
import { GoX, GoClippy } from 'react-icons/lib/go';
import Rnd from 'react-rnd';
import { Resizable } from "re-resizable";
import * as ResultActions from '../../../actions/results';
import { gitmojify } from '../gitmojify';

Expand Down Expand Up @@ -78,8 +78,7 @@ class Commit extends React.Component<CommitProps, CommitState> {

return (
// tslint:disable-next-line:react-this-binding-issue
<Rnd className='details-view-cnt' default={ContainerStyle} minWidth={50} minHeight={50} maxHeight='50%' bounds='parent'
enableResizing={resizing} disableDragging={this.props.selectedEntry !== undefined}>
<Resizable className='details-view-cnt' defaultSize={ContainerStyle} minHeight={90} maxHeight='50%' enable={resizing}>
<div id='detail-view'>
<div className='authorAndCommitInfoContainer'>
<Avatar result={this.props.selectedEntry.author}></Avatar>
Expand All @@ -104,7 +103,7 @@ class Commit extends React.Component<CommitProps, CommitState> {
{this.renderFileEntries()}
</div>
</div>
</Rnd >);
</Resizable >);
}
}

Expand Down
4 changes: 3 additions & 1 deletion browser/src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ div.react-draggable {
}

div.details-view-cnt {
overflow: auto;
position: fixed !important;
background: var(--vscode-editor-background);
border-top-width: 1px;
border-top-style: solid;
Expand Down Expand Up @@ -468,8 +468,10 @@ div.details-view-cnt .commit-notes:empty {

#detail-view {
display: flex;
overflow-y: scroll;
flex-flow: row wrap;
justify-content: space-between;
max-height: 100%;
}

#detail-view .authorAndCommitInfoContainer {
Expand Down
37 changes: 13 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
"react-icons": "^2.2.7",
"react-json-tree": "^0.11.0",
"react-redux": "^5.0.6",
"react-rnd": "^7.1.5",
"re-resizable": "6.1.1",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-router-redux": "^4.0.8",
Expand Down

0 comments on commit a1b7937

Please sign in to comment.