-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Improve UX of modifying single line text inputs #40757
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
Changes from 10 commits
f4d7bd2
25af916
ef96598
d141a51
12e7820
d9b34bf
82e1c2d
84fa2ce
3b098fe
5ceb448
30c3847
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import {forwardRef} from 'react'; | ||
import Icon from '@components/Icon'; | ||
import {PressableWithoutFeedback} from '@components/Pressable'; | ||
import Tooltip from '@components/Tooltip'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useTheme from '@hooks/useTheme'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import CONST from '@src/CONST'; | ||
|
||
type TextInputClearButtonProps = { | ||
onPressButton: () => void; | ||
}; | ||
|
||
function TextInputClearButton({onPressButton}: TextInputClearButtonProps) { | ||
const theme = useTheme(); | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
return ( | ||
<Tooltip text={translate('common.clear')}> | ||
<PressableWithoutFeedback | ||
style={[styles.mt4, styles.ml1]} | ||
accessibilityRole={CONST.ROLE.BUTTON} | ||
accessibilityLabel={translate('common.clear')} | ||
onMouseDown={(e) => { | ||
e.preventDefault(); | ||
}} | ||
onPress={onPressButton} | ||
> | ||
<Icon | ||
src={Expensicons.Clear} | ||
width={20} | ||
height={20} | ||
fill={theme.icon} | ||
/> | ||
</PressableWithoutFeedback> | ||
</Tooltip> | ||
); | ||
} | ||
|
||
TextInputClearButton.displayName = 'TextInputClearButton'; | ||
|
||
export default forwardRef(TextInputClearButton); | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -315,6 +315,7 @@ export default { | |
subtitleText3: '.', | ||
}, | ||
businessName: 'Nombre de la empresa', | ||
clear: 'Clara', | ||
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. Did we get this copy approved ? 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. @marcaaron not yet, how can i get it correctly. 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. Ask for the copy in Slack in #expensify-open-source like this. 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. @marcaaron I updated according to approval here |
||
}, | ||
location: { | ||
useCurrent: 'Usar ubicación actual', | ||
|
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.
Awesome thanks! ❤️