Skip to content

Commit

Permalink
feat: display colorful space diff on synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia committed Apr 22, 2020
1 parent f9359f4 commit e8655ae
Show file tree
Hide file tree
Showing 14 changed files with 907 additions and 80 deletions.
15 changes: 15 additions & 0 deletions src/actions/syncSpace.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {
GET_SYNC_REMOTE_SPACE_SUCCEEDED,
GET_SYNC_LOCAL_SPACE_SUCCEEDED,
CLEAR_SYNC_SPACES,
SELECT_SYNC_PHASE,
CLEAR_SYNC_PHASES,
} from '../types';

export const getRemoteSpaceForSync = payload =>
Expand All @@ -16,3 +18,16 @@ export const clearSpacesForSync = () => dispatch => {
type: CLEAR_SYNC_SPACES,
});
};

export const clearPhasesForSync = () => dispatch => {
return dispatch({
type: CLEAR_SYNC_PHASES,
});
};

export const selectPhaseForSync = phase => dispatch => {
dispatch({
type: SELECT_SYNC_PHASE,
payload: phase,
});
};
10 changes: 8 additions & 2 deletions src/components/phase/PhaseItemDescription.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import InfoIcon from '@material-ui/icons/Info';
import Text from '../common/Text';
import './PhaseItemDescription.css';
Expand All @@ -13,12 +14,15 @@ const style = {
alignItems: 'center',
};

const PhaseItemDescription = ({ description }) => {
const PhaseItemDescription = ({ description, className }) => {
if (description && description !== '') {
return (
<div style={style}>
<InfoIcon color="primary" />
<Text content={description} className="PhaseItemDescriptionText" />
<Text
content={description}
className={clsx('PhaseItemDescriptionText', className)}
/>
</div>
);
}
Expand All @@ -27,10 +31,12 @@ const PhaseItemDescription = ({ description }) => {

PhaseItemDescription.propTypes = {
description: PropTypes.string,
className: PropTypes.string,
};

PhaseItemDescription.defaultProps = {
description: '',
className: null,
};

export default PhaseItemDescription;
8 changes: 2 additions & 6 deletions src/components/space/SpaceDescription.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ import {
SPACE_START_PREVIEW_BUTTON,
BANNER_WARNING_PREVIEW_ID,
SPACE_DESCRIPTION_ID,
SPACE_DESCRIPTION_TEXT_CLASS,
} from '../../config/selectors';

const style = {
fontSize: 'large',
};

const renderPreviewWarning = t => {
return (
<Banner
Expand All @@ -39,8 +36,7 @@ const SpaceDescription = ({ description, classes, start, saved }) => {
<div className={classes.spaceDescription} id={SPACE_DESCRIPTION_ID}>
<Text
content={description}
style={style}
className="SpaceDescriptionText"
className={SPACE_DESCRIPTION_TEXT_CLASS}
/>
</div>
<Button
Expand Down
Loading

0 comments on commit e8655ae

Please sign in to comment.