-
Notifications
You must be signed in to change notification settings - Fork 130
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
feat: Leetcode Company Tagged 🗂️ #530
base: main
Are you sure you want to change the base?
Changes from 4 commits
7df1076
7d310e2
4eb3ea6
d96aad6
4da1af3
53e62d3
6af6315
5634b7b
73b1bb4
662255b
5953ad0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ export async function loader({ params, request }: LoaderFunctionArgs) { | |
'companies.imageUrl', | ||
'companies.name', | ||
'companies.levelsFyiSlug', | ||
'companies.leetcodeTagged', | ||
], | ||
where: { id }, | ||
}), | ||
|
@@ -154,6 +155,10 @@ export default function CompanyPage() { | |
{company.levelsFyiSlug && ( | ||
<LevelsFyiLink slug={company.levelsFyiSlug} /> | ||
)} | ||
|
||
{company.leetcodeTagged && ( | ||
<LeetcodeTaggedLink leetcode_tagged={company.leetcodeTagged} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's change the naming from |
||
)} | ||
</div> | ||
|
||
<DomainLink domain={company.domain} /> | ||
|
@@ -216,6 +221,34 @@ function LevelsFyiLink({ slug }: LevelsFyiLinkProps) { | |
); | ||
} | ||
|
||
type LeetcodeTaggedLinkProps = { | ||
leetcode_tagged: string; | ||
}; | ||
|
||
function LeetcodeTaggedLink({ leetcode_tagged }: LeetcodeTaggedLinkProps) { | ||
return ( | ||
<Tooltip> | ||
<TooltipTrigger asChild> | ||
<a | ||
className="mt-1" | ||
href={leetcode_tagged} | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
<img | ||
alt="Leetcode Logo" | ||
className="h-4 w-4 cursor-pointer rounded-sm hover:opacity-90" | ||
src="/images/leetcode.png" | ||
/> | ||
</a> | ||
</TooltipTrigger> | ||
<TooltipContent> | ||
<TooltipText>View Company Leetcode Problems</TooltipText> | ||
</TooltipContent> | ||
</Tooltip> | ||
); | ||
} | ||
|
||
function AverageRating({ | ||
averageRating, | ||
}: Pick<CompanyInView, 'averageRating'>) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { type Kysely } from 'kysely'; | ||
|
||
export async function up(db: Kysely<any>) { | ||
await db.schema | ||
.alterTable('companies') | ||
.addColumn('leetcode_tagged', 'varchar') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's change |
||
.execute(); | ||
} | ||
|
||
export async function down(db: Kysely<any>) { | ||
await db.schema | ||
.alterTable('companies') | ||
.dropColumn('leetcode_tagged') | ||
.execute(); | ||
} |
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.
Since we're changing the name to leetcodeTaggedSlug in the database, we need to have that changed reflected here
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.
Done