-
-
Notifications
You must be signed in to change notification settings - Fork 29
vntechies v3 #110
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
vntechies v3 #110
Changes from all commits
Commits
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
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
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
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,41 +1,61 @@ | ||
| import Image from './Image' | ||
| import Link from './Link' | ||
|
|
||
| const Card = ({ title, description, imgSrc, href, showMore = true, isFree }) => ( | ||
| <div className="w-full p-4 md:w-1/2"> | ||
| <Link alt={`Link tới ${title}`} href={href} className="block h-full"> | ||
| <div className="hover:scale-105flex flex h-full h-full flex-col flex-col overflow-hidden overflow-hidden rounded-lg rounded-lg bg-gray-100 transition duration-500 hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700"> | ||
| {imgSrc && ( | ||
| <div> | ||
| <Image | ||
| alt={title} | ||
| src={imgSrc} | ||
| className="h-64 w-full object-cover object-center" | ||
| width={544} | ||
| height={306} | ||
| loading="lazy" | ||
| /> | ||
| const Card = ({ title, description, imgSrc, href, showMore = true, isFree }) => { | ||
| const badge = | ||
| isFree === undefined ? null : isFree ? ( | ||
| <span className="text-xs inline-flex w-fit items-center rounded-full border border-emerald-200 bg-emerald-50 px-2.5 py-1 font-semibold tracking-wide text-emerald-700 dark:border-emerald-700/60 dark:bg-emerald-900/30 dark:text-emerald-300"> | ||
| MIỄN PHÍ | ||
| </span> | ||
| ) : ( | ||
| <span className="text-xs inline-flex w-fit items-center rounded-full border border-orange-200 bg-orange-50 px-2.5 py-1 font-semibold tracking-wide text-orange-700 dark:border-orange-700/60 dark:bg-orange-900/30 dark:text-orange-300"> | ||
| PREMIUM | ||
| </span> | ||
| ) | ||
|
|
||
| return ( | ||
| <div className="h-full"> | ||
| <Link alt={`Link tới ${title}`} href={href} className="group block h-full"> | ||
| <article className="surface-panel flex h-full flex-col overflow-hidden transition-all duration-300 hover:-translate-y-1"> | ||
| {imgSrc && ( | ||
| <div className="aspect-[16/10] overflow-hidden border-b border-slate-200 dark:border-slate-700"> | ||
| <Image | ||
| alt={title} | ||
| src={imgSrc} | ||
| className="h-full w-full object-cover object-center transition-transform duration-500 group-hover:scale-105" | ||
| width={544} | ||
| height={306} | ||
| loading="lazy" | ||
| /> | ||
| </div> | ||
| )} | ||
|
|
||
| <div className="flex flex-1 flex-col p-5 sm:p-6"> | ||
| {badge && <div className="mb-3">{badge}</div>} | ||
| <h2 className="text-xl font-bold leading-tight text-slate-900 transition-colors group-hover:text-orange-600 dark:text-slate-100 dark:group-hover:text-orange-300"> | ||
| {title} | ||
| </h2> | ||
| <p className="mt-3 flex-1 text-sm leading-7 text-slate-600 dark:text-slate-300"> | ||
| {description} | ||
| </p> | ||
| {showMore && ( | ||
| <span className="mt-5 inline-flex items-center text-sm font-semibold text-orange-600 dark:text-orange-300"> | ||
| Xem chi tiết | ||
| <svg className="ml-2 h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> | ||
| <path | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| strokeWidth={2} | ||
| d="M13 7l5 5m0 0l-5 5m5-5H6" | ||
| /> | ||
| </svg> | ||
| </span> | ||
| )} | ||
| </div> | ||
| )} | ||
| <div className="flex-grow p-6"> | ||
| <h2 className="mb-3 text-xl font-bold leading-8 tracking-tight sm:text-2xl"> | ||
| {isFree !== undefined && | ||
| (isFree ? ( | ||
| <span className="mb-2 inline-block rounded bg-green-100 px-2.5 py-0.5 text-sm font-medium text-green-800 dark:bg-green-900 dark:text-green-300"> | ||
| MIỄN PHÍ | ||
| </span> | ||
| ) : ( | ||
| <span className="mb-2 inline-block rounded px-2.5 py-0.5 text-sm font-medium text-orange-800 dark:bg-orange-900 dark:text-orange-300"> | ||
| 💎 PREMIUM | ||
| </span> | ||
| ))} | ||
| <div>{title}</div> | ||
| </h2> | ||
| <p className="prose mb-3 max-w-none text-gray-500 dark:text-gray-400">{description}</p> | ||
| </div> | ||
| </div> | ||
| </Link> | ||
| </div> | ||
| ) | ||
| </article> | ||
| </Link> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default Card |
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
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.
The checkbox inputs are wrapped in label elements but also contain nested label/span elements. This creates invalid HTML as labels cannot be nested. Remove the inner label tags and keep only the span elements, or restructure to avoid nesting labels.