Skip to content

Commit

Permalink
Merge pull request wevote#3875 from DaleMcGrew/Dale_WebApp_Mar30-2024
Browse files Browse the repository at this point in the history
Fix for a problem on the Topics pages.
  • Loading branch information
DaleMcGrew authored Mar 30, 2024
2 parents 6d56516 + 358c825 commit c8533cd
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 16 deletions.
8 changes: 6 additions & 2 deletions src/js/components/Organization/OpinionsFollowedList.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React, { Component, Suspense } from 'react';
import styled from 'styled-components';
import OrganizationActions from '../../actions/OrganizationActions';
import { renderLog } from '../../common/utils/logging';
import OrganizationDisplayForList from './OrganizationDisplayForList';
Expand Down Expand Up @@ -55,12 +56,15 @@ export default class OpinionsFollowedList extends Component {
});

return (
<div className="guidelist card-child__list-group">
<OpinionsFollowedListWrapper className="guidelist card-child__list-group">
{organizationsList}
</div>
</OpinionsFollowedListWrapper>
);
}
}
OpinionsFollowedList.propTypes = {
organizationsFollowed: PropTypes.array,
};

const OpinionsFollowedListWrapper = styled('div')`
`;
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React, { Component, Suspense } from 'react';
import styled from 'styled-components';
import OrganizationActions from '../../actions/OrganizationActions';
import { renderLog } from '../../common/utils/logging';
import OrganizationDisplayForListCompressed from './OrganizationDisplayForListCompressed';
Expand Down Expand Up @@ -76,13 +77,16 @@ export default class OpinionsFollowedListCompressed extends Component {
});

return (
<div className="guidelist card-child__list-group">
<OpinionsFollowedListCompressedWrapper className="guidelist card-child__list-group">
{organizationsList}
</div>
</OpinionsFollowedListCompressedWrapper>
);
}
}
OpinionsFollowedListCompressed.propTypes = {
organizationsFollowed: PropTypes.array,
editMode: PropTypes.bool,
};

const OpinionsFollowedListCompressedWrapper = styled('div')`
`;
8 changes: 6 additions & 2 deletions src/js/components/Organization/OpinionsIgnoredList.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import styled from 'styled-components';
import { renderLog } from '../../common/utils/logging';
import OrganizationDisplayForList from './OrganizationDisplayForList';

Expand Down Expand Up @@ -35,7 +36,7 @@ export default class OpinionsIgnoredList extends Component {


return (
<div className="guidelist card-child__list-group">
<OpinionsIgnoredListWrapper className="guidelist card-child__list-group">
{this.state.organizationsIgnored.map((organization) => (
<OrganizationDisplayForList
key={organization.organization_we_vote_id}
Expand All @@ -47,10 +48,13 @@ export default class OpinionsIgnoredList extends Component {
twitterHandle={organization.twitter_handle}
/>
))}
</div>
</OpinionsIgnoredListWrapper>
);
}
}
OpinionsIgnoredList.propTypes = {
organizationsIgnored: PropTypes.array,
};

const OpinionsIgnoredListWrapper = styled('div')`
`;
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types';
import React, { Component, Suspense } from 'react';
import { Link } from 'react-router-dom';
import styled from 'styled-components';
import { renderLog } from '../../common/utils/logging';

const ImageHandler = React.lazy(() => import(/* webpackChunkName: 'ImageHandler' */ '../ImageHandler'));
Expand All @@ -26,7 +27,7 @@ export default class OrganizationDisplayForListCompressed extends Component {
const voterGuideLink = organizationTwitterHandle ? `/${organizationTwitterHandle}` : `/voterguide/${organizationWeVoteId}`;

return (
<div id="organizationDisplayForListCompressed" className="card-child card-child--not-followed">
<OrganizationDisplayForListCompressedWrapper id="organizationDisplayForListCompressed" className="card-child card-child--not-followed">
<div className="card-child__media-object-anchor">
<Link to={voterGuideLink} className="u-no-underline">
<Suspense fallback={<></>}>
Expand All @@ -46,7 +47,7 @@ export default class OrganizationDisplayForListCompressed extends Component {
</div>
</div>
</div>
</div>
</OrganizationDisplayForListCompressedWrapper>
);
}
}
Expand All @@ -57,3 +58,6 @@ OrganizationDisplayForListCompressed.propTypes = {
children: PropTypes.array, // A list of the tags in OrganizationDisplayForList when called (from GuideList for example)
organization_twitter_handle: PropTypes.string,
};

const OrganizationDisplayForListCompressedWrapper = styled('div')`
`;
13 changes: 8 additions & 5 deletions src/js/components/Organization/OrganizationList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class OrganizationList extends Component {
);
}
return (
<div>
<OrganizationListWrapper>
{(organizationListToDisplay && organizationListToDisplayCount) ? (
<div>
{organizationListToDisplay.map((organization) => {
Expand Down Expand Up @@ -172,7 +172,7 @@ class OrganizationList extends Component {
)}
</div>
) : null}
</div>
</OrganizationListWrapper>
);
}
}
Expand All @@ -184,13 +184,16 @@ OrganizationList.propTypes = {
organizationListIdentifier: PropTypes.string,
};

const ShowMoreItemsWrapper = styled('div')`
`;

const NoSearchResultWrapper = styled.div`
display: flex;
flex-direction: column;
align-items: center;
`;

const OrganizationListWrapper = styled('div')`
`;

const ShowMoreItemsWrapper = styled('div')`
`;

export default (OrganizationList);
7 changes: 5 additions & 2 deletions src/js/components/VoterGuide/GuideList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class GuideList extends Component {
);
}
return (
<div>
<GuideListWrapper>
{(filteredOrganizationsWithPositions.length && voterGuideListCount) ? (
<div className="guidelist">
{filteredOrganizationsWithPositions.map((organization) => {
Expand Down Expand Up @@ -249,7 +249,7 @@ class GuideList extends Component {
)}
</div>
) : null}
</div>
</GuideListWrapper>
);
}
}
Expand All @@ -260,6 +260,9 @@ GuideList.propTypes = {
increaseNumberOfItemsOnScroll: PropTypes.bool,
};

const GuideListWrapper = styled('div')`
`;

const ShowMoreItemsWrapper = styled('div')`
`;

Expand Down
3 changes: 2 additions & 1 deletion src/js/pages/Values/OneValue.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ class OneValue extends Component {
</SearchBarWrapper>
<Suspense fallback={<></>}>
<OrganizationList
incomingOrganizationList={showEndorsersForThisElection ? voterGuidesForValue : []}
incomingOrganizationList={showAllEndorsers ? organizationsForValue : []}
// incomingOrganizationList={showEndorsersForThisElection ? voterGuidesForValue : []} // Causes double-display of orgs. Needs another look.
increaseNumberOfItemsOnScroll
organizationListIdentifier={showAllEndorsers ? organizationListIdentifier : 'noOrganizations'}
/>
Expand Down

0 comments on commit c8533cd

Please sign in to comment.