Skip to content

Commit

Permalink
Merge pull request #4171 from jedwardmook/WV-661
Browse files Browse the repository at this point in the history
[TEAM REVIEW]  https://wevoteusa.atlassian.net/browse/WV-661 - fixes from last meeting 11-7
  • Loading branch information
DaleMcGrew authored Nov 14, 2024
2 parents d63e2f9 + 69a23c9 commit 2ce761d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/js/components/Activity/ActivityPostAdd.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ActivityPostAdd extends Component {

render () {
renderLog('ActivityPostAdd'); // Set LOG_RENDER_EVENTS to log all renders
const { classes, externalUniqueId } = this.props;
const { classes, externalUniqueId, activityTidbitWeVoteId } = this.props;
const {
showActivityPostModal,
voterPhotoUrlMedium, statementText,
Expand Down Expand Up @@ -146,7 +146,7 @@ class ActivityPostAdd extends Component {
{showActivityPostModal && (
<Suspense fallback={<></>}>
<ActivityPostModal
activityPostWeVoteId=""
activityTidbitWeVoteId={activityTidbitWeVoteId}
externalUniqueId={externalUniqueId}
show={showActivityPostModal}
toggleModal={this.toggleActivityPostModal}
Expand All @@ -161,6 +161,7 @@ class ActivityPostAdd extends Component {
ActivityPostAdd.propTypes = {
externalUniqueId: PropTypes.string,
classes: PropTypes.object,
activityTidbitWeVoteId: PropTypes.string,
};

const styles = (theme) => ({
Expand Down
12 changes: 7 additions & 5 deletions src/js/components/Activity/ActivityPostModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ const ActivityPostModal = (props) => {
}
}, [initialFocusSet]);

onBlurInput = () => {
};
// onBlurInput = () => {
// };

const onFocusInput = () => {
prepareForCordovaKeyboard('ActivityPostModal');
Expand All @@ -88,17 +88,19 @@ const ActivityPostModal = (props) => {
setStatementText(e.target.value);
};

const activityTidbitIdCheck = activityTidbitWeVoteId === '' || activityTidbitWeVoteId === undefined;

renderLog('ActivityPostModal'); // Set LOG_RENDER_EVENTS to log all renders

const dialogTitleText = activityTidbitWeVoteId === '' ? 'Create Post' : 'Edit Post';
const dialogTitleText = activityTidbitIdCheck ? 'Create Post' : 'Edit Post';
const statementPlaceholderText = 'What\'s on your mind?';
const rowsToShow = isAndroid() ? 4 : 6;

const textFieldJSX = (
<TextFieldWrapper>
<TextFieldForm
className={classes.formStyles}
onBlur={onBlurInput}
// onBlur={onBlurInput}
onFocus={onFocusInput}
onSubmit={saveActivityPost}
>
Expand Down Expand Up @@ -133,7 +135,7 @@ const ActivityPostModal = (props) => {
type="submit"
disabled={!statementText}
>
{activityTidbitWeVoteId === '' ? 'Post' : 'Save Changes'}
{activityTidbitIdCheck ? 'Post' : 'Save Changes'}
</Button>
</PostSaveButton>
</TextFieldForm>
Expand Down
4 changes: 3 additions & 1 deletion src/js/pages/Activity/News.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@ class News extends Component {
<>
{voterIsSignedIn && (
<ActivityPostAddWrapper style={reduceConstraintsIfCordova}>
<ActivityPostAdd />
<ActivityPostAdd
activityTidbitWeVoteId={activityTidbitWeVoteId}
/>
</ActivityPostAddWrapper>
)}
{voterIsSignedIn && (
Expand Down

0 comments on commit 2ce761d

Please sign in to comment.