-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Create Task FrontEnd Changes #17992
Create Task FrontEnd Changes #17992
Changes from all commits
053231c
db1e986
cff5490
ba8a856
6947298
8d49bf9
409a593
dae9bb9
80c39e8
d39115c
f211c02
e660cad
e83984a
f494977
5d1934d
0da82cc
17faa1e
91f16d2
a303279
53f3fd3
9b5397e
42be3fd
7fe9d82
00e7dac
9937807
387d8eb
eb5f0bc
00b7965
29ca351
4a90b90
71981fa
17eec06
aa1aa3f
ca73466
4561089
cf51fbc
455081a
8767bef
ddfb87a
b05c1fb
5f201ea
df2f420
5f87adf
ea3f61d
b86e845
2765122
6bcee36
6686ff8
d11f4e4
970f786
ebfbe39
856971f
956719c
8e28148
ef30195
4fe2f97
df59854
7da7834
5f18bb7
def7008
5c4f7b0
f797baf
74f406e
a750451
becece5
7577d67
24af85f
1e857ea
832b36c
47265f0
a35340c
3ca5b24
64ae0a7
4b9311e
0058927
c4a097d
e6adb1a
b0a605a
8649070
7f5eb36
ee1dd40
4d30cc2
b00b75c
559e576
8c98b5e
02be699
8f9abca
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,120 @@ | ||
import React from 'react'; | ||
import {View, TouchableOpacity} from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import styles from '../styles/styles'; | ||
import Icon from './Icon'; | ||
import * as Expensicons from './Icon/Expensicons'; | ||
import themeColors from '../styles/themes/default'; | ||
import variables from '../styles/variables'; | ||
import Text from './Text'; | ||
import withLocalize, {withLocalizePropTypes} from './withLocalize'; | ||
import * as StyleUtils from '../styles/StyleUtils'; | ||
import DisplayNames from './DisplayNames'; | ||
import MultipleAvatars from './MultipleAvatars'; | ||
import CONST from '../CONST'; | ||
import avatarPropTypes from './avatarPropTypes'; | ||
|
||
const propTypes = { | ||
/** Array of avatar URLs or icons */ | ||
icons: PropTypes.arrayOf(avatarPropTypes), | ||
|
||
/** The title to display */ | ||
text: PropTypes.string, | ||
|
||
/** The description to display */ | ||
alternateText: PropTypes.string, | ||
|
||
/** The function to call when the link is pressed */ | ||
onPress: PropTypes.func.isRequired, | ||
|
||
/** Label for the Link */ | ||
label: PropTypes.string.isRequired, | ||
|
||
/** Whether it is a share location */ | ||
isShareDestination: PropTypes.bool, | ||
|
||
/** Whether the Touchable should be disabled */ | ||
disabled: PropTypes.bool, | ||
|
||
...withLocalizePropTypes, | ||
}; | ||
|
||
const defaultProps = { | ||
icons: [], | ||
text: '', | ||
alternateText: '', | ||
isShareDestination: false, | ||
disabled: false, | ||
}; | ||
|
||
const TaskSelectorLink = (props) => { | ||
const shortenedText = props.text.length > 35 ? `${props.text.substring(0, 35)}...` : props.text; | ||
const displayNameStyle = StyleUtils.combineStyles(styles.optionDisplayName, styles.pre); | ||
const alternateTextStyle = StyleUtils.combineStyles( | ||
styles.sidebarLinkText, | ||
styles.optionAlternateText, | ||
styles.textLabelSupporting, | ||
styles.pre, | ||
); | ||
const linkBottomMargin = props.icons.length !== 0 ? styles.mb6 : styles.mb2; | ||
return ( | ||
<TouchableOpacity | ||
style={[styles.flexRow, styles.taskSelectorLink, linkBottomMargin]} | ||
onPress={props.onPress} | ||
disabled={props.disabled} | ||
> | ||
<View style={[styles.flexRow, styles.containerWithSpaceBetween, styles.alignItemsCenter]}> | ||
{props.icons.length !== 0 || props.text !== '' ? ( | ||
<View style={[styles.flexColumn, styles.justify, styles.alignItemsStart]}> | ||
<Text style={[styles.label, styles.textWhite, styles.mb2]}> | ||
{props.translate(props.label)} | ||
</Text> | ||
<View style={[styles.flexRow, styles.justifyContentCenter]}> | ||
<View style={[styles.flexRow, styles.alignItemsCenter]}> | ||
<MultipleAvatars | ||
icons={props.icons} | ||
size={CONST.AVATAR_SIZE.DEFAULT} | ||
secondAvatarStyle={[StyleUtils.getBackgroundAndBorderStyle(themeColors.appBG)]} | ||
/> | ||
<View style={[styles.flexColumn]}> | ||
<DisplayNames | ||
accessibilityLabel={props.translate('accessibilityHints.chatUserDisplayNames')} | ||
fullTitle={shortenedText} | ||
tooltipEnabled={false} | ||
numberOfLines={1} | ||
textStyles={displayNameStyle} | ||
shouldUseFullTitle={props.isShareDestination} | ||
/> | ||
{props.alternateText ? ( | ||
<Text style={alternateTextStyle} numberOfLines={1}> | ||
{props.alternateText} | ||
</Text> | ||
) : null} | ||
</View> | ||
</View> | ||
</View> | ||
</View> | ||
) : ( | ||
<Text style={[styles.textWhite, styles.textNormal]}> | ||
{props.translate(props.label)} | ||
</Text> | ||
)} | ||
{props.disabled ? null : ( | ||
<Icon | ||
src={Expensicons.ArrowRight} | ||
fill={themeColors.textLight} | ||
width={variables.iconSizeSmall} | ||
height={variables.iconSizeSmall} | ||
inline | ||
/> | ||
)} | ||
</View> | ||
</TouchableOpacity> | ||
); | ||
}; | ||
|
||
TaskSelectorLink.defaultProps = defaultProps; | ||
TaskSelectorLink.propTypes = propTypes; | ||
TaskSelectorLink.displayName = 'TaskSelectorLink'; | ||
|
||
export default withLocalize(TaskSelectorLink); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1154,12 +1154,19 @@ export default { | |
newTaskPage: { | ||
task: 'Tarea', | ||
assignTask: 'Asignar tarea', | ||
assignee: 'Cesionario', | ||
assigneeError: 'Hubo un error al asignar esta tarea, intente con otro cesionario', | ||
confirmTask: 'Confirmar tarea', | ||
confirmError: 'Por favor introduce un título y selecciona un destino de tarea', | ||
title: 'Título', | ||
description: 'Descripción', | ||
shareIn: 'Compartir en', | ||
descriptionOptional: 'Descripción (opcional)', | ||
shareSomewhere: 'Compartir en algún lugar', | ||
pleaseEnterTaskName: 'Por favor introduce un título', | ||
markAsComplete: 'Marcar como completa', | ||
markAsIncomplete: 'Marcar como incompleta', | ||
pleaseEnterTaskAssignee: 'Por favor, asigna una persona a esta tarea', | ||
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. Reminder for me to get translations for this, we have some certain terminology we are trying to keep consistent 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. @thienlnam I posted in open-source to get someone to check translations. Someone asked for the En/Es versions and I provided them but I haven't heard anything else about it. |
||
pleaseEnterTaskDestination: 'Por favor, selecciona un destino de tarea', | ||
}, | ||
statementPage: { | ||
generatingPDF: 'Estamos generando tu PDF ahora mismo. ¡Por favor, vuelve más tarde!', | ||
|
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.
This component was not clipping text appropriately for longer text which caused #18659