Add styles for newsletter date and segments

[MAILPOET-2791]
This commit is contained in:
Pavel Dohnal
2020-10-14 12:56:30 +02:00
committed by Veljko V
parent 7a4c14864e
commit 3e5ddaaf83
3 changed files with 52 additions and 21 deletions

View File

@@ -1,3 +1,31 @@
.mailpoet-stats-page {
color: $color-tertiary;
font-family: $font-family;
font-size: $font-size-small;
line-height: 1.71;
}
.mailpoet-stats-info {
background-color: $color-white;
box-shadow: 0 1px 0 0 $color-tertiary-light;
margin: 0;
padding-bottom: $grid-gap;
padding-left: $grid-gap;
width: 100%;
}
.mailpoet-stats-segments {
font-weight: 500;
.mailpoet-stats-segments-segment {
background-color: $color-tertiary-light;
border-radius: 2px;
font-weight: normal;
margin-right: $grid-gap;
padding: 4px $grid-gap-half;
}
}
.mailpoet_stat_triple-spaced { .mailpoet_stat_triple-spaced {
margin-bottom: 3rem; margin-bottom: 3rem;
} }
@@ -7,12 +35,8 @@
margin: 70px auto; margin: 70px auto;
} }
@include breakpoint-max-width(520px) { .wrap .mailpoet-top-bar,
.mailpoet_stat_info { .wrap .mailpoet-stats-info {
display: none; margin-left: -20px;
} margin-right: -20px;
.mailpoet_stat_general {
width: 100%;
}
} }

View File

@@ -1,8 +1,8 @@
import React from 'react'; import React from 'react';
import MailPoet from 'mailpoet'; import MailPoet from 'mailpoet';
import { NewsletterType } from './newsletter_type';
import Heading from 'common/typography/heading/heading'; import Heading from 'common/typography/heading/heading';
import Grid from 'common/grid'; import Grid from 'common/grid';
import { NewsletterType } from './newsletter_type';
type Props = { type Props = {
newsletter: NewsletterType newsletter: NewsletterType
@@ -21,26 +21,33 @@ export const NewsletterStatsInfo = ({
const time = timeFormat.format(new Date(newsletterDate)); const time = timeFormat.format(new Date(newsletterDate));
return ( return (
<Grid.ThreeColumns> <Grid.ThreeColumns className="mailpoet-stats-info">
<div> <div>
<Heading level={1}>{newsletter.subject}</Heading> <Heading level={1}>{newsletter.subject}</Heading>
<p> <div>
{date} <b>
{' • '} {date}
{time} {' • '}
</p> {time}
</b>
</div>
{Array.isArray(newsletter.segments) && newsletter.segments.length && ( {Array.isArray(newsletter.segments) && newsletter.segments.length && (
<p> <div className="mailpoet-stats-segments">
{MailPoet.I18n.t('statsToSegments')} {MailPoet.I18n.t('statsToSegments')}
{': '} {': '}
{newsletter.segments.map((segment) => ( {newsletter.segments.map((segment) => (
<span>{segment.name}</span> <span
className="mailpoet-stats-segments-segment"
key={segment.name}
>
{segment.name}
</span>
))} ))}
</p> </div>
)} )}
</div> </div>
<div /> <div />
<Grid.TwoColumns> <div className="mailpoet-stats-info-sender-preview">
<div> <div>
{newsletter.sender_address && ( {newsletter.sender_address && (
<p> <p>
@@ -73,7 +80,7 @@ export const NewsletterStatsInfo = ({
{MailPoet.I18n.t('statsPreviewNewsletter')} {MailPoet.I18n.t('statsPreviewNewsletter')}
</a> </a>
</div> </div>
</Grid.TwoColumns> </div>
</Grid.ThreeColumns> </Grid.ThreeColumns>
); );
}; };

View File

@@ -109,7 +109,7 @@ const CampaignStatsPage = ({ match, history, location }: Props) => {
<TopBarWithBeamer <TopBarWithBeamer
onLogoClick={() => history.push('/')} onLogoClick={() => history.push('/')}
/> />
<div> <div className="mailpoet-stats-page">
<InvalidMssKeyNotice <InvalidMssKeyNotice
mssKeyInvalid={(window as any).mailpoet_mss_key_invalid} mssKeyInvalid={(window as any).mailpoet_mss_key_invalid}
subscribersCount={(window as any).mailpoet_subscribers_count} subscribersCount={(window as any).mailpoet_subscribers_count}