@@ -41,13 +41,10 @@ type Context = 'ArticleMeta' | 'LiveBlock' | 'SubMeta' | 'ImageCaption';
4141
4242const sharedButtonStyles = (
4343 sizeXSmall : boolean ,
44- context : Context ,
45- format : ArticleFormat ,
44+ isNonLabsGalleryMeta : boolean ,
4645) => css `
4746 transition : none;
48- border-color : ${ format . design === ArticleDesign . Gallery &&
49- format . theme !== ArticleSpecial . Labs &&
50- context == 'ArticleMeta'
47+ border-color : ${ isNonLabsGalleryMeta
5148 ? themePalette ( '--share-button-border-meta' )
5249 : sizeXSmall
5350 ? themePalette ( '--share-button-xsmall-border' )
@@ -135,17 +132,16 @@ export const CopyNativeShareButton = ({
135132 size,
136133 isLiveBlogMeta,
137134 isCopied,
138- context,
139- format,
135+ isNonLabsGalleryMeta,
140136} : {
141137 onShare : ( ) => void ;
142138 size ?: Size ;
143139 isLiveBlogMeta : boolean ;
144140 isCopied : boolean ;
145- context : Context ;
146- format : ArticleFormat ;
141+ isNonLabsGalleryMeta : boolean ;
147142} ) => {
148143 const sizeXSmall = size === 'xsmall' ;
144+
149145 return (
150146 < Button
151147 onClick = { onShare }
@@ -158,7 +154,7 @@ export const CopyNativeShareButton = ({
158154 ...( isCopied
159155 ? [ copiedButtonStyles ( sizeXSmall ) ]
160156 : [ buttonStyles ( sizeXSmall ) ] ) ,
161- sharedButtonStyles ( sizeXSmall , context , format ) ,
157+ sharedButtonStyles ( sizeXSmall , isNonLabsGalleryMeta ) ,
162158 isLiveBlogMeta && liveBlogMobileMeta ( isCopied ) ,
163159 ] ) }
164160 data-gu-name = "share-button"
@@ -172,16 +168,15 @@ export const EmailLink = ({
172168 href,
173169 size,
174170 isLiveBlogMeta,
175- format,
176- context,
171+ isNonLabsGalleryMeta,
177172} : {
178173 href : string ;
179174 size ?: Size ;
180175 isLiveBlogMeta : boolean ;
181- format : ArticleFormat ;
182- context : Context ;
176+ isNonLabsGalleryMeta : boolean ;
183177} ) => {
184178 const sizeXSmall = size === 'xsmall' ;
179+
185180 return (
186181 < LinkButton
187182 href = { href }
@@ -192,7 +187,7 @@ export const EmailLink = ({
192187 icon = { < SvgShareWeb /> }
193188 cssOverrides = { css ( [
194189 buttonStyles ( sizeXSmall ) ,
195- sharedButtonStyles ( sizeXSmall , context , format ) ,
190+ sharedButtonStyles ( sizeXSmall , isNonLabsGalleryMeta ) ,
196191 isLiveBlogMeta && liveBlogMobileMeta ( false ) ,
197192 ] ) }
198193 >
@@ -231,6 +226,11 @@ export const ShareButton = ({
231226 const isLiveBlogMeta =
232227 format . design === ArticleDesign . LiveBlog && context === 'ArticleMeta' ;
233228
229+ const isNonLabsGalleryMeta =
230+ format . design === ArticleDesign . Gallery &&
231+ format . theme !== ArticleSpecial . Labs &&
232+ context === 'ArticleMeta' ;
233+
234234 const isDesktop = useMatchMedia ( `(min-width: ${ breakpoints . desktop } px)` ) ;
235235
236236 const isLiveBlogBlockDesktop = isDesktop && context === 'LiveBlock' ;
@@ -281,8 +281,7 @@ export const ShareButton = ({
281281 size = { size }
282282 isLiveBlogMeta = { isLiveBlogMeta }
283283 isCopied = { isCopied }
284- context = { context }
285- format = { format }
284+ isNonLabsGalleryMeta = { isNonLabsGalleryMeta }
286285 />
287286 ) ;
288287 case 'copy' :
@@ -299,8 +298,7 @@ export const ShareButton = ({
299298 size = { size }
300299 isLiveBlogMeta = { isLiveBlogMeta }
301300 isCopied = { isCopied }
302- context = { context }
303- format = { format }
301+ isNonLabsGalleryMeta = { isNonLabsGalleryMeta }
304302 />
305303 ) ;
306304 case 'email' :
@@ -309,8 +307,7 @@ export const ShareButton = ({
309307 href = { `mailto:?subject=${ webTitle } &body=${ shareData . url } ` }
310308 size = { size }
311309 isLiveBlogMeta = { isLiveBlogMeta }
312- context = { context }
313- format = { format }
310+ isNonLabsGalleryMeta = { isNonLabsGalleryMeta }
314311 />
315312 ) ;
316313 }
0 commit comments