Skip to content

Commit 3d15a8e

Browse files
authored
Merge pull request #694 from Financial-Times/CON-2059-apply-new-origami-focus-styling
Apply new origami focus styling to x-follow-button
2 parents 7629610 + 033978b commit 3d15a8e

File tree

8 files changed

+34
-225
lines changed

8 files changed

+34
-225
lines changed

components/x-follow-button/package.json

+6
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,23 @@
1515
"author": "",
1616
"license": "ISC",
1717
"devDependencies": {
18+
"@financial-times/n-myft-ui": "^30.0.0",
19+
"@financial-times/o-buttons": "^7.7.4",
1820
"@financial-times/o-colors": "^6.4.2",
1921
"@financial-times/o-icons": "^7.2.1",
22+
"@financial-times/o-normalise": "^3.3.0",
2023
"@financial-times/o-typography": "^7.2.2",
2124
"@financial-times/x-rollup": "file:../../packages/x-rollup",
2225
"@financial-times/x-test-utils": "file:../../packages/x-test-utils",
2326
"check-engine": "^1.10.1",
2427
"sass": "^1.49.0"
2528
},
2629
"peerDependencies": {
30+
"@financial-times/n-myft-ui": "^30.0.0",
31+
"@financial-times/o-buttons": "^7.7.4",
2732
"@financial-times/o-colors": "^6.4.2",
2833
"@financial-times/o-icons": "^7.2.1",
34+
"@financial-times/o-normalise": "^3.3.0",
2935
"@financial-times/o-typography": "^7.2.2",
3036
"@financial-times/x-engine": "file:../../packages/x-engine"
3137
},

components/x-follow-button/src/FollowButton.jsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ export const FollowButton = (props) => {
1010
csrfToken,
1111
followPlusDigestEmail,
1212
onSubmit,
13-
variant
13+
variant = 'standard'
1414
} = props
15-
const VARIANTS = ['standard', 'inverse', 'opinion', 'alphaville', 'monochrome']
15+
// 'standard' style is applied by `.x-follow-button` class (default)
16+
const VARIANTS = ['inverse', 'opinion', 'alphaville', 'monochrome']
1617

1718
const getFormAction = () => {
1819
if (followPlusDigestEmail) {
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
@import '../mixins/lozenge/main';
2-
3-
.x-follow-button {
4-
@include myftLozenge($with-toggle-icon: true);
5-
}
1+
@import '@financial-times/n-myft-ui/mixins/lozenge/main.scss';
62

73
@each $theme in map-keys($myft-lozenge-themes) {
8-
.x-follow-button--#{$theme} {
9-
@include myftLozengeTheme($theme, $with-toggle-icon: true);
4+
.x-follow-button#{getThemeModifier($theme)} {
5+
@include myftLozengeToggleButton($theme);
106
}
117
}

components/x-follow-button/src/styles/main.scss

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ $system-code: 'github:Financial-Times/x-dash' !default;
44
@import '@financial-times/o-icons/main';
55
@import '@financial-times/o-colors/main';
66
@import '@financial-times/o-typography/main';
7-
8-
@import './mixins/lozenge/main.scss';
7+
@import '@financial-times/o-buttons/main';
98

109
@import './components/FollowButton.scss';

components/x-follow-button/src/styles/mixins/lozenge/_themes.scss

-54
This file was deleted.

components/x-follow-button/src/styles/mixins/lozenge/_toggle-icon.scss

-43
This file was deleted.

components/x-follow-button/src/styles/mixins/lozenge/main.scss

-109
This file was deleted.

components/x-follow-button/storybook/index.jsx

+21-8
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,32 @@ export default {
1515
export const _FollowButton = (args) => (
1616
<div className="story-container">
1717
<BuildService dependencies={dependencies} />
18-
<FollowButton {...args} />
18+
<div style={{ padding: '8px' }}>
19+
<p> Standard </p>
20+
<FollowButton {...args} variant={'standard'} />
21+
</div>
22+
<div style={{ background: '#990F3D', padding: '8px' }}>
23+
<p style={{ color: 'white' }}> Inverse </p>
24+
<FollowButton {...args} variant={'inverse'} />
25+
</div>
26+
<div style={{ background: '#CCE6FF', padding: '8px' }}>
27+
<p> Opinion </p>
28+
<FollowButton {...args} variant={'opinion'} />
29+
</div>
30+
<div style={{ background: '#355778', padding: '8px' }}>
31+
<p style={{ color: 'white' }}> Alphaville </p>
32+
<FollowButton {...args} variant={'alphaville'} />
33+
</div>
34+
<div style={{ background: 'black', padding: '8px' }}>
35+
<p style={{ color: 'white' }}> Monochrome </p>
36+
<FollowButton {...args} variant={'monochrome'} />
37+
</div>
1938
</div>
2039
)
2140

2241
_FollowButton.args = {
2342
conceptNameAsButtonText: false,
2443
isFollowed: false,
2544
conceptName: 'UK politics & policy',
26-
followPlusDigestEmail: true,
27-
variant: 'standard'
28-
}
29-
_FollowButton.argTypes = {
30-
variant: {
31-
control: { type: 'select', options: ['standard', 'inverse', 'opinion', 'alphaville', 'monochrome'] }
32-
}
45+
followPlusDigestEmail: true
3346
}

0 commit comments

Comments
 (0)