`VideoSection` can be refactored
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, react
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu bằng cách so sánh src/components/challenges/VideoSection.js và src/components/tracks/VideoSection.js, cùng với các tệp CSS của chúng, để xác định cấu trúc dùng chung và những khác biệt có chủ đích. Theo dõi hành vi khi nhấp vào Track Stop và Part, sau đó xác minh rằng component dùng chung đã được refactor và các style đã được hợp nhất vẫn giữ nguyên cả hai biến thể và giải quyết hành vi timeline bị trùng lặp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- JavaScript
- Star
- 283
- Fork
- 125
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CodingTrain/thecodingtrain.com
-
"SHOP" link in footer 404s Đang mở
CodingTrain/thecodingtrain.com#1991 · 1 bình luận · 1 người được giao ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
CodingTrain/thecodingtrain.com#1805 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
CodingTrain/thecodingtrain.com#1785 · 1 reaction ·
-
help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
CodingTrain/thecodingtrain.com#1750 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
CodingTrain/thecodingtrain.com#1730 ·
Tất cả issue của CodingTrain/thecodingtrain.com
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Theme loads third-party resources on every page (jsdelivr web font, cdnjs Font Awesome) – GDPR Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
docToolchain/docToolchain#1705 ·
-
Timezone select lists one option per character; duplicate "Failed" reason; shared tracker popover id Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
nightscout/nocturne#1414 ·
-
bug v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/inspector#2458 · 1 bình luận ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
carbon-design-system/ibm-products#9907 ·