Skip to content

Commit

Permalink
Created a custom-styled component in for better isolation of challeng…
Browse files Browse the repository at this point in the history
…e-specific styling.
  • Loading branch information
itcreativeusa committed Oct 13, 2024
1 parent b36c94b commit d970987
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/js/common/components/ChallengeListRoot/ChallengeCardList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { isWebApp } from '../../utils/isCordovaOrWebApp';
import ChallengeStore from '../../stores/ChallengeStore';
import JoinChallengeAndLearnMoreButtons from '../Challenge/JoinChallengeAndLearnMoreButtons';
import JoinedAndDaysLeft from '../Challenge/JoinedAndDaysLeft';
import DesignTokenColors from '../Style/DesignTokenColors';

const DelayedLoad = React.lazy(() => import(/* webpackChunkName: 'DelayedLoad' */ '../Widgets/DelayedLoad'));

Expand Down Expand Up @@ -184,9 +185,9 @@ class ChallengeCardList extends Component {
useVerticalCard={useVerticalCard}
/>
{/* JoinedAndDaysLeft component positioned absolutely */}
<StyledJoinedAndDaysLeft>
<JoinedAndDaysForChallengePage>
<JoinedAndDaysLeft challengeWeVoteId={oneChallenge.challenge_we_vote_id} />
</StyledJoinedAndDaysLeft>
</JoinedAndDaysForChallengePage>
</CardContainer>
<Link
id="challengeCardAbout"
Expand Down Expand Up @@ -220,16 +221,16 @@ class ChallengeCardList extends Component {
)}
*/}
{!!(challengeList &&
challengeList.length > 1 &&
numberToDisplay < challengeList.length) &&
(
<LoadMoreItemsManuallyWrapper>
<LoadMoreItemsManually
loadMoreFunction={this.loadMoreHasBeenClicked}
uniqueExternalId="ChallengeCardList"
/>
</LoadMoreItemsManuallyWrapper>
)}
challengeList.length > 1 &&
numberToDisplay < challengeList.length) &&
(
<LoadMoreItemsManuallyWrapper>
<LoadMoreItemsManually
loadMoreFunction={this.loadMoreHasBeenClicked}
uniqueExternalId="ChallengeCardList"
/>
</LoadMoreItemsManuallyWrapper>
)}
</ListWrapper>
<Suspense fallback={<></>}>
<DelayedLoad loadingTextLeftAlign showLoadingText waitBeforeShow={2000}>
Expand Down Expand Up @@ -293,18 +294,19 @@ const CardContainer = styled('div')`
const ChallengeCardForListVerticalWrapper = styled('div')`
display: flex;
flex-direction: column;
// height: ${isWebApp() ? '100%' : 'unset'};
// height: ${isWebApp() ? '100%' : 'unset'};
width: 80%;
max-width: 300px;
`;

const Wrapper = styled('div')`
min-height: 30px;
`;
const StyledJoinedAndDaysLeft = styled('div')`

const JoinedAndDaysForChallengePage = styled('div')`
align-items: center;
border-radius: 20px;
color: #000;
color: ${DesignTokenColors.gray900};
display: flex;
font-size: 12px;
left: 10px;
Expand Down

0 comments on commit d970987

Please sign in to comment.