forked from all-in-aigc/gpts-works
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
154 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"name": "gpts-works", | ||
"displayName": "GPTs Works", | ||
"version": "1.0.2", | ||
"description": "This extension is used to show Third-party GPTs in ChatGPT explore page.", | ||
"version": "1.0.3", | ||
"description": "Third-party GPTs store shows on browser sidebar.", | ||
"author": "idoubi<[email protected]>", | ||
"scripts": { | ||
"dev": "plasmo dev", | ||
|
@@ -13,7 +13,8 @@ | |
"@plasmohq/messaging": "^0.6.0", | ||
"plasmo": "0.84.0", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0" | ||
"react-dom": "18.2.0", | ||
"react-lazy-load-image-component": "^1.6.0" | ||
}, | ||
"devDependencies": { | ||
"@ianvs/prettier-plugin-sort-imports": "4.1.1", | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { sendToContentScript } from "@plasmohq/messaging" | ||
|
||
export {} | ||
|
||
console.log( | ||
"Live now; make now always the most precious time. Now will never come again." | ||
) | ||
|
||
chrome.action.onClicked.addListener((tab) => { | ||
console.log("tab clicked", tab) | ||
if (tab.id) { | ||
sendToContentScript({ | ||
name: "showSidebar", | ||
body: {} | ||
}) | ||
} | ||
}) |
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 |
---|---|---|
@@ -1,43 +1,53 @@ | ||
import { LazyLoadImage } from "react-lazy-load-image-component" | ||
|
||
import type { Gpts } from "~types/gpts" | ||
|
||
interface Props { | ||
gpts: Gpts[] | ||
loading: boolean | ||
} | ||
|
||
export default ({ gpts }: Props) => { | ||
export default ({ gpts, loading }: Props) => { | ||
return ( | ||
<ul className="menu overflow-auto text-base-content"> | ||
{gpts.length > 0 && | ||
gpts.map((item: Gpts, idx: number) => { | ||
return ( | ||
<> | ||
{item.avatar_url && item.author_name && ( | ||
<li key={idx} className="max-w-[480px] overflow-hidden"> | ||
<> | ||
{loading ? ( | ||
<div className="text-center mx-auto">loading...</div> | ||
) : ( | ||
<ul className="menu text-base-content"> | ||
{gpts.length > 0 && | ||
gpts.map((item: Gpts, idx: number) => { | ||
if (!item.name || !item.avatar_url || !item.author_name) { | ||
return | ||
} | ||
|
||
return ( | ||
<li key={idx} className="w-[360px] overflow-hidden"> | ||
<a | ||
href={item.visit_url} | ||
className="flex items-center rounded-none border-t border-gray-100 px-2 py-4 hover:bg-gray-100 dark:border-gray-700 dark:hover:bg-transparent"> | ||
<img | ||
src={item.avatar_url} | ||
className="h-10 w-10 rounded-full" | ||
alt="GPT" | ||
/> | ||
<div className="max-w-[200px] flex-1 ml-2 mr-24"> | ||
<h3 className="text-md font-semibold truncate"> | ||
{item.name} | ||
</h3> | ||
<p className="text-sm line-clamp-2 truncate"> | ||
{item.description} | ||
</p> | ||
</div> | ||
<div className="text-sm text-token-text-tertiary text-left truncate"> | ||
By {item.author_name || "-"} | ||
className="rounded-none border-t border-gray-100 px-4 py-4 hover:bg-gray-100"> | ||
<div className="flex items-start"> | ||
<LazyLoadImage | ||
src={item.avatar_url} | ||
alt="" | ||
className="mr-2 inline-block h-10 w-10 object-cover rounded-full" | ||
/> | ||
|
||
<div className="flex-1"> | ||
<h3 className="text-sm font-semibold max-w-[200px] truncate"> | ||
{item.name} | ||
</h3> | ||
<p className="my-1 text-xs truncate"> | ||
by {item.author_name || "-"} | ||
</p> | ||
<p className="text-xs">{item.description}</p> | ||
</div> | ||
</div> | ||
</a> | ||
</li> | ||
)} | ||
</> | ||
) | ||
})} | ||
</ul> | ||
) | ||
})} | ||
</ul> | ||
)} | ||
</> | ||
) | ||
} |
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.