-
Notifications
You must be signed in to change notification settings - Fork 0
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
Task/date field #147
Task/date field #147
Conversation
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.
Etrange cette diff, j'ai mis 2mn à voir que tu avais ajouté "prettier-eslint"...
color: textColor, | ||
fontFamily: 'PublicSans-Bold', | ||
fontSize: 20, | ||
lineHeight: 48, |
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.
Je ne sais pas si c'est important, mais la lineHeight est à 23,5 sur la maquette
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.
Corrigé
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.
Rien de bloquant, c'est ok pour moi !
textColor = theme.sw.colors.primary.main; | ||
borderColor = theme.sw.colors.primary.main; | ||
backgroundColor = | ||
theme.sw.colors.primary.main + theme.sw.transparency[16]; |
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.
Bon bah visiblement on fait comme ça les transparences x)
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.
hasError?: boolean; | ||
} | ||
|
||
function GetColorsStyle(theme: Theme, state: State) { |
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.
function GetColorsStyle(theme: Theme, state: State) { | |
function getColorsStyle(theme: Theme, state: State) { | |
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.
Corrigé
width: 72, | ||
color: textColor, | ||
fontFamily: 'PublicSans-Bold', | ||
fontSize: 20, |
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.
On a pas une font size dans le DS ?
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.
not yet WIP
return 'filled'; | ||
} else { | ||
return 'filled-focused'; | ||
} |
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.
Peut-on aplatir les conditions ici ?
if (hasError) {
return 'error';
}
if (!isFocused && value === '') {
return 'empty';
}
if (isFocused && value === '') {
return 'empty-focused';
}
if (!isFocused) {
return 'filled';
}
return 'filled-focused';
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.
Corrigé
return style; | ||
} | ||
|
||
export const DateField: React.FC<DateFieldProps> = ({ |
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.
il n'a rien avoir avec la Date non ? et la seul chose qui lui donne accès au nombre c'est le clavier.
pourquoi ne pas laisser l'appelant choisir le clavier et l'appeler inputField ?
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.
Taille limité à 2 caractères et n'acceptant les chaines de caractères que composés de nombres (pas de virgules, points, ni lettres).
5e890b7
to
3709a05
Compare
@AdrienCasta : tests ajoutés |
@@ -1,87 +1,88 @@ | |||
{ | |||
"name": "@zerogachis/smartway-react-native-ui", |
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.
C'est vrai que c'est bizarre cette diff, ça vient de quoi ? On a appliqué les règles qui ne l'avaient pas été jusque là à cause du dysfonctionnement du linter ?
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.
Oui
@@ -0,0 +1,160 @@ | |||
import React, { useState } from 'react'; |
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.
Ce serait mieux de nommer le dossier "dateSelector" plutôt que datePicker
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.
C'est clément qui as choisit le nom, c'est un nom commun pour les sélecteurs de dates. J'ai pas d'avis sur la question. Je vais renommer, il y a un vote de ta part, de celle d'Adrien et de Lauren dans son figma ^^
|
||
const style = getStyle(theme, state); | ||
|
||
const onFocus = (e: NativeSyntheticEvent<TextInputFocusEventData>) => { |
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.
Est-ce que cet événement est déclenché même si le composant est déjà focus ou pas ?
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.
Hmm, c'est à dire ? Comment il pourrait être déjà focus ? Si je clique 3 fois dessus à la suite par exemple ?
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.
Yes en effet c'était ça, est-ce que si je clique plusieurs fois dessus je re déclenche l'événement, même si je suis déjà sélectionné ?
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.
Je viens de checker, l'évènement est déclenché uniquement quand on passe de l'état "unfocused" à l'état "focused"
cec7784
to
41d9e4a
Compare
Pour info, on a utilisé la terminologie "placeholder" et pas "prefilled" parce que le comportement prefilled se situe au niveau du dateSelector, pas du dateFilled. C'est ouvert à discussion, c'est juste un terme :p