Tablet card feature (#118)
* Add tablet mode to vote card * Tablet mode CardFeature * Change CardFeature conditions of text
This commit is contained in:
parent
07fdec26e1
commit
8e6ba7ec48
|
@ -40,6 +40,7 @@ export const CardVoteWrap = styled.div`
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
padding-top: 56px;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
border-radius: unset;
|
border-radius: unset;
|
||||||
border-bottom: 1px solid #e0e0e0;
|
border-bottom: 1px solid #e0e0e0;
|
||||||
|
|
|
@ -36,14 +36,14 @@ export const CardFeature = ({ community, heading, icon, sum, timeLeft, currentVo
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CardVoteBlock>
|
<CardVoteBlock>
|
||||||
<CardHeading style={{ fontWeight: timeLeft ? 'normal' : 'bold', fontSize: timeLeft ? '15px' : '17px' }}>
|
<CardHeadingFeature style={{ fontWeight: timeLeft ? 'normal' : 'bold', fontSize: timeLeft ? '15px' : '17px' }}>
|
||||||
{heading}
|
{heading}
|
||||||
</CardHeading>
|
</CardHeadingFeature>
|
||||||
|
|
||||||
<FeatureVote>
|
<FeatureVote>
|
||||||
<FeatureIcon>{icon}</FeatureIcon>
|
<FeatureIcon>{icon}</FeatureIcon>
|
||||||
|
|
||||||
{timeLeft && <span>{timeLeft}</span>}
|
{timeLeft && !sum && <span>{timeLeft}</span>}
|
||||||
|
|
||||||
{sum && (
|
{sum && (
|
||||||
<FeatureText>
|
<FeatureText>
|
||||||
|
@ -51,6 +51,21 @@ export const CardFeature = ({ community, heading, icon, sum, timeLeft, currentVo
|
||||||
</FeatureText>
|
</FeatureText>
|
||||||
)}
|
)}
|
||||||
</FeatureVote>
|
</FeatureVote>
|
||||||
|
|
||||||
|
<FeatureVoteMobile>
|
||||||
|
{timeLeft && !sum && (
|
||||||
|
<FeatureText>
|
||||||
|
{icon} {heading}: <span>{timeLeft}</span>
|
||||||
|
</FeatureText>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{sum && (
|
||||||
|
<FeatureTextWeekly>
|
||||||
|
{icon} <span style={{ color: '#676868', fontWeight: 'normal' }}>Weekly Feature Vote: </span>
|
||||||
|
<span>{addCommas(sum)}</span> SNT
|
||||||
|
</FeatureTextWeekly>
|
||||||
|
)}
|
||||||
|
</FeatureVoteMobile>
|
||||||
<div>
|
<div>
|
||||||
{showFeatureModal && (
|
{showFeatureModal && (
|
||||||
<Modal heading="Feature in “Weekly Featured”?" setShowModal={setShowFeatureModal}>
|
<Modal heading="Feature in “Weekly Featured”?" setShowModal={setShowFeatureModal}>
|
||||||
|
@ -78,6 +93,11 @@ export const CardFeature = ({ community, heading, icon, sum, timeLeft, currentVo
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CardHeadingFeature = styled(CardHeading)`
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
`
|
||||||
const FeatureBottom = styled.div`
|
const FeatureBottom = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
@ -102,6 +122,21 @@ const FeatureVote = styled(ColumnFlexDiv)`
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
|
const FeatureVoteMobile = styled(ColumnFlexDiv)`
|
||||||
|
display: none;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 32px;
|
||||||
|
margin-top: -14px;
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const FeatureText = styled.p`
|
const FeatureText = styled.p`
|
||||||
|
@ -111,3 +146,10 @@ const FeatureText = styled.p`
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
const FeatureTextWeekly = styled(FeatureText)`
|
||||||
|
& > span {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 22px;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
|
@ -142,6 +142,8 @@ const CardHeadingEndedVote = styled.p`
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
margin-bottom: 26px;
|
||||||
|
margin-top: -30px;
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ export function VoteChart({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Votes>
|
<Votes>
|
||||||
<VotesChart>
|
<VotesChart className={selectedVote || tabletMode ? '' : 'notModal'}>
|
||||||
<VoteBox style={{ filter: voteWinner && voteWinner === 2 ? 'grayscale(1)' : 'none' }}>
|
<VoteBox style={{ filter: voteWinner && voteWinner === 2 ? 'grayscale(1)' : 'none' }}>
|
||||||
<p style={{ fontSize: voteWinner === 1 ? '42px' : '24px', marginTop: voteWinner === 2 ? '18px' : '0' }}>
|
<p style={{ fontSize: voteWinner === 1 ? '42px' : '24px', marginTop: voteWinner === 2 ? '18px' : '0' }}>
|
||||||
{voteConstants.against.icon}
|
{voteConstants.against.icon}
|
||||||
|
@ -99,6 +99,12 @@ const VotesChart = styled.div`
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-bottom: 13px;
|
margin-bottom: 13px;
|
||||||
|
|
||||||
|
&.notModal {
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const VoteBox = styled.div`
|
const VoteBox = styled.div`
|
||||||
|
@ -132,13 +138,15 @@ const TimeLeft = styled.div`
|
||||||
|
|
||||||
&.notModal {
|
&.notModal {
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
top: 0;
|
top: -16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const VoteGraphBarWrap = styled.div`
|
const VoteGraphBarWrap = styled.div`
|
||||||
position: static;
|
position: static;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
&.notModal {
|
&.notModal {
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
|
|
Loading…
Reference in New Issue