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

Boton de Lectura Simple #148

Merged
merged 2 commits into from
Dec 11, 2023
Merged

Boton de Lectura Simple #148

merged 2 commits into from
Dec 11, 2023

Conversation

danielferro69
Copy link
Contributor

Resolves Program-AR/pilas-bloques-ember#1252

simplereadmode.mp4

@danielferro69 danielferro69 requested a review from a team as a code owner December 6, 2023 21:03
Copy link
Contributor

@asanzo asanzo left a comment

Choose a reason for hiding this comment

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

Bravo, @danielferro69 !!! Laburazo. Ya está mergeable.
Fijate que te hice comments boludos sobre minúsculas y sobre dónde poner parte del código, por ahí vale la pena gastarle 15' más.

@@ -75,7 +75,7 @@ const ChallengeView = (props: ChallengeViewProps) => {
const solutionParam: string = solution ? `?codigo=${solution}` : ""

return <>
<Header CenterComponent={ChallengeBreadcrumb(path)} />
<Header CenterComponent={ChallengeBreadcrumb(path)} ShouldShowSimpleReadSwitch={!path.book.simpleReadMode} />
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
<Header CenterComponent={ChallengeBreadcrumb(path)} ShouldShowSimpleReadSwitch={!path.book.simpleReadMode} />
<Header CenterComponent={ChallengeBreadcrumb(path)} shouldShowSimpleReadSwitch={!path.book.simpleReadMode} />

@@ -32,6 +34,7 @@ export const Header = ({CenterComponent= <></>, SubHeader=<></>}: HeaderProps) =
{CenterComponent}
<div>
<ChangeLanguageButton/>
{ShouldShowSimpleReadSwitch && <SimpleReadSwitch/>}
Copy link
Contributor

Choose a reason for hiding this comment

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

minúscula!! Mayúscula son los componentes.

Suggested change
{ShouldShowSimpleReadSwitch && <SimpleReadSwitch/>}
{shouldShowSimpleReadSwitch && <SimpleReadSwitch/>}

Comment on lines 8 to 15
const iconSx = {
backgroundColor: 'white',
borderRadius: 10,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
color: 'gray'
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Acá el ícono tiene código repetido con el DarkModeSwitch. Me pregunto si el sx no debería ponérselo el PBSwitch al ícono que recibe por parámetro. Igual es una boludez, es poquito repetido.
Y/O quizás en ambos switch (modo lectura simple y dark mode) el color y el backgroundColor podrían sacarse del tema... No sé si vale la pena. Sí me parece extraño tener estos colores hardcodeados acá. El radius y padding es propio del componente, pero ¿los colores por ahí deberían sacarse de otro lado?. Estoy pensando en voz alta.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

si, tiene codigo repetido entre otras cosas porque el PBSwitch tiene su propio color de fondo cuando fui a verlo (harcodeado a #cccccc) y suponiendo que este componente se usaba en otro lado, por eso tomé como base el darkmode y lo adapté pensando esto realmente, que el PBSwitch se usaba en otros componentes (como en el creador en el toolBoxDialog) en la aplicacion, pero ahora fui a revisar y no... asi que bien podriamos llevarlo al PBSwitch, salvo que esté pensado para usarse realmente en otro lado y por alguna cosa del destino, no ocurrió ...


const theme = useMemo(
() => createTheme(getDesignTokens(darkModeEnabled)),
[darkModeEnabled]
() => createTheme( deepmerge(getDesignTokens(darkModeEnabled), {typography: { allVariants: { textTransform: simpleReadModeEnabled ? 'uppercase': 'initial'}}})),
Copy link
Contributor

Choose a reason for hiding this comment

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

Me pregunto si esto no debería estar definido dentro de getDesignTokens al igual que el darkModeEnabled, agregándole un parámetro, para tener todo css del lado del theme

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahi lo intento...

@danielferro69
Copy link
Contributor Author

Bueno, @asanzo creo que hice todo lo sugerido. Cualquier cosa, la seguimos.

Copy link
Contributor

@asanzo asanzo left a comment

Choose a reason for hiding this comment

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

Laburazo, dani1! MERRRSHHH

@danielferro69 danielferro69 merged commit 7221dc2 into develop Dec 11, 2023
10 checks passed
@danielferro69 danielferro69 deleted the simpleRead branch December 11, 2023 21:07
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.

Botón modo lectura simple
2 participants