forked from getAlby/lightning-browser-extension
-
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.
Merge branch 'master' into getAlby#2573
- Loading branch information
Showing
37 changed files
with
746 additions
and
470 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { CaretRightIcon } from "@bitcoin-design/bitcoin-icons-react/outline"; | ||
|
||
export type IconLinkCardProps = { | ||
title: string; | ||
description: string; | ||
icon: React.ReactNode; | ||
onClick: () => void; | ||
}; | ||
|
||
export function IconLinkCard({ | ||
icon, | ||
title, | ||
description, | ||
onClick, | ||
}: IconLinkCardProps) { | ||
return ( | ||
<div | ||
className="shadow rounded-md p-4 bg-white dark:bg-surface-01dp hover:bg-gray-50 dark:hover:bg-surface-02dp text-gray-800 dark:text-neutral-200 cursor-pointer flex flex-row items-center gap-3" | ||
onClick={onClick} | ||
> | ||
<div className="flex-shrink-0 flex justify-center md:px-3">{icon}</div> | ||
<div className="flex-grow"> | ||
<div className="font-medium leading-5 text-sm md:text-base"> | ||
{title} | ||
</div> | ||
<div className="text-gray-600 dark:text-neutral-400 text-xs leading-4 md:text-sm"> | ||
{description} | ||
</div> | ||
</div> | ||
<div className="flex-shrink-0 flex justify-end "> | ||
<CaretRightIcon className="w-8" /> | ||
</div> | ||
</div> | ||
); | ||
} |
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,25 @@ | ||
import ReactQRCode from "react-qr-code"; | ||
import { classNames, useTheme } from "~/app/utils"; | ||
|
||
export type Props = { | ||
value: string; | ||
size?: number; | ||
className?: string; | ||
}; | ||
|
||
export default function QRCode({ value, size, className }: Props) { | ||
const theme = useTheme(); | ||
const fgColor = theme === "dark" ? "#FFFFFF" : "#000000"; | ||
const bgColor = theme === "dark" ? "#000000" : "#FFFFFF"; | ||
|
||
return ( | ||
<ReactQRCode | ||
value={value} | ||
size={size} | ||
className={classNames("rounded-md", className ?? "")} | ||
fgColor={fgColor} | ||
bgColor={bgColor} | ||
level="M" | ||
/> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { useEffect, useState } from "react"; | ||
import { useAccount } from "~/app/context/AccountContext"; | ||
import api from "~/common/lib/api"; | ||
|
||
export const useLightningAddress = () => { | ||
const { account } = useAccount(); | ||
const [lightningAddress, setLightningAddress] = useState(""); | ||
const [loadingLightningAddress, setLoadingLightningAddress] = useState(false); | ||
|
||
useEffect(() => { | ||
// TODO: replace with connector-supported functionality | ||
if (account?.connectorType !== "alby") { | ||
setLightningAddress(""); | ||
setLoadingLightningAddress(false); | ||
return; | ||
} | ||
(async () => { | ||
setLoadingLightningAddress(true); | ||
const response = await api.getAccountInfo(); | ||
const lightningAddress = response.info.lightning_address; | ||
if (lightningAddress) setLightningAddress(lightningAddress); | ||
setLoadingLightningAddress(false); | ||
})(); | ||
}, [account?.connectorType]); | ||
|
||
return { | ||
loadingLightningAddress, | ||
lightningAddress, | ||
}; | ||
}; |
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,19 @@ | ||
import { SVGProps } from "react"; | ||
|
||
const RedeemIcon = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
width="27" | ||
height="27" | ||
viewBox="0 0 27 27" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<path | ||
d="M4.6909 6.29089H5.26233H4.6909ZM6.83947 4.14232V4.71375V4.14232ZM6.83947 25.8566V25.2852V25.8566ZM4.6909 23.708H4.11947H4.6909ZM21.8795 23.708H22.4509H21.8795ZM19.7309 25.8566V26.428V25.8566ZM21.8795 6.29089H21.308H21.8795ZM19.7309 4.14232V3.57089V4.14232ZM12.7068 19.5709C12.7068 19.8865 12.9627 20.1423 13.2783 20.1423C13.5939 20.1423 13.8497 19.8865 13.8497 19.5709H12.7068ZM13.8497 9.8566C13.8497 9.54101 13.5939 9.28518 13.2783 9.28518C12.9627 9.28518 12.7068 9.54101 12.7068 9.8566H13.8497ZM17.499 17.2935C17.7247 17.073 17.7289 16.7112 17.5084 16.4854C17.2878 16.2597 16.926 16.2555 16.7003 16.476L17.499 17.2935ZM13.2781 20.6183L12.8788 21.027C13.1008 21.2439 13.4554 21.2439 13.6774 21.027L13.2781 20.6183ZM9.85592 16.476C9.63017 16.2555 9.26839 16.2597 9.04785 16.4854C8.8273 16.7112 8.83152 17.073 9.05726 17.2935L9.85592 16.476ZM25.8566 2.86232H25.2852H25.8566ZM25.8566 6.56518H26.428H25.8566ZM0.71373 6.56518H0.142301H0.71373ZM0.71373 2.86232H1.28516H0.71373ZM2.8623 0.713745V1.28517V0.713745ZM23.708 0.713746V0.142317V0.713746ZM2.8623 8.71375L2.8623 9.28518H2.8623V8.71375ZM23.708 8.71375V8.14232V8.71375ZM21.308 6.29089V23.708H22.4509V6.29089H21.308ZM19.7309 25.2852L6.83947 25.2852V26.428L19.7309 26.428V25.2852ZM5.26232 23.708L5.26233 6.29089H4.11947L4.11947 23.708H5.26232ZM6.83947 4.71375L19.7309 4.71375V3.57089L6.83947 3.57089V4.71375ZM5.26233 6.29089C5.26233 5.41986 5.96844 4.71375 6.83947 4.71375V3.57089C5.33725 3.57089 4.11947 4.78867 4.11947 6.29089H5.26233ZM6.83947 25.2852C5.96843 25.2852 5.26232 24.5791 5.26232 23.708H4.11947C4.11947 25.2102 5.33725 26.428 6.83947 26.428V25.2852ZM21.308 23.708C21.308 24.5791 20.6019 25.2852 19.7309 25.2852V26.428C21.2331 26.428 22.4509 25.2102 22.4509 23.708H21.308ZM22.4509 6.29089C22.4509 4.78868 21.2331 3.57089 19.7309 3.57089V4.71375C20.6019 4.71375 21.308 5.41986 21.308 6.29089H22.4509ZM13.8497 19.5709V9.8566H12.7068V19.5709H13.8497ZM16.7003 16.476L12.8788 20.2095L13.6774 21.027L17.499 17.2935L16.7003 16.476ZM13.6774 20.2095L9.85592 16.476L9.05726 17.2935L12.8788 21.027L13.6774 20.2095ZM25.2852 2.86232V6.56518H26.428V2.86232H25.2852ZM1.28516 6.56518L1.28516 2.86232H0.142302L0.142301 6.56518H1.28516ZM2.8623 1.28517L23.708 1.28517V0.142317L2.8623 0.142317V1.28517ZM4.6909 8.14232H2.8623V9.28518H4.6909V8.14232ZM23.708 8.14232H21.8795V9.28518H23.708V8.14232ZM1.28516 2.86232C1.28516 1.99128 1.99127 1.28517 2.8623 1.28517V0.142317C1.36009 0.142316 0.142302 1.3601 0.142302 2.86232H1.28516ZM0.142301 6.56518C0.142301 8.06739 1.36009 9.28517 2.8623 9.28518L2.8623 8.14232C1.99127 8.14232 1.28516 7.43621 1.28516 6.56518H0.142301ZM25.2852 6.56518C25.2852 7.43621 24.5791 8.14232 23.708 8.14232V9.28518C25.2102 9.28518 26.428 8.06739 26.428 6.56518H25.2852ZM26.428 2.86232C26.428 1.3601 25.2102 0.142317 23.708 0.142317V1.28517C24.579 1.28517 25.2852 1.99129 25.2852 2.86232H26.428Z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
); | ||
|
||
export default RedeemIcon; |
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
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
Oops, something went wrong.