-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Update monthly report for Civic Liker Classic
- Loading branch information
Showing
38 changed files
with
20,815 additions
and
6,980 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as React from 'react'; | ||
import { | ||
BorderProps, | ||
ClassNameProps, | ||
MjmlColumn, | ||
MjmlSectionProps, | ||
MjmlImage, | ||
PaddingProps, | ||
} from 'mjml-react'; | ||
|
||
import { getAssetPath } from '../utils/url'; | ||
|
||
import { BasicSection, BasicSectionProps } from './sections/basic'; | ||
|
||
export const CivicLikerClassicBadge = ( | ||
props: BasicSectionProps & | ||
MjmlSectionProps & | ||
BorderProps & | ||
PaddingProps & | ||
ClassNameProps | ||
) => { | ||
return ( | ||
<BasicSection | ||
backgroundColor="white" | ||
paddingTop={32} | ||
paddingBottom={24} | ||
{...props} | ||
> | ||
<MjmlColumn> | ||
<MjmlImage | ||
width={218} | ||
src={getAssetPath('/badges/[email protected]')} | ||
/> | ||
</MjmlColumn> | ||
</BasicSection> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import * as React from 'react'; | ||
import { MjmlColumn, MjmlImage } from 'mjml-react'; | ||
import { MjmlColumn, MjmlImage, MjmlGroup, MjmlText } from 'mjml-react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import * as Colors from '../constants/colors'; | ||
import { GetAppLink } from '../components/link'; | ||
|
||
import { getAssetPath } from '../utils/url'; | ||
|
||
|
@@ -13,13 +16,38 @@ export const HeaderSection = () => { | |
paddingLeft={40} | ||
paddingBottom={32} | ||
> | ||
<MjmlColumn> | ||
<MjmlImage | ||
align="left" | ||
width={90} | ||
src={getAssetPath('/liker-land-logo.png')} | ||
/> | ||
</MjmlColumn> | ||
<MjmlGroup> | ||
<MjmlColumn width="65%"> | ||
<MjmlImage | ||
align="left" | ||
width={145} | ||
src={getAssetPath( | ||
'/banners/[email protected]' | ||
)} | ||
/> | ||
</MjmlColumn> | ||
<MjmlColumn width="15%" cssClass="hide_on_mobile"> | ||
<MjmlText | ||
color={Colors.Grey4A} | ||
fontSize={14} | ||
fontWeight={600} | ||
lineHeight="3.0" | ||
align="right" | ||
> | ||
<FormattedMessage id="download" /> | ||
</MjmlText> | ||
</MjmlColumn> | ||
<MjmlColumn width="10%" cssClass="hide_on_mobile"> | ||
<MjmlText fontSize={14} lineHeight="3.0" align="center"> | ||
<GetAppLink>iOS</GetAppLink> | ||
</MjmlText> | ||
</MjmlColumn> | ||
<MjmlColumn width="10%" cssClass="hide_on_mobile"> | ||
<MjmlText fontSize={14} lineHeight="3.0"> | ||
<GetAppLink>Android</GetAppLink> | ||
</MjmlText> | ||
</MjmlColumn> | ||
</MjmlGroup> | ||
</BasicSection> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,26 @@ | ||
import * as React from 'react'; | ||
import { MjmlColumn, MjmlText, MjmlWrapper } from 'mjml-react'; | ||
import { FormattedMessage, useIntl } from 'react-intl'; | ||
|
||
import { | ||
MjmlColumn, | ||
MjmlGroup, | ||
MjmlText, | ||
MjmlWrapper, | ||
MjmlTable, | ||
MjmlImage, | ||
} from 'mjml-react'; | ||
import { useIntl } from 'react-intl'; | ||
import { createCanvas } from 'canvas'; | ||
import * as Colors from '../../constants/colors'; | ||
|
||
import { getLocalizedMonthlyReportDate } from '../../utils/localization'; | ||
|
||
import { getAssetPath } from '../../utils/url'; | ||
import { User } from '../../types'; | ||
|
||
import { Avatar } from '../avatar'; | ||
import { BasicSection } from './basic'; | ||
|
||
const canvas = createCanvas(200, 100); | ||
const ctx = canvas.getContext('2d'); | ||
ctx.font = '18px monospace'; | ||
|
||
export interface MonthlyReportHeaderSectionProps extends User { | ||
title?: React.ReactNode; | ||
timestamp?: number; | ||
|
@@ -29,17 +39,51 @@ export const MonthlyReportHeaderSection = ( | |
} = props; | ||
const intl = useIntl(); | ||
return ( | ||
<MjmlWrapper> | ||
<BasicSection backgroundColor={Colors.LikeGreen}> | ||
<MjmlWrapper backgroundColor={Colors.LikeGreen}> | ||
<BasicSection backgroundColor={Colors.LikeGreen} paddingBottom={0}> | ||
<MjmlGroup> | ||
<MjmlColumn width="20%"> | ||
<MjmlImage | ||
width={68} | ||
height={65} | ||
align="left" | ||
src={getAssetPath('/icons/[email protected]')} | ||
/> | ||
</MjmlColumn> | ||
<MjmlColumn width="80%"> | ||
<MjmlTable paddingTop="8px" css-class="hoverTable" width="100%"> | ||
<tr | ||
style={{ | ||
borderBottom: 'none', | ||
color: 'white', | ||
fontWeight: 'bolder', | ||
fontSize: 18, | ||
}} | ||
> | ||
<td> | ||
<Avatar | ||
src={avatarSrc} | ||
likerID={likerID} | ||
displayName={displayName} | ||
isCivicLiker={isCivicLiker} | ||
size={48} | ||
align="right" | ||
lineHeight={0.5} | ||
/> | ||
</td> | ||
<td | ||
style={{ textAlign: 'right' }} | ||
width={ctx.measureText(likerID).width} | ||
> | ||
<MjmlText>{likerID}</MjmlText> | ||
</td> | ||
</tr> | ||
</MjmlTable> | ||
</MjmlColumn> | ||
</MjmlGroup> | ||
</BasicSection> | ||
<BasicSection backgroundColor={Colors.LikeGreen} paddingTop={0}> | ||
<MjmlColumn> | ||
<Avatar | ||
src={avatarSrc} | ||
likerID={likerID} | ||
displayName={displayName} | ||
isCivicLiker={isCivicLiker} | ||
size={108} | ||
align="left" | ||
/> | ||
<MjmlText | ||
fontSize={28} | ||
fontWeight={600} | ||
|
@@ -48,18 +92,12 @@ export const MonthlyReportHeaderSection = ( | |
> | ||
{title} | ||
</MjmlText> | ||
|
||
<MjmlText fontSize={18} fontWeight={600} color={Colors.LikeCyan}> | ||
{getLocalizedMonthlyReportDate(intl, timestamp)} | ||
</MjmlText> | ||
</MjmlColumn> | ||
</BasicSection> | ||
<BasicSection backgroundColor="white" paddingBottom={0}> | ||
<MjmlColumn> | ||
<MjmlText color={Colors.LikeGreen} fontSize={16} fontWeight={600}> | ||
<FormattedMessage id="greeting" values={{ name: displayName }} /> | ||
</MjmlText> | ||
</MjmlColumn> | ||
</BasicSection> | ||
</MjmlWrapper> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.