@financial-times/cp-content-pipeline-ui 6.8.1 → 6.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/README.md +30 -8
- package/jest-global-setup.js +1 -0
- package/jest.config.js +17 -16
- package/lib/components/Body/index.d.ts +3 -14
- package/lib/components/Body/index.js +22 -15
- package/lib/components/Body/index.js.map +1 -1
- package/lib/components/Body/index.test.d.ts +1 -0
- package/lib/components/Body/index.test.js +121 -0
- package/lib/components/Body/index.test.js.map +1 -0
- package/lib/components/ContentPackageBody/index.d.ts +5 -1
- package/lib/components/ContentPackageBody/index.js.map +1 -1
- package/lib/components/Layout/index.d.ts +1 -1
- package/lib/components/LiveBlogWrapper/index.js +3 -2
- package/lib/components/LiveBlogWrapper/index.js.map +1 -1
- package/lib/components/Topper/index.js +2 -3
- package/lib/components/Topper/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Body/__snapshots__/index.test.tsx.snap +352 -0
- package/src/components/Body/index.test.tsx +159 -0
- package/src/components/Body/index.tsx +46 -46
- package/src/components/ContentPackageBody/index.tsx +5 -1
- package/src/components/Flourish/client/main.scss +12 -22
- package/src/components/Layout/index.tsx +1 -1
- package/src/components/LiveBlogWrapper/index.tsx +6 -5
- package/src/components/Topper/client/main.scss +14 -1
- package/src/components/Topper/index.tsx +8 -6
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -40,12 +40,13 @@ type LiveBlogWrapperTypes = {
|
|
|
40
40
|
serialiser: any //TODO: keeps TS happy, but maybe not required?
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
type
|
|
43
|
+
type LiveBlogWrapperState = { postCount?: number; tracker?: any }
|
|
44
44
|
|
|
45
|
-
class BaseLiveBlogWrapper extends Component<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
class BaseLiveBlogWrapper extends Component<
|
|
46
|
+
LiveBlogWrapperTypes,
|
|
47
|
+
LiveBlogWrapperState
|
|
48
|
+
> {
|
|
49
|
+
state: LiveBlogWrapperState = {}
|
|
49
50
|
|
|
50
51
|
componentDidUpdate() {
|
|
51
52
|
if (this.props.posts && this.props.posts.length && !this.state.tracker) {
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
/* Topper styles are in o-topper codebase */
|
|
2
2
|
/* Flourish topper is not a distributable Origami topper, but only used via cp-pipeline-ui */
|
|
3
3
|
.o-topper--flourish {
|
|
4
|
-
padding
|
|
4
|
+
// Do not use the grid to set top padding. Works only on Desktop
|
|
5
|
+
grid-template-rows: none;
|
|
6
|
+
.o-topper__content {
|
|
7
|
+
// Set top padding for all resolutions
|
|
8
|
+
padding-top: 20px;
|
|
9
|
+
}
|
|
10
|
+
.n-content-layout {
|
|
11
|
+
// set margin to match designs
|
|
12
|
+
margin-top: 24px;
|
|
13
|
+
margin-bottom: 24px;
|
|
14
|
+
}
|
|
15
|
+
.n-content-layout__container {
|
|
16
|
+
padding: initial;
|
|
17
|
+
}
|
|
5
18
|
}
|
|
@@ -9,7 +9,7 @@ import Columnist from './Columnist'
|
|
|
9
9
|
import LiveBlogIndicator from './LiveBlogIndicator'
|
|
10
10
|
import { FollowButtonSlot } from './FollowButtonSlot'
|
|
11
11
|
import Flourish from '../Flourish'
|
|
12
|
-
import { Layout
|
|
12
|
+
import { Layout } from '../Layout'
|
|
13
13
|
import classnames from 'classnames'
|
|
14
14
|
import type { ArticleQuery } from '@financial-times/cp-content-pipeline-client'
|
|
15
15
|
import PartnerContentHeader from '../PartnerContentHeader'
|
|
@@ -144,17 +144,19 @@ export default function Topper({
|
|
|
144
144
|
}
|
|
145
145
|
/>
|
|
146
146
|
{isLiveBlog && isFlourish ? (
|
|
147
|
-
<Layout
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
<Layout
|
|
148
|
+
layoutWidth={
|
|
149
|
+
topper.layoutWidth === 'full-grid' ? 'full-grid' : 'in-line'
|
|
150
|
+
}
|
|
151
|
+
>
|
|
152
|
+
<Flourish
|
|
150
153
|
id={topper.leadFlourish.id || ''}
|
|
151
154
|
flourishType={topper.leadFlourish.type || ''}
|
|
152
155
|
description={topper.leadFlourish.description || ''}
|
|
153
156
|
fallbackImage={topper.leadFlourish.fallbackImage || ''}
|
|
154
157
|
iFrame={true}
|
|
155
158
|
inArticleBody={false}
|
|
156
|
-
|
|
157
|
-
</LayoutContainer>
|
|
159
|
+
/>
|
|
158
160
|
</Layout>
|
|
159
161
|
) : (
|
|
160
162
|
''
|