Skip to content

Commit

Permalink
#58 backlog scrolling tweak
Browse files Browse the repository at this point in the history
- do not scroll whole left-side area
- scroll stories, form stays fixed
  • Loading branch information
[email protected] authored and [email protected] committed Sep 19, 2020
1 parent 9726674 commit 9369bb5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 2 additions & 0 deletions client/app/components/Backlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {showTrash, hideTrash} from '../actions';
import BacklogActive from './BacklogActive';
import BacklogTrash from './BacklogTrash';
import {StyledBacklog} from '../styled/Backlog';
import StoryAddForm from './StoryAddForm';

/**
* The backlog contains two display modes: active and trash
Expand Down Expand Up @@ -34,6 +35,7 @@ const Backlog = ({
/>

{trashShown && <BacklogTrash />}
{!trashShown && <StoryAddForm />}
{!trashShown && <BacklogActive />}
</StyledBacklog>
);
Expand Down
3 changes: 0 additions & 3 deletions client/app/components/BacklogActive.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {connect} from 'react-redux';
import PropTypes from 'prop-types';
import {useDropzone} from 'react-dropzone';

import StoryAddForm from './StoryAddForm';
import StoryEditForm from './StoryEditForm';
import Story from './Story';

Expand Down Expand Up @@ -44,8 +43,6 @@ const BacklogActive = ({t, stories, importCsvFile}) => {
isReject={isDragReject}
></StyledFileImportDropZoneOverlay>

<StoryAddForm />

{hasActiveStories && (
<StyledStories>
{activeStories.map((story) =>
Expand Down
6 changes: 3 additions & 3 deletions client/app/components/BacklogTrash.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {connect} from 'react-redux';
import PropTypes from 'prop-types';

import TrashedStory from './TrashedStory';
import {StyledBacklogInfoText, StyledStories} from '../styled/Backlog';
import {StyledBacklogInfoText, StyledStoriesScrolling} from '../styled/Backlog';

/**
*
Expand All @@ -15,11 +15,11 @@ const BacklogTrash = ({t, stories}) => {
return (
<React.Fragment>
{hasTrashedStories && (
<StyledStories>
<StyledStoriesScrolling>
{trashedStories.map((story) => (
<TrashedStory story={story} key={story.id} />
))}
</StyledStories>
</StyledStoriesScrolling>
)}
{!hasTrashedStories && <StyledBacklogInfoText>{t('trashEmpty')}</StyledBacklogInfoText>}
</React.Fragment>
Expand Down
12 changes: 10 additions & 2 deletions client/app/styled/Backlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ export const StyledBacklog = styled.div`
left: ${({shown}) => (shown ? LEFT_MENU_WIDTH + 'px' : '0')};
bottom: 0;
z-index: 1000;
overflow-y: auto;
box-sizing: border-box;
padding-top: 44px;
background: ${COLOR_BACKGROUND_GREY};
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
@media (min-width: ${MEDIA_MIN_WIDTH_THRESH}) {
left: ${LEFT_MENU_WIDTH}px;
Expand All @@ -35,6 +38,10 @@ export const StyledStories = styled.div`
margin: 16px 8px 0 8px;
`;

export const StyledStoriesScrolling = styled(StyledStories)`
overflow-y: auto;
`;

export const StyledEditForm = styled.form`
background: #fff;
box-sizing: border-box;
Expand Down Expand Up @@ -74,7 +81,8 @@ export const StyledBacklogInfoText = styled.div`
export const StyledFileImportDropZone = styled.div`
outline: none;
border: none;
min-height: 90%;
overflow: auto;
flex-grow: 1;
`;

const dzOverlayAcceptBorder = '4px dashed rgba(0, 153, 204, 0.25)';
Expand Down

0 comments on commit 9369bb5

Please sign in to comment.