Skip to content
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

Merged
merged 5 commits into from
Dec 18, 2023
Merged

Task/date field #147

merged 5 commits into from
Dec 18, 2023

Conversation

JosselinTILLAY
Copy link
Contributor

@JosselinTILLAY JosselinTILLAY commented Dec 15, 2023

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

date-field

@JosselinTILLAY JosselinTILLAY requested review from a team and ulricden December 15, 2023 16:03
Copy link
Contributor

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,
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrigé

Copy link
Contributor

@clementdejoie clementdejoie left a 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];
Copy link
Contributor

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)

Copy link
Contributor

@AdrienCasta AdrienCasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

89hjwl

hasError?: boolean;
}

function GetColorsStyle(theme: Theme, state: State) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function GetColorsStyle(theme: Theme, state: State) {
function getColorsStyle(theme: Theme, state: State) {

Copy link
Contributor Author

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,
Copy link
Contributor

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 ?

Copy link
Contributor

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';
}
Copy link
Contributor

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';

Copy link
Contributor Author

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> = ({
Copy link
Contributor

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 ?

Copy link
Contributor Author

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).

@JosselinTILLAY
Copy link
Contributor Author

@AdrienCasta : tests ajoutés

@@ -1,87 +1,88 @@
{
"name": "@zerogachis/smartway-react-native-ui",
Copy link
Contributor

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 ?

Copy link
Contributor Author

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';
Copy link
Contributor

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

Copy link
Contributor Author

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>) => {
Copy link
Contributor

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 ?

Copy link
Contributor Author

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 ?

Copy link
Contributor

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é ?

Copy link
Contributor Author

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"

@JosselinTILLAY JosselinTILLAY merged commit 9767c9b into main Dec 18, 2023
2 checks passed
@JosselinTILLAY JosselinTILLAY deleted the task/date-field branch December 18, 2023 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants