`VideoSection` can be refactored
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, react
- Ambito
- frontend
Direzione di ricerca
Inizia confrontando src/components/challenges/VideoSection.js e src/components/tracks/VideoSection.js, insieme ai relativi file CSS, per identificare la struttura condivisa e le differenze intenzionali. Traccia il comportamento al clic di Track Stop e Part, quindi verifica che il componente condiviso sottoposto a refactoring e gli stili unificati preservino entrambe le varianti e risolvano il comportamento duplicato della timeline.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I've listed some bugs below, but this is mostly a critique of the code structure which is the overarching problem.
I was trying to fix a small issue in #1339 that requires setting the background of the VideoSection component's .timeline. But there are 2 independent, yet similar implementations of VideoSection for Tracks and Challenges - this required changing 2 files for a feature that is common to both.
In fact, challenges/VideoSection.js and tracks/VideoSection.js are mostly the same except for a few variables and what happens when a "Track Stop" or a "Part" is clicked. Their respective CSS files are have even more similarity, differing in hardly a few lines (and these may be unintentional).
Is this important? Well yeah, because code redundancy has already caused some differences:
| Challenges | Tracks |
|---|---|
Potential Solution
If we refactor VideoSection to be a Class Component instead of a Functional Component, we can inherit from a more general VideoSection that'll make the code more readable and DRY. The CSS files have practically no differences because we pass in the variant programmatically for UI changes. They can be merged, and we can use this merged file for the base VideoSection class.
- Lingua principale
- JavaScript
- Stelle
- 283
- Fork
- 125
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CodingTrain/thecodingtrain.com
-
"SHOP" link in footer 404s Aperta
CodingTrain/thecodingtrain.com#1991 · 1 commento · 1 assegnatario ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
CodingTrain/thecodingtrain.com#1805 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
CodingTrain/thecodingtrain.com#1785 · 1 reazione ·
-
help wanted
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
CodingTrain/thecodingtrain.com#1750 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
CodingTrain/thecodingtrain.com#1730 ·
Tutte le issue di CodingTrain/thecodingtrain.com
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
web-platform-tests/interop#1455 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
corsairdev/corsair#1764 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100