-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #723 from Financial-Times/ENTST-538-update-footer-…
…copy-for-free-articles ENTST-538: update copy for free article
- Loading branch information
Showing
13 changed files
with
294 additions
and
39 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
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,31 @@ | ||
import { h } from '@financial-times/x-engine' | ||
import { ShareType } from '../lib/constants' | ||
|
||
export const CreateLinkButton = ({ shareType, actions, enterpriseEnabled }) => { | ||
const createLinkHandler = async () => { | ||
switch (shareType) { | ||
case ShareType.gift: | ||
await actions.createGiftUrl() | ||
break | ||
case ShareType.nonGift: | ||
await actions.shortenNonGiftUrl() | ||
break | ||
case ShareType.enterprise: | ||
await actions.createEnterpriseUrl() | ||
break | ||
default: | ||
} | ||
actions.initOShare('#social-share-buttons') | ||
} | ||
return ( | ||
<button | ||
id="create-link-button" | ||
className={`o-buttons o-buttons--big o-buttons--primary share-article-dialog__create-link-button ${ | ||
enterpriseEnabled ? 'o-buttons--professional' : '' | ||
}`} | ||
onClick={createLinkHandler} | ||
> | ||
Create link | ||
</button> | ||
) | ||
} |
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,21 @@ | ||
import { h } from '@financial-times/x-engine' | ||
|
||
export const FreeArticleAlert = () => { | ||
return ( | ||
<div | ||
id="free-article-alert" | ||
className="o-message o-message--alert o-message--received-highlights share-article-dialog__alert" | ||
data-o-component="o-message" | ||
> | ||
<div className="o-message__container"> | ||
<div className="o-message__content"> | ||
<p className="o-message__content-main"> | ||
<strong>This is one of our free articles</strong> | ||
<br /> | ||
Even non-subscribers can read it, without using up your sharing credits. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
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
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
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
43 changes: 43 additions & 0 deletions
43
components/x-gift-article/storybook/share-article-modal-b2b-free-article.js
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,43 @@ | ||
const articleId = 'e4b5ade3-01d1-4db8-b197-257051656684' | ||
const articleUrl = 'https://www.ft.com/content/e4b5ade3-01d1-4db8-b197-257051656684' | ||
const articleUrlRedeemed = 'https://enterprise-sharing.ft.com/gift-url-redeemed' | ||
const nonGiftArticleUrl = `${articleUrl}?shareType=nongift` | ||
|
||
exports.args = { | ||
title: 'Share this article:', | ||
isFreeArticle: true, | ||
article: { | ||
id: articleId, | ||
url: articleUrl, | ||
title: 'Equinor and Daimler Truck cut Russia ties as Volvo and JLR halt car deliveries' | ||
}, | ||
id: 'base-gift-article-static-id', | ||
enterpriseApiBaseUrl: `https://enterprise-sharing-api.ft.com` | ||
} | ||
|
||
exports.fetchMock = (fetchMock) => { | ||
fetchMock | ||
.restore() | ||
.get('path:/article/gift-credits', { | ||
allowance: 20, | ||
consumedCredits: 5, | ||
remainingCredits: 15, | ||
renewalDate: '2018-08-01T00:00:00Z' | ||
}) | ||
.get(`path:/article/shorten-url/${encodeURIComponent(articleUrlRedeemed)}`, { | ||
shortenedUrl: 'https://shortened-gift-url' | ||
}) | ||
.get(`path:/article/shorten-url/${encodeURIComponent(nonGiftArticleUrl)}`, { | ||
shortenedUrl: 'https://shortened-non-gift-url' | ||
}) | ||
.get(`path:/article/gift-link/${encodeURIComponent(articleId)}`, { | ||
redemptionUrl: articleUrlRedeemed, | ||
redemptionLimit: 3, | ||
remainingAllowance: 1 | ||
}) | ||
.get('path:/v1/users/me/allowance', 403) | ||
.post('path:/v1/shares', { | ||
url: articleUrlRedeemed, | ||
redeemLimit: 120 | ||
}) | ||
} |
43 changes: 43 additions & 0 deletions
43
components/x-gift-article/storybook/share-article-modal-b2c-free-article.jsx
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,43 @@ | ||
const articleId = 'e4b5ade3-01d1-4db8-b197-257051656684' | ||
const articleUrl = 'https://www.ft.com/content/e4b5ade3-01d1-4db8-b197-257051656684' | ||
const articleUrlRedeemed = 'https://enterprise-sharing.ft.com/gift-url-redeemed' | ||
const nonGiftArticleUrl = `${articleUrl}?shareType=nongift` | ||
|
||
exports.args = { | ||
title: 'Share this article:', | ||
isFreeArticle: true, | ||
article: { | ||
id: articleId, | ||
url: articleUrl, | ||
title: 'Equinor and Daimler Truck cut Russia ties as Volvo and JLR halt car deliveries' | ||
}, | ||
id: 'base-gift-article-static-id', | ||
enterpriseApiBaseUrl: `https://enterprise-sharing-api.ft.com` | ||
} | ||
|
||
exports.fetchMock = (fetchMock) => { | ||
fetchMock | ||
.restore() | ||
.get('path:/article/gift-credits', { | ||
allowance: 20, | ||
consumedCredits: 5, | ||
remainingCredits: 15, | ||
renewalDate: '2018-08-01T00:00:00Z' | ||
}) | ||
.get(`path:/article/shorten-url/${encodeURIComponent(articleUrlRedeemed)}`, { | ||
shortenedUrl: 'https://shortened-gift-url' | ||
}) | ||
.get(`path:/article/shorten-url/${encodeURIComponent(nonGiftArticleUrl)}`, { | ||
shortenedUrl: 'https://shortened-non-gift-url' | ||
}) | ||
.get(`path:/article/gift-link/${encodeURIComponent(articleId)}`, { | ||
redemptionUrl: articleUrlRedeemed, | ||
redemptionLimit: 3, | ||
remainingAllowance: 1 | ||
}) | ||
.get('path:/v1/users/me/allowance', 404) | ||
.post('path:/v1/shares', { | ||
url: articleUrlRedeemed, | ||
redeemLimit: 120 | ||
}) | ||
} |
Oops, something went wrong.