Repository navigation
Feature/navbar add tickets #5
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| /* รีเซ็ตค่าเริ่มต้นพื้นฐาน */ | ||
| * { | ||
| box-sizing: border-box; | ||
| margin: 0; | ||
| padding: 0; | ||
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | ||
| } | ||
| /* รีเซ็ตค่าเริ่มต้นพื้นฐาน */ | ||
| * { | ||
| box-sizing: border-box; | ||
| margin: 0; | ||
| padding: 0; | ||
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| .container-card { | ||
| display: grid; | ||
| grid-template-columns: 150px 1fr; | ||
| background-color: var(--background-color-main); | ||
| box-shadow: 0 0 0, 0 0 10px; | ||
| border: solid 1px var(--tbs-green); | ||
| padding: 1rem; | ||
| transition: all 0.1s; | ||
| width: 420px; | ||
| border-radius: 10px; | ||
| flex: 0 0 420px; | ||
| gap: 1rem; | ||
| } | ||
|
|
||
| .main-info-card { | ||
| display: grid; | ||
| gap: 1rem; | ||
| } | ||
| .before-img-ticket img{ | ||
| width: 90%; | ||
| height: auto; | ||
| } | ||
|
|
||
| .info-card p { | ||
| margin: 0; | ||
| color: var(--text-color-muted); | ||
| } | ||
|
|
||
| .text-limit { | ||
| line-height: 1.5em; | ||
| height: 3em; | ||
| display: -webkit-box; | ||
| -webkit-line-clamp: 2; | ||
| -webkit-box-orient: vertical; | ||
| overflow: hidden; | ||
| text-overflow: ellipsis; | ||
| margin: 0; | ||
| } | ||
|
|
||
| .img-card img { | ||
| width: 150px; | ||
| height: 150px; | ||
| border-radius: 10px; | ||
| } | ||
|
|
||
| .container-card:hover { | ||
| box-shadow: 0 0 0, 0 0 15px var(--tbs-green); | ||
| transform: translateY(-4px); | ||
| } | ||
|
|
||
| @media (max-width: 430px) { | ||
| .container-card { | ||
| display: grid; | ||
| width: 320px; | ||
| flex: 0 0 320px; | ||
| grid-template-columns: 100px 1fr; | ||
| gap: 10px; | ||
|
|
||
| } | ||
| .img-card img{ | ||
| width: 100px; | ||
| height: 100px; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import './CardFinishProblem.css' | ||
| import { useNavigate } from 'react-router-dom'; | ||
| import { StarRating } from './StarRating'; | ||
|
|
||
| export const CardFinishProblem = ({ data }) => { | ||
| const navigate = useNavigate(); | ||
|
|
||
| const handleClick = () => { | ||
| navigate(`/Ticketproblem?ticketId=${data.ticketId}`); | ||
| }; | ||
|
|
||
| return ( | ||
| <div className='container-card' onClick={handleClick}> | ||
| <div className="img-card"> | ||
| {data.images && data.images.length > 0 ? ( | ||
| <img src={data.images[0].imageUrl} alt="" /> | ||
| ) :( | ||
| <div className="no-image">ไม่มีรูปภาพประกอบ</div> | ||
| )} | ||
| </div> | ||
| <div className="main-info-card" key={data.id}> | ||
| <div className="info-card"> | ||
| <h1 style={{ fontSize: '25px',margin: 0 }}>{data.title}</h1> | ||
| <p>โดย : {data.admin}</p> | ||
| <p>เสร็จสิ้น : {data.admin}</p> | ||
|
|
||
| </div> | ||
| <div className="review-card"> | ||
| <StarRating rating={data?.rating || 0} /> | ||
| <p className='text-limit'><img | ||
| src="description.png" | ||
| alt="" | ||
| style={{ width: '20px', height: '20px', gap: '10px' }} />{data.comment}</p> | ||
|
|
||
| </div> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,4 +64,4 @@ const Navbar = () => { | |
| ); | ||
| }; | ||
|
|
||
| export default Navbar; | ||
| export default Navbar; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import React from 'react'; | ||
| import { FaStar, FaStarHalfAlt, FaRegStar } from 'react-icons/fa'; | ||
|
|
||
| export const StarRating = ({rating}) => { | ||
| const stars = Array.from({ length: 5 }, (_, index) => { | ||
|
|
||
| const starValue = index + 1; // ตำแหน่งดาว (1, 2, 3, 4, 5) | ||
|
|
||
| // ตรรกะการเช็คว่าควรโชว์ดาวแบบไหน | ||
| if (rating >= starValue) { | ||
| // 1. ถ้าคะแนนมากกว่าหรือเท่ากับตำแหน่งดาว = โชว์ดาวเต็ม | ||
| return <FaStar key={index} color="#ffc107" size={15} />; | ||
|
|
||
| } else if (rating >= starValue - 0.5) { | ||
| // 2. ถ้าคะแนนมี .5 เช่น ส่งมา 4.5 ตำแหน่งดาวที่ 5 จะเข้าเงื่อนไขนี้ = โชว์ครึ่งดาว | ||
| return <FaStarHalfAlt key={index} color="#ffc107" size={15} />; | ||
|
|
||
| } else { | ||
| // 3. นอกนั้น = โชว์ดาวเปล่า (สีเทา) | ||
| return <FaRegStar key={index} color="#e4e5e9" size={15} />; | ||
| } | ||
| }); | ||
| return ( | ||
| <div style={{ display: 'flex', alignItems: 'center' }}> | ||
| <span style={{ marginLeft: '1px', color: '#666' }}>{rating}</span> | ||
| {stars} | ||
| {/* (ตัวเลือกเสริม) โชว์ตัวเลขกำกับไว้ข้างหลัง */} | ||
|
|
||
| </div> | ||
| ) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, let's check if client/index.html exists and read its content cat -n client/index.htmlRepository: CNPJB/trouble-tracking-system-project
Length of output: 534
🏁 Script executed:
Repository: CNPJB/trouble-tracking-system-project
Length of output: 63
🏁 Script executed:
Repository: CNPJB/trouble-tracking-system-project
Length of output: 151
Remove the empty favicon
hrefor provide an actual asset path.At Line 5,
href=""is invalid and breaks favicon loading. The suggested path/favicon.svgdoes not exist in the repository. Either create a favicon asset and reference it, or remove this line entirely if a favicon is not needed.Example fix (if favicon asset will be added)
🧰 Tools
🪛 HTMLHint (1.9.2)
[error] 5-5: The attribute [ href ] of the tag [ link ] must have a value.
(src-not-empty)
🤖 Prompt for AI Agents