-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #490 from umarrg/website-screen
feat: websites where you can use alby
- Loading branch information
Showing
7 changed files
with
233 additions
and
62 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import { useState, useEffect } from "react"; | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
import Container from "@components/Container"; | ||
import PublishersTable from "@components/PublishersTable"; | ||
|
||
import { Allowance } from "~/types"; | ||
import utils from "~/common/lib/utils"; | ||
import websites from "./websites.json"; | ||
|
||
function Publishers() { | ||
const [data, setData] = useState<Allowance[]>([]); | ||
const navigate = useNavigate(); | ||
|
||
function navigateToPublisher(id: string) { | ||
navigate(`/publishers/${id}`); | ||
} | ||
|
||
async function fetchData() { | ||
try { | ||
const response = await utils.call<{ | ||
allowances: Allowance[]; | ||
}>("listAllowances"); | ||
const allowances = response.allowances.map((allowance) => { | ||
if (allowance.enabled && allowance.remainingBudget > 0) { | ||
return { | ||
...allowance, | ||
badge: { | ||
label: "ACTIVE", | ||
color: "green-bitcoin", | ||
textColor: "white", | ||
}, | ||
}; | ||
} | ||
return allowance; | ||
}); | ||
setData(allowances); | ||
} catch (e) { | ||
console.error(e); | ||
} | ||
} | ||
|
||
useEffect(() => { | ||
fetchData(); | ||
}, []); | ||
|
||
return ( | ||
<Container> | ||
<h2 className="mt-12 mb-2 text-2xl font-bold dark:text-white"> | ||
Your ⚡️ Websites | ||
</h2> | ||
<p className="mb-6 text-gray-500"> | ||
Websites where you have used Alby before | ||
</p> | ||
{data.length > 0 ? ( | ||
<PublishersTable | ||
publishers={data} | ||
navigateToPublisher={navigateToPublisher} | ||
/> | ||
) : ( | ||
<p>No websites yet.</p> | ||
)} | ||
<h2 className="mt-12 mb-2 text-2xl font-bold dark:text-white"> | ||
Other ⚡️ Websites | ||
</h2> | ||
<p className="mb-6 text-gray-500">Websites where you can use Alby</p> | ||
<div className="mb-12"> | ||
{websites.map(({ title, items }) => ( | ||
<div className="mb-6" key={title}> | ||
<h4 className="mb-4 text-xl font-bold">{title}</h4> | ||
<div className="grid gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"> | ||
{items.map(({ title, subtitle, logo, url }) => ( | ||
<a key={url} href={url} target="_blank" rel="noreferrer"> | ||
<div className="bg-white shadow-md flex p-4 h-32 rounded-lg hover:bg-gray-50 cursor-pointer w-full"> | ||
<div className="flex space-x-3"> | ||
<img | ||
src={logo} | ||
alt="image" | ||
className="h-14 w-14 rounded-xl shadow-md object-cover" | ||
/> | ||
<div> | ||
<h2 className="font-medium font-serif text-base"> | ||
{title} | ||
</h2> | ||
<p className="font-serif text-sm font-normal text-gray-500 line-clamp-3"> | ||
{subtitle} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</a> | ||
))} | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
</Container> | ||
); | ||
} | ||
|
||
export default Publishers; |
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,123 @@ | ||
[ | ||
{ | ||
"title": "Trading", | ||
"items": [ | ||
{ | ||
"title": "LNMarkets", | ||
"subtitle": "Instant Bitcoin derivatives trading", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/lnmarketes.svg", | ||
"url": "https://lnmarkets.com/" | ||
}, | ||
{ | ||
"title": "Kollider", | ||
"subtitle": "Instant Bitcoin derivatives trading", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/kollider_thumbnail.svg", | ||
"url": "https://kollider.xyz/" | ||
}, | ||
{ | ||
"title": "LOFT", | ||
"subtitle": "Trade investment products in Bitcoin", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/loft-trade_thumbnail.svg", | ||
"url": "https://loft.trade/" | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "Gaming", | ||
"items": [ | ||
{ | ||
"title": "LNGames", | ||
"subtitle": "Simple Lightning Network games", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/lngames_thumbnail.svg", | ||
"url": "https://lngames.net/" | ||
}, | ||
{ | ||
"title": "Lightning Poker", | ||
"subtitle": "Play Poker with Bitcoin", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/lightning-poker_thumbnail.svg", | ||
"url": "https://lightning-poker.com/" | ||
}, | ||
{ | ||
"title": "LNBlackJack", | ||
"subtitle": "Play Blackjack with Bitcoin", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/lnblackjack_thumbnail.svg", | ||
"url": "https://www.lnblackjack.com/" | ||
}, | ||
{ | ||
"title": "Lightning Roulette", | ||
"subtitle": "Play Roulette with Bitcoin", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/lightning-roulette_thumbnail.svg", | ||
"url": "https://lightning-roulette.com/" | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "Entertaiment", | ||
"items": [ | ||
{ | ||
"title": "Stacker.News", | ||
"subtitle": "Lightning powered Bitcoin news site", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/stacker-news_thumbnail.svg", | ||
"url": "https://stacker.news/" | ||
}, | ||
{ | ||
"title": "Wavlake", | ||
"subtitle": "Lightning powered music player", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/wavlake.svg", | ||
"url": "https://www.wavlake.com/" | ||
}, | ||
{ | ||
"title": "Y'alls", | ||
"subtitle": "Articles about the Lightning Network", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/yalls.svg", | ||
"url": "https://yalls.org/" | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "Shopping", | ||
"items": [ | ||
{ | ||
"title": "Bitrefill", | ||
"subtitle": "Buy vouchers, refill your phone or pay your bills", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/bitrefill_thumbnail.svg", | ||
"url": "https://www.bitrefill.com/?hl=en" | ||
}, | ||
{ | ||
"title": "Lightning Network Stores", | ||
"subtitle": "Collection of stores and websites accepting Bitcoin payments", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/lightning-network-stores_thumbnail.svg", | ||
"url": "https://lightningnetworkstores.com/" | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "Miscellaneous", | ||
"items": [ | ||
{ | ||
"title": "WebLN Experiments", | ||
"subtitle": "A collection of Lightning web apps", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/twentyuno.svg", | ||
"url": "https://webln.twentyuno.net/" | ||
}, | ||
{ | ||
"title": "Sparkshot", | ||
"subtitle": "Art created and funded by the community", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/sparkshot_thumbnail.svg", | ||
"url": "https://sparkshot.io/" | ||
}, | ||
{ | ||
"title": "Sats for Likes", | ||
"subtitle": "Earn sats for accomplishing tasks", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/sats4likes.svg", | ||
"url": "https://kriptode.com/satsforlikes/index.html" | ||
}, | ||
{ | ||
"title": "Amboss Space", | ||
"subtitle": "Lightning Network node explorer", | ||
"logo": "https://cdn.getalby-assets.com/alby-extension-website-screen/amboss-space_thumbnail.svg", | ||
"url": "https://amboss.space/" | ||
} | ||
] | ||
} | ||
] |
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