Skip to content

Conversation

@Quoflame77
Copy link
Collaborator

  • implementacja widoku po wysłaniu formularza
  • widok jest dostosowany do ekranów od 420px w górę

@linear
Copy link

linear bot commented Sep 21, 2025

@JakubLobos
Copy link
Collaborator

420px to słabo, dobrze jakby się tak z 380px udało zrobić.

Comment on lines +1 to +4
const toggleClasses = (elementId: string, className: string): void => {
if (document.getElementById(elementId) !== null) document.getElementById(elementId)?.classList.toggle(className);
else return;
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • Niepotrzebny podwójny odczyt DOM. Wywołaj raz, przypisz do zmiennej.
  • Nazwa toggleClasses sugeruje wiele klas, lepiej toggleClass

Comment on lines +6 to +14
document.getElementById("formSubmitButton")?.addEventListener("click", (): void => {
toggleClasses("formSection", "invisible");
toggleClasses("form-section-after-send", "invisible");
});

document.getElementById("secondary-form-button")?.addEventListener("click", (): void => {
toggleClasses("formSection", "invisible");
toggleClasses("form-section-after-send", "invisible");
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Powtarzający się kod

const toggleVisibility = () => {
  toggleClass("formSection", "invisible");
  toggleClass("form-section-after-send", "invisible");
};

document.getElementById("formSubmitButton").addEventListener("click", toggleVisibility);
document.getElementById("secondary-form-button")?.addEventListener("click", toggleVisibility);

opcjonalnie dla czytelności polecam sobie przypisać najpierw element który szukasz w DOM do zmiennej zamiast używać optional chaining

np.

const submitButton = document.getElementById("formSubmitButton");
if (submitButton) btn.addEventListener("click", toggleVisibility);

(...)

Copy link
Collaborator

Choose a reason for hiding this comment

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

btw duży plus za to, że sobie wydzielacie te skrypty do oddzielnych plików

Comment on lines +69 to +70
<Image class="starImage-1" src={starLight} alt="star-1" width={110} />
<Image class="starImage-2" src={starLight} alt="star-2" width={110} />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Te elementy są nieznaczące dla użytkownika więc nie muszą mieć alternatywnego tekstu, jak ktoś będzie korzystał z screen-readerów to mu przeczyta alta. W takich przypadkach można wrzucić alt jako empty string. To jest zachowanie zgodne z zasadami WCAG https://www.w3.org/WAI/tutorials/images/decorative/

<div class="dot dot-light"></div>
</div>
<div class="header-wrap">
<h2 class="infoTitle">Świetnie, teraz jesteśmy w <br /> kontakcie!</h2>
Copy link
Collaborator

Choose a reason for hiding this comment

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

i18n


.formTopSectionInput{
.formTopSectionInput {
width: 47%;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Dziwna wartość width: 47%. Jak mieliście problem z umiejscowieniem dwóch elementów w obok siebie to lepiej użyć

display: flex i flex-wrap: nowrap, ewentualnie display: flex na parencie i flex: 1 na childrenach, lub użycie grida

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.

3 participants