-
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
Open
cjohnson74
wants to merge
11
commits into
colorstackorg:main
Choose a base branch
from
cjohnson74:leetcode-tagged
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7df1076
Add leetcode_tagged column to companies table
cjohnson74 7d310e2
Added leetcode logo to images folder
cjohnson74 4eb3ea6
Added leetcode logo next to levels fyi logo
cjohnson74 d96aad6
Merge branch 'main' into leetcode-tagged
cjohnson74 4da1af3
Merge branch 'main' into leetcode-tagged
tomas-salgado 53e62d3
changed naming
cjohnson74 6af6315
Merge remote-tracking branch 'upstream/main' into leetcode-tagged
cjohnson74 5634b7b
Merge branch 'leetcode-tagged' of github.com:cjohnson74/oyster into l…
cjohnson74 73b1bb4
Merge branch 'main' into leetcode-tagged
tomas-salgado 662255b
Updated naming
cjohnson74 5953ad0
Merge branch 'leetcode-tagged' of github.com:cjohnson74/oyster into l…
cjohnson74 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 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 |
---|---|---|
|
@@ -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 slug={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. we also need to change the name in these two lines 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. And done! |
||
)} | ||
</div> | ||
|
||
<DomainLink domain={company.domain} /> | ||
|
@@ -216,6 +221,34 @@ function LevelsFyiLink({ slug }: LevelsFyiLinkProps) { | |
); | ||
} | ||
|
||
type LeetcodeTaggedLinkProps = { | ||
slug: string; | ||
}; | ||
|
||
function LeetcodeTaggedLink({ slug }: LeetcodeTaggedLinkProps) { | ||
return ( | ||
<Tooltip> | ||
<TooltipTrigger asChild> | ||
<a | ||
className="mt-1" | ||
href={slug} | ||
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'>) { | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
packages/db/src/migrations/20240927053214_leetcode-tagged-link.ts
This file contains 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,15 @@ | ||
import { type Kysely } from 'kysely'; | ||
|
||
export async function up(db: Kysely<any>) { | ||
await db.schema | ||
.alterTable('companies') | ||
.addColumn('leetcode_tagged_slug', 'varchar') | ||
.execute(); | ||
} | ||
|
||
export async function down(db: Kysely<any>) { | ||
await db.schema | ||
.alterTable('companies') | ||
.dropColumn('leetcode_tagged_slug') | ||
.execute(); | ||
} |
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.
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