-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEVPROD-7662: Add image visibility guide cue (#376)
- Loading branch information
Showing
13 changed files
with
134 additions
and
57 deletions.
There are no files selected for viewing
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
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
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
41 changes: 41 additions & 0 deletions
41
apps/spruce/src/pages/task/metadata/ImageVisibilityGuideCue.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,41 @@ | ||
import { useState } from "react"; | ||
import { | ||
GuideCue, | ||
GuideCueProps, | ||
TooltipAlign, | ||
} from "@leafygreen-ui/guide-cue"; | ||
import Cookies from "js-cookie"; | ||
import { SEEN_IMAGE_VISIBILITY_GUIDE_CUE } from "constants/cookies"; | ||
import { showImageVisibilityPage } from "constants/featureFlags"; | ||
|
||
export const ImageVisibilityGuideCue: React.FC<{ | ||
refEl: GuideCueProps["refEl"]; | ||
}> = ({ refEl }) => { | ||
const [open, setOpen] = useState( | ||
Cookies.get(SEEN_IMAGE_VISIBILITY_GUIDE_CUE) !== "true", | ||
); | ||
|
||
const closeGuideCue = () => { | ||
Cookies.set(SEEN_IMAGE_VISIBILITY_GUIDE_CUE, "true", { expires: 365 }); | ||
setOpen(false); | ||
}; | ||
|
||
return ( | ||
<GuideCue | ||
currentStep={1} | ||
data-cy="image-visibility-guide-cue" | ||
// TODO: Remove once the page is ready for release in DEVPROD-11433. | ||
enabled={showImageVisibilityPage} | ||
numberOfSteps={1} | ||
onPrimaryButtonClick={closeGuideCue} | ||
open={open} | ||
refEl={refEl} | ||
setOpen={setOpen} | ||
title="Newly Introduced Image Page!" | ||
tooltipAlign={TooltipAlign.Right} | ||
> | ||
Visit the Image page to view general information and package installations | ||
for Evergreen distros. | ||
</GuideCue> | ||
); | ||
}; |
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
Oops, something went wrong.