Skip to content

Commit

Permalink
Merge pull request #672 from Financial-Times/CI-1342-alphaville-myft-…
Browse files Browse the repository at this point in the history
…button-doesnt-adopt-the-new-alphaville-brand-colour-when-toggled

add alphaville theme for x-follow-button
  • Loading branch information
juanSanchezAlcala authored Sep 28, 2022
2 parents 3c73cae + 6eb4926 commit dc14016
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/x-follow-button/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature | Type | Required | Default value | Description
`conceptNameAsButtonText` | Boolean | no | `false` | If true will use the concept name as the button text, otherwise will default to "Add to MyFT" or "Remove from MyFT" (depending on isFollowed prop).
`isFollowed` | Boolean | no | `false` | Whether the concept is followed or not.
`csrfToken` | String | no | none | CSRF token (will be included in a hidden form field).
`variant` | String | no | `standard` | One of `standard`, `inverse`, `opinion` or `monochrome`. Other values will be ignored.
`variant` | String | no | `standard` | One of `standard`, `inverse`, `opinion` , `alphaville` or `monochrome`. Other values will be ignored.
`followPlusDigestEmail` | Boolean | no | `false` | Whether following the topic should also subscribe to the digest.

## Client side behaviour
Expand Down
2 changes: 1 addition & 1 deletion components/x-follow-button/src/FollowButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const FollowButton = (props) => {
onSubmit,
variant
} = props
const VARIANTS = ['standard', 'inverse', 'opinion', 'monochrome']
const VARIANTS = ['standard', 'inverse', 'opinion', 'alphaville', 'monochrome']

const getFormAction = () => {
if (followPlusDigestEmail) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ $myft-lozenge-themes: (
pressed-highlight: rgba(oColorsByName('white'), 0.2),
disabled: rgba(oColorsByName('white'), 0.5),
focus-outline: oColorsByName('white')
)
),
alphaville: (
background: oColorsByName('white'),
text: oColorsByName('matisse'),
highlight: rgba(white, 0.8),
pressed-highlight: rgba(white, 0.2),
disabled: rgba(oColorsByName('white'), 0.5),
focus-outline: oColorsByName('white')
),
);

@function getThemeColor($key) {
Expand Down
4 changes: 3 additions & 1 deletion components/x-follow-button/storybook/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ _FollowButton.args = {
variant: 'standard'
}
_FollowButton.argTypes = {
variant: { control: { type: 'select', options: ['standard', 'inverse', 'opinion', 'monochrome'] } }
variant: {
control: { type: 'select', options: ['standard', 'inverse', 'opinion', 'alphaville', 'monochrome'] }
}
}

0 comments on commit dc14016

Please sign in to comment.