-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[No QA] [Manager McTest] Update our exisitingEducationalTooltip component to display the new buttons (Try it out/No thanks) #56239
Changes from all commits
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,7 @@ | ||
import React, {createContext, useCallback, useContext, useEffect, useMemo, useState} from 'react'; | ||
import {View} from 'react-native'; | ||
import {useOnyx} from 'react-native-onyx'; | ||
import Button from '@components/Button'; | ||
import Icon from '@components/Icon'; | ||
import * as Expensicons from '@components/Icon/Expensicons'; | ||
import Text from '@components/Text'; | ||
|
@@ -176,35 +177,54 @@ const useProductTrainingContext = (tooltipName: ProductTrainingTooltipName, shou | |
const renderProductTrainingTooltip = useCallback(() => { | ||
const tooltip = TOOLTIPS[tooltipName]; | ||
return ( | ||
<View style={[styles.alignItemsCenter, styles.flexRow, styles.justifyContentCenter, styles.flexWrap, styles.textAlignCenter, styles.gap3, styles.p2]}> | ||
<Icon | ||
src={Expensicons.Lightbulb} | ||
fill={theme.tooltipHighlightText} | ||
medium | ||
/> | ||
<Text style={[styles.productTrainingTooltipText, styles.textWrap, styles.mw100]}> | ||
{tooltip.content.map(({text, isBold}) => { | ||
const translatedText = translate(text); | ||
return ( | ||
<Text | ||
key={text} | ||
style={[styles.productTrainingTooltipText, isBold && styles.textBold]} | ||
> | ||
{translatedText} | ||
</Text> | ||
); | ||
})} | ||
</Text> | ||
<View> | ||
<View style={[styles.alignItemsCenter, styles.flexRow, styles.justifyContentCenter, styles.flexWrap, styles.textAlignCenter, styles.gap3, styles.p2]}> | ||
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. Let's get a design review before we merge this- I'm thinking we can just use screenshots since we can't adhoc build this rn? 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. I take it back, let's wait on the adhoc when we go live instead so we don't need duplicate reviews |
||
<Icon | ||
src={Expensicons.Lightbulb} | ||
fill={theme.tooltipHighlightText} | ||
medium | ||
/> | ||
<Text style={[styles.productTrainingTooltipText, styles.textWrap, styles.mw100]}> | ||
{tooltip.content.map(({text, isBold}) => { | ||
const translatedText = translate(text); | ||
return ( | ||
<Text | ||
key={text} | ||
style={[styles.productTrainingTooltipText, isBold && styles.textBold]} | ||
> | ||
{translatedText} | ||
</Text> | ||
); | ||
})} | ||
</Text> | ||
</View> | ||
{!!tooltip?.shouldRenderActionButtons && ( | ||
<View style={[styles.alignItemsCenter, styles.justifyContentBetween, styles.flexRow, styles.ph1, styles.pb1]}> | ||
<Button | ||
success | ||
text={translate('productTrainingTooltip.scanTestTooltip.tryItOut')} | ||
style={[styles.flex1, styles.ph1]} | ||
/> | ||
<Button | ||
text={translate('productTrainingTooltip.scanTestTooltip.noThanks')} | ||
style={[styles.flex1, styles.ph1]} | ||
/> | ||
</View> | ||
)} | ||
</View> | ||
); | ||
}, [ | ||
styles.alignItemsCenter, | ||
styles.flex1, | ||
styles.flexRow, | ||
styles.flexWrap, | ||
styles.gap3, | ||
styles.justifyContentBetween, | ||
styles.justifyContentCenter, | ||
styles.mw100, | ||
styles.p2, | ||
styles.pb1, | ||
styles.ph1, | ||
styles.productTrainingTooltipText, | ||
styles.textAlignCenter, | ||
styles.textBold, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6342,6 +6342,8 @@ const translations = { | |
part6: 'Ahora,', | ||
part7: ' envía tu gasto y', | ||
part8: ' ¡observa cómo ocurre la magia!', | ||
tryItOut: 'Prueba esto', | ||
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. @JKobrynski Did we confirm this translation? 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. I asked for a confirmation here but got no replies, I used JaimeGPT to translate it |
||
noThanks: 'No, gracias', | ||
}, | ||
}, | ||
discardChangesConfirmation: { | ||
|
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.
@JKobrynski I think we need to add shouldRenderActionButtons to WORKSAPCE_CHAT_CREATE tooltip instead of this place
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 can change that if you want, but the purpose of this PR is just to allow us to display the action buttons, the actual logic for the new tooltip flow will be introduced later! Wdyt? Should we make that change?
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.
@JKobrynski But currently it doesn't match your test step
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.
If I change this, all users that sign up to a new account will see these buttons that will do nothing because the functionality is not implemented yet. In the ** Prerequisites** section I instructed reviewers to enable this for
WORKSAPCE_CHAT_CREATE
so they can see it on their own machine and verify if it looks right. We don't want to permanently change it, it's just for testing purposes.