Skip to content

Commit

Permalink
WV-755 Add icons to Voter Account navigation and headers of each sect…
Browse files Browse the repository at this point in the history
…ion [Team Review]
  • Loading branch information
John Mook authored and John Mook committed Jan 30, 2025
1 parent 23ff007 commit 96d3f7c
Show file tree
Hide file tree
Showing 10 changed files with 224 additions and 136 deletions.
15 changes: 13 additions & 2 deletions src/js/common/components/Challenge/ChallengeAbout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,20 +199,31 @@ export const CardRowsWrapper = styled('div')`
margin: 2px 0 0 2px;
padding-bottom: 20px;
overflow-y: auto;
height: 170px;
height: 165px;
@media screen and (min-width: 786px) {
height: auto;
overflow-y: visible;
}
`;

const ChallengeAboutWrapper = styled('div')`
white-space: normal;
position: relative;
height: auto;
margin-bottom: 40px;
@media screen and (min-width: 786px) {
margin-bottom: 20px;
}
&::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 15px;
height: 20px;
background: linear-gradient(to top, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
pointer-events: none;
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const styles = () => ({
joinChallengeButton: {
borderRadius: 45,
maxWidth: 300,
minWidth: 110,
// background: 'var(--Primary-600, #0858A1)',
// border: '1px solid var(--Primary-400, #4187C6)',
// color: 'var(--WhiteUI, #FFFFFF)',
Expand All @@ -42,6 +43,7 @@ const styles = () => ({
learnMoreButton: {
borderRadius: 45,
maxWidth: 300,
minWidth: 110,
// background: 'white',
// border: '1px solid var(--Primary-400, #4187C6)',
// color: 'var(--Neutral-900, #2A2A2C)',
Expand Down
40 changes: 21 additions & 19 deletions src/js/common/components/ChallengeListRoot/ChallengeCardList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,6 @@ class ChallengeCardList extends Component {
});
}

increaseNumberToDisplay = () => {
let { numberToDisplay } = this.state;
numberToDisplay += NUMBER_TO_ADD_WHEN_MORE_CLICKED;
this.setState({
numberToDisplay,
});
}

loadMoreHasBeenClicked = () => {
this.increaseNumberToDisplay();
// console.log('load more has been clicked');
if (this.props.loadMoreScroll) {
// console.log('loadMoreScroll exists');
this.props.loadMoreScroll();
}
}

onChallengeClickLink (challengeWeVoteId) {
const challenge = ChallengeStore.getChallengeByWeVoteId(challengeWeVoteId);
if (!challenge) {
Expand Down Expand Up @@ -158,6 +141,23 @@ class ChallengeCardList extends Component {
return challengeBasePath;
}

loadMoreHasBeenClicked = () => {
this.increaseNumberToDisplay();
// console.log('load more has been clicked');
if (this.props.loadMoreScroll) {
// console.log('loadMoreScroll exists');
this.props.loadMoreScroll();
}
}

increaseNumberToDisplay = () => {
let { numberToDisplay } = this.state;
numberToDisplay += NUMBER_TO_ADD_WHEN_MORE_CLICKED;
this.setState({
numberToDisplay,
});
}

render () {
renderLog('ChallengeCardList'); // Set LOG_RENDER_EVENTS to log all renders
// console.log('ChallengeCardList render');
Expand Down Expand Up @@ -302,14 +302,16 @@ const ChallengeCardForListVerticalWrapper = styled('div')`
display: flex;
flex-direction: column;
// height: ${isWebApp() ? '100%' : 'unset'};
height: 450px;
height: auto;
position: relative;
width: 80%;
max-width: 250px;
margin-right: 5px;
margin-bottom: 20px;
`;

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

const JoinedButtonsOuterWrapper = styled('div')`
bottom: 0;
Expand Down
26 changes: 13 additions & 13 deletions src/js/common/components/ChallengeListRoot/ChallengeListRoot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import ChallengeParticipantStore from '../../stores/ChallengeParticipantStore';
import isMobileScreenSize from '../../utils/isMobileScreenSize';

const ChallengeCardList = React.lazy(() => import(/* webpackChunkName: 'ChallengeCardList' */ './ChallengeCardList'));
const HORIZONTAL_SCROLL_DISTANCE_ON_LEFT_ARROW_CLICK = -630;
const HORIZONTAL_SCROLL_DISTANCE_ON_RIGHT_ARROW_CLICK = 630;
const HORIZONTAL_SCROLL_DISTANCE_ON_LEFT_ARROW_CLICK = -530;
const HORIZONTAL_SCROLL_DISTANCE_ON_RIGHT_ARROW_CLICK = 530;
const HORIZONTAL_SCROLL_DISTANCE_MOBILE_LEFT_ARROW_CLICK = -315;
const HORIZONTAL_SCROLL_DISTANCE_MOBILE_RIGHT_ARROW_CLICK = 315;
const HORIZONTAL_SCROLL_DISTANCE_ON_SHOW_MORE = 315;
Expand Down Expand Up @@ -79,6 +79,17 @@ class ChallengeListRoot extends Component {
this.challengeStoreListener.remove();
}

handleNumberOfResults (numberOfFilteredResults, numberOfSearchResults) {
// console.log('RepresentativeListRoot handleNumberOfResults numberOfFilteredResults:', numberOfFilteredResults, ', numberOfSearchResults:', numberOfSearchResults);
if (this.props.handleNumberOfResults) {
// Delay telling the parent component that the number of results has changed
// if (this.timer) clearTimeout(this.timer);
// this.timer = setTimeout(() => {
this.props.handleNumberOfResults(numberOfFilteredResults, numberOfSearchResults);
// }, 500);
}
}

onChallengeParticipantStoreChange () {
// We need to instantiate ChallengeParticipantStore before we call challengeListRetrieve so that store gets filled with data
}
Expand Down Expand Up @@ -254,17 +265,6 @@ class ChallengeListRoot extends Component {
}, () => { this.handleNumberOfResults(filteredList.length, challengeSearchResults.length); });
}

handleNumberOfResults (numberOfFilteredResults, numberOfSearchResults) {
// console.log('RepresentativeListRoot handleNumberOfResults numberOfFilteredResults:', numberOfFilteredResults, ', numberOfSearchResults:', numberOfSearchResults);
if (this.props.handleNumberOfResults) {
// Delay telling the parent component that the number of results has changed
// if (this.timer) clearTimeout(this.timer);
// this.timer = setTimeout(() => {
this.props.handleNumberOfResults(numberOfFilteredResults, numberOfSearchResults);
// }, 500);
}
}

leftAndRightArrowSetState = (el) => {
// set state here
const leftRightStateDict = leftAndRightArrowStateCalculation(el);
Expand Down
2 changes: 1 addition & 1 deletion src/js/common/components/Style/ScrollingStyles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const CampaignsScrollingOuterWrapper = styled('div')`
export const ChallengesScrollingOuterWrapper = styled('div')`
display: flex;
justify-content: space-between;
height: 450px;
height: auto;
min-height: 450px;
min-width: 0;
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion src/js/common/utils/leftRightArrowCalculation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function handleHorizontalScroll (el, distance, func, rightMarginSize) {
const element = el;
// console.log(element.scrollLeft);
console.log(element.scrollLeft);
// 24 is the size of the right margin of each card
const offset = (element.scrollLeft % distance);
let scrollDistance = distance;
Expand Down
Loading

0 comments on commit 96d3f7c

Please sign in to comment.