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

Corregido Storybook del componente Text #18

Merged
merged 3 commits into from Aug 17, 2023

Conversation

pablonortiz
Copy link
Contributor

LINK DE TICKET:
https://janiscommerce.atlassian.net/browse/JUIP-113

DESCRIPCIÓN DEL REQUERIMIENTO:

Contexto

Actualmente se está tomando el componente Text de un archivo que se está armando en una carpeta del mismo nombre en la carpeta de Storybook
Necesidad

Se necesita usar el componente Text de la carpeta components, eliminando el archivo en dónde se arma el Text que se está utilizando actualmente en Storybook

DESCRIPCIÓN DE LA SOLUCIÓN:

Se eliminó el componente Text que se estaba utilizando en Storybook, por esto, se modificaron los imports del Storybook Text y StatusChip para utilizar el componente Text de la carpeta components.

Además, se modificó el componente Text, esto debido a que no estaba aceptando los props de styles correctamente, por lo que ahora se le comenzaron a pasar el resto de props que se le pasen al componente, al StyleSheet del componente.

CÓMO SE PUEDE PROBAR?
Clonar e instalar el Repo de UI-Native

Correr los siguientes 3 comandos en tres pestañas diferentes de la termina

npm run start
npm run android
npm run storybook

Se debe abrir la app en el emulador con storybooks y el navegador en la url http://localhost:7007/ donde se podrá probar
el comportamiento del componente

Para linkear el componente con un proyecto, seguir la siguiente documentación
https://fizzmod.atlassian.net/wiki/spaces/JAPP/pages/2341765125/C+mo+trabajo+con+el+package+UI

Copy link

@dam788 dam788 left a comment

Choose a reason for hiding this comment

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

No se como no nos dimos cuenta de eso, que mal que revisamos

@github-actions
Copy link

Pull Request Test Coverage Report for Build 5870192674

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 5821889645: 0.0%
Covered Lines: 154
Relevant Lines: 154

💛 - Coveralls


interface TextProps extends TextComponentProps {
children?: ReactElement | string;
style?: TextStyle[];

Choose a reason for hiding this comment

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

Creo que no es necesario pasar un array de estilos, de esta manera creo que se ve mejor, y no hay que desectructurar style.

cuando invocas un componente no se le debería pasar mas de objeto de 1 estilo.
Captura de pantalla de 2023-08-15 15-37-07

@@ -19,7 +20,7 @@ const StatusChip = ({children, ...props}: StatusChipProps) => {

return (
<View style={styles(props).ViewStyles} {...props}>
{isCustomComponent ? children : <Text style={styles(props).TextStyles}>{children}</Text>}
{isCustomComponent ? children : <Text style={[styles(props).TextStyles]}>{children}</Text>}

Choose a reason for hiding this comment

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

Esto tendria que ver con el otro comentario, aqui no hace falta pasar los estilos como array

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Listo @WilliamSaya-lvl30 ahí ya lo corregí!

@christian97dd christian97dd merged commit dfb730a into master Aug 17, 2023
2 checks passed
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.

None yet

4 participants