-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: post to linkedin projects (#177)
* feat: add linkedin first iteration * chore: try function in scripting * feat: add fetch and populate data * chore:remove unimportant information from manifest * chore: remove content-script linkedin * feat: changed the effect name, logic to home * chore: lint * chore: wait for element loaded * feat: add linkedin icon * Empty-Commit * Update src/popup/pages/home.tsx Co-authored-by: Brian Douglas <[email protected]> * update copy Co-authored-by: Brian Douglas <[email protected]> * chore: lint format --------- Co-authored-by: Brian Douglas <[email protected]>
- Loading branch information
Showing
5 changed files
with
84 additions
and
35 deletions.
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
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,29 @@ | ||
import { useEffect, useState } from "react"; | ||
import { isGithubPullRequestPage, isGithubRepoPage } from "../utils/urlMatchers"; | ||
|
||
interface GitHubPageInfo { | ||
prUrl: string; | ||
prTitle: string; | ||
type: "unknown" | "PR" | "REPO"; | ||
} | ||
|
||
export const usGetGitHubPageInfo = () => { | ||
const [GithubPRPage, setGithubPRPage] = useState<GitHubPageInfo>({ prUrl: "", prTitle: "", type: "unknown" }); | ||
|
||
useEffect(() => { | ||
chrome.tabs.query({ active: true, currentWindow: true }, tabs => { | ||
if (tabs.length > 0) { | ||
const tab = tabs[0]; | ||
|
||
if (isGithubPullRequestPage(tab.url!)) { | ||
setGithubPRPage({ prUrl: tab.url!, prTitle: tab.title!.split("by")[0].trim(), type: "PR" }); | ||
} else if (isGithubRepoPage(tab.url!)) { | ||
setGithubPRPage({ prUrl: tab.url!, prTitle: "", type: "REPO" }); | ||
} | ||
} | ||
}); | ||
}, []); | ||
|
||
|
||
return GithubPRPage; | ||
}; |
This file was deleted.
Oops, something went wrong.
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
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