-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(feature tour): FF for hero #1508
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0321f26
fix(homepagepreview): add default if no variant
7c50684
build(inView): allows us to know if elem is in view
kishore03109 48fe1e3
chore(heroBannerToolTipImage): add in required image
kishore03109 fb9bbcd
feat(hero feature tour): add in storybook for feature tour
kishore03109 e76a3e6
feat(hero): add in functionality within hero body
kishore03109 cf2c083
fix(feature tour homepage): no need beacon
kishore03109 48ad00f
fix(homepage preview): unintended rebase commit
kishore03109 f10a5fb
fix(feature tour): fix rebase issues
kishore03109 5dbd5f3
fix(hero-body): fix bugs from rebase
kishore03109 1072914
fix(feature tour): styling fixes)
kishore03109 7e2ea79
fix(feature tour): fix feature tour render when component is loading
kishore03109 4ae5d16
fix(feature tour): fix tip badge being shown
kishore03109 f4c50a2
fix(edithomepage): fix padding issue
kishore03109 9808a5c
fix(featureTour): attempt ui bug w useEffect
kishore03109 5626692
fix(hero body): add deps
kishore03109 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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,29 @@ | ||
import { Icon, Text } from "@chakra-ui/react" | ||
import { Badge } from "@opengovsg/design-system-react" | ||
import { BiCheck } from "react-icons/bi" | ||
|
||
export const HeroOptionsFeatureTourContent = (): JSX.Element => { | ||
return ( | ||
<> | ||
<Badge | ||
mt="2rem" | ||
variant="subtle" | ||
display="inline-flex" | ||
columnGap="0.5rem" | ||
alignItems="center" | ||
colorScheme="brand.secondary" | ||
> | ||
<Icon as={BiCheck} h="1rem" w="1rem" /> | ||
<Text textStyle="caption-1">New feature</Text> | ||
</Badge> | ||
<Text textStyle="subhead-1" mt="1rem" color="base.content.default"> | ||
{" "} | ||
Now you can customise your hero banner with various layouts!{" "} | ||
</Text> | ||
<Text textStyle="body-2" mt="0.5rem" color="base.content.default"> | ||
{`We've added some variations to how you can display your hero section. | ||
Try them out here.`} | ||
</Text> | ||
</> | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ import { BiBulb, BiRightArrowAlt } from "react-icons/bi" | |
import { ProgressIndicator } from "components/ProgressIndicator/ProgressIndicator" | ||
|
||
import { useFeatureTourContext } from "./FeatureTourContext" | ||
import { DASHBOARD_FEATURE_STEPS } from "./FeatureTourSequence" | ||
|
||
export interface FeatureTourStep { | ||
content: React.ReactNode | ||
|
@@ -32,50 +31,78 @@ export const FeatureTourTooltip = ({ | |
index, | ||
}: FeatureTourTooltipProps): JSX.Element => { | ||
const { paginationCallback } = useFeatureTourContext() | ||
const showProgressIndicator = size > 1 | ||
|
||
let isTipBadgeShown = true | ||
let titleComponent: React.ReactNode | ||
if (typeof step.title === "string") { | ||
titleComponent = ( | ||
<Text textStyle="subhead-1" color="base.content.dark" marginTop="1.25rem"> | ||
{step.title} | ||
</Text> | ||
) | ||
} else { | ||
titleComponent = step.title | ||
isTipBadgeShown = false | ||
} | ||
|
||
let contentComponent: React.ReactNode | ||
if (typeof step.content === "string") { | ||
contentComponent = ( | ||
<Text textStyle="body-2" color="base.content.default" marginTop="0.5rem"> | ||
{step.content} | ||
</Text> | ||
) | ||
} else { | ||
contentComponent = step.content | ||
} | ||
|
||
return ( | ||
<Box | ||
padding="1.5rem" | ||
alignItems="center" | ||
maxW="100%" | ||
w="18rem" | ||
w="20rem" | ||
color="secondary.500" | ||
bg="background.action.defaultInverse" | ||
borderRadius="4px" | ||
{...tooltipProps} | ||
position="relative" | ||
> | ||
<Badge | ||
colorScheme="success" | ||
variant="solid" | ||
display="flex" | ||
width="fit-content" | ||
backgroundColor="background.action.success" | ||
> | ||
<Icon as={BiBulb} mr="0.25rem" fontSize="1rem" color="text.inverse" /> | ||
<Text textStyle="caption-1" color="text.inverse"> | ||
Tip | ||
</Text> | ||
</Badge> | ||
<Text textStyle="subhead-1" color="base.content.dark" marginTop="1.25rem"> | ||
{step.title} | ||
</Text> | ||
<Text textStyle="body-2" color="base.content.default" marginTop="0.5rem"> | ||
{step.content} | ||
</Text> | ||
{isTipBadgeShown && ( | ||
<Badge | ||
colorScheme="success" | ||
variant="solid" | ||
display="flex" | ||
width="fit-content" | ||
backgroundColor="background.action.success" | ||
> | ||
<Icon as={BiBulb} mr="0.25rem" fontSize="1rem" color="text.inverse" /> | ||
<Text textStyle="caption-1" color="text.inverse"> | ||
Tip | ||
</Text> | ||
</Badge> | ||
)} | ||
|
||
{titleComponent} | ||
{contentComponent} | ||
|
||
<Flex | ||
flexDirection="row" | ||
marginTop="2.5rem" | ||
marginTop="2rem" | ||
alignItems="center" | ||
justifyContent="space-between" | ||
> | ||
<ProgressIndicator | ||
numIndicators={size} | ||
currActiveIdx={index} | ||
onClick={paginationCallback} | ||
/> | ||
{showProgressIndicator && ( | ||
<ProgressIndicator | ||
numIndicators={size} | ||
currActiveIdx={index} | ||
onClick={paginationCallback} | ||
/> | ||
)} | ||
{isLastStep ? ( | ||
<Button {...primaryProps} title="Done"> | ||
Done | ||
Got it | ||
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. Confirmed wit Design to standardise this already |
||
</Button> | ||
) : ( | ||
<Button | ||
|
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Confirmed wit Design to standardise this already