-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split the Global Styles variations in two: default and premium #77333
Changes from 10 commits
cdd8953
7409c75
5e58c1a
5df1333
a914273
e117604
60aa98a
dd3d3d9
a85b1cd
fe6188c
13b5d1a
03fc221
9ddf300
8cc25f0
44cd7b7
b269025
11c0a43
c342f5a
e7ee758
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import { PremiumBadge } from '@automattic/design-picker'; | ||
import { GlobalStylesVariations } from '@automattic/global-styles'; | ||
import { translate } from 'i18n-calypso'; | ||
import { TranslateResult } from 'i18n-calypso'; | ||
import type { StyleVariation } from '@automattic/design-picker/src/types'; | ||
import type { GlobalStylesObject } from '@automattic/global-styles/src/types'; | ||
import './style.scss'; | ||
|
@@ -9,35 +8,22 @@ interface StyleVariationPreviewsProps { | |
variations: StyleVariation[]; | ||
selectedVariation?: StyleVariation; | ||
onClick: ( variation: StyleVariation ) => void; | ||
showGlobalStylesPremiumBadge: boolean; | ||
description?: TranslateResult; | ||
showOnlyHoverViewDefaultVariation?: boolean; | ||
} | ||
|
||
const StyleVariationPreviews: React.FC< StyleVariationPreviewsProps > = ( { | ||
variations = [], | ||
selectedVariation, | ||
onClick, | ||
showGlobalStylesPremiumBadge, | ||
description, | ||
showOnlyHoverViewDefaultVariation, | ||
} ) => { | ||
return ( | ||
<GlobalStylesVariations | ||
globalStylesVariations={ variations as GlobalStylesObject[] } | ||
selectedGlobalStylesVariation={ selectedVariation as GlobalStylesObject } | ||
premiumBadge={ | ||
showGlobalStylesPremiumBadge && ( | ||
<PremiumBadge | ||
className="design-picker__premium-badge" | ||
labelText={ translate( 'Upgrade' ) } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This class is no longer used, so I think we can remove a few styles from the SCSS file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh that's right. I planned to remove it but I guess I forgot about it. |
||
tooltipClassName="design-picker__premium-badge-tooltip" | ||
tooltipPosition="top" | ||
tooltipContent={ translate( | ||
'Unlock this style, and tons of other features, by upgrading to a Premium plan.' | ||
) } | ||
focusOnShow={ false } | ||
/> | ||
) | ||
} | ||
description={ description } | ||
showOnlyHoverViewDefaultVariation={ showOnlyHoverViewDefaultVariation } | ||
onSelect={ ( globalStyleVariation: GlobalStylesObject ) => | ||
onClick( globalStyleVariation as StyleVariation ) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this component is no longer used, can we remove it?