-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3625 from dzucconi/feat/FX-2184--captions--2
[FX-2184] Updates captions
- Loading branch information
Showing
20 changed files
with
4,405 additions
and
3,457 deletions.
There are no files selected for viewing
1,933 changes: 1,201 additions & 732 deletions
1,933
...hing/EditorialFeature/Components/Vanguard2019/__tests__/__snapshots__/index.test.tsx.snap
Large diffs are not rendered by default.
Oops, something went wrong.
1,540 changes: 848 additions & 692 deletions
1,540
...onents/Publishing/EditorialFeature/__tests__/__snapshots__/EditorialFeature.test.tsx.snap
Large diffs are not rendered by default.
Oops, something went wrong.
746 changes: 391 additions & 355 deletions
746
src/Components/Publishing/Layouts/__tests__/__snapshots__/NewsLayout.test.tsx.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/Components/Publishing/Sections/FullscreenViewer/ArtworkCaption.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from "react" | ||
import { Box, BoxProps, Button } from "@artsy/palette" | ||
import { ArtworkCaption as BaseArtworkCaption } from "../ArtworkCaption" | ||
|
||
interface ArtworkCaptionProps extends BoxProps { | ||
section: unknown & { type: "artwork"; slug: string } | ||
} | ||
|
||
export const ArtworkCaption: React.FC<ArtworkCaptionProps> = ({ | ||
section, | ||
...rest | ||
}) => { | ||
return ( | ||
<Box {...rest}> | ||
<BaseArtworkCaption | ||
flex="1" | ||
artwork={section} | ||
isFullscreenCaption | ||
linked | ||
color="black100" | ||
/> | ||
|
||
<Button | ||
variant="secondaryGray" | ||
// TODO: event should be the correct type in palette | ||
onClick={(event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => { | ||
// TODO: This isn't a real link and that's annoying | ||
// <Button> doesn't support `as`, once it does, replace | ||
// click handler this with: as={RouterLink} to={`/artwork/${section.slug}`} | ||
const path = `/artwork/${section.slug}` | ||
|
||
if (event.metaKey) { | ||
window.open(path, "_blank") | ||
return | ||
} | ||
|
||
window.location.href = path | ||
}} | ||
> | ||
View | ||
</Button> | ||
</Box> | ||
) | ||
} |
Oops, something went wrong.