`VideoSection` can be refactored
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Refatoração
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- javascript, react
- Domínio
- frontend
Direção de pesquisa
Comece comparando src/components/challenges/VideoSection.js e src/components/tracks/VideoSection.js, junto com seus arquivos CSS, para identificar a estrutura compartilhada e as diferenças intencionais. Rastreie o comportamento de clique de Track Stop e Part e, em seguida, verifique se o componente compartilhado refatorado e os estilos mesclados preservam ambas as variantes e resolvem o comportamento duplicado da timeline.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- JavaScript
- Estrelas
- 287
- Forks
- 125
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de CodingTrain/thecodingtrain.com
-
"SHOP" link in footer 404sTalvez livre de novo @shiffman assumiu há 61 dias e não há nenhum pull request aberto. Aberta
CodingTrain/thecodingtrain.com#1991 · 1 comentário · 1 responsável ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 25/100
CodingTrain/thecodingtrain.com#1805 · 1 comentário ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
CodingTrain/thecodingtrain.com#1785 · 1 reação ·
-
help wanted
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
CodingTrain/thecodingtrain.com#1750 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
CodingTrain/thecodingtrain.com#1730 ·
Todas as issues de CodingTrain/thecodingtrain.com
Issues semelhantes
-
Tool errors containing cycles or BigInt crash getErrorMessage and replace the original failureAbertafactory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
vercel/ai#22796 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
documentation
Dificuldade 2/5 Meio dia Facilidade para iniciantes 78/100
facioquo/stock-indicators-dotnet#2300 ·
Mantenedores costumam responder em até 1 dia
-
fix(knowledge): list-promotion-candidates prints a stack trace on a malformed claim inventoryAbertagood first issue needs-triage priority: low
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
melodic-software/claude-code-plugins#6982 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
val() setter uses the first control's type for a mixed selectionTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 Meio dia Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 75/100
douglascrockford/Misty#35 ·
Mantenedores costumam responder em até 1 dia