File tree Expand file tree Collapse file tree 7 files changed +168
-343
lines changed Expand file tree Collapse file tree 7 files changed +168
-343
lines changed Original file line number Diff line number Diff line change
1
+ import type { AuthState } from '~/helpers/utils' ;
2
+
3
+ import { Button , type ButtonProps } from '@leather.io/ui' ;
4
+
5
+ const authStateCopyMap : Record < AuthState , string > = {
6
+ 'no-extension' : 'Install' ,
7
+ 'extension-pre-onboarding' : 'Sign up' ,
8
+ 'extension-user' : 'Account' ,
9
+ } ;
10
+
11
+ interface AuthButtonProps extends ButtonProps {
12
+ state : AuthState ;
13
+ }
14
+ export function AuthButton ( props : AuthButtonProps ) {
15
+ return (
16
+ < Button variant = "outline" { ...props } >
17
+ { authStateCopyMap [ props . state ] }
18
+ </ Button >
19
+ ) ;
20
+ }
Original file line number Diff line number Diff line change
1
+ import { type HTMLStyledProps , styled } from 'leather-styles/jsx' ;
2
+
3
+ export function HomeCard ( props : HTMLStyledProps < 'div' > ) {
4
+ return < styled . div borderRadius = "md" p = "space.04" { ...props } /> ;
5
+ }
6
+
7
+ export function HomeHeroCard ( props : HTMLStyledProps < 'div' > ) {
8
+ return (
9
+ < HomeCard background = "linear-gradient(261deg, #FFCAC7 28.46%, #FFC484 99.71%)" { ...props } />
10
+ ) ;
11
+ }
Original file line number Diff line number Diff line change @@ -3,18 +3,25 @@ import { leather } from '~/helpers/leather-sdk';
3
3
4
4
import { Button } from '@leather.io/ui' ;
5
5
6
+ import { HomeHeroCard } from './components/home-card' ;
7
+
6
8
interface HomeProps {
7
9
latestArticles : { name : string ; url : string } [ ] ;
8
10
}
9
11
export function Home ( { latestArticles } : HomeProps ) {
10
12
return (
11
13
< >
12
14
< styled . div p = "space.04" >
13
- < styled . h1 textStyle = "display.02" > Bitcoin for the rest of us</ styled . h1 >
14
- < styled . h2 textStyle = "heading.05" >
15
- Unlock yield opportunities without giving up control of your assets.
16
- </ styled . h2 >
17
- < styled . h2 textStyle = "heading.03" > Featured articles</ styled . h2 >
15
+ < HomeHeroCard >
16
+ < styled . h1 textStyle = "heading.03" > Earn rewards with BTC</ styled . h1 >
17
+ < styled . p textStyle = "label.02" mt = "space.03" >
18
+ Bridge BTC to sBTC to access DeFi, NFTs, and ~5% Bitcoin yield* while keeping full
19
+ liquidity and self-custody. Transfers adjust rewards dynamically.
20
+ </ styled . p >
21
+ < styled . button textStyle = "label.02" mt = "space.03" >
22
+ Get started →
23
+ </ styled . button >
24
+ </ HomeHeroCard >
18
25
< ul >
19
26
{ latestArticles . map ( article => (
20
27
< li key = { article . name } >
Original file line number Diff line number Diff line change
1
+ import { isDefined } from '@leather.io/utils' ;
2
+
1
3
export function getUiPackageAssetUrl ( path : string ) {
2
4
if ( import . meta. env . MODE === 'development' ) {
3
5
return 'node_modules/@leather.io/ui/dist-web/assets/' + path ;
4
6
}
5
7
return 'assets/' + path ;
6
8
}
9
+
10
+ export function isLeatherInstalled ( ) {
11
+ return isDefined ( window . LeatherProvider ) ;
12
+ }
13
+
14
+ export type AuthState = 'no-extension' | 'extension-pre-onboarding' | 'extension-user' ;
Original file line number Diff line number Diff line change 1
1
import { styled } from 'leather-styles/jsx' ;
2
+ import { AuthButton } from '~/components/auth-button' ;
2
3
3
4
import { NavItem } from './nav-item.layout' ;
4
5
5
6
export function Nav ( ) {
7
+ const allNavItems = false ;
8
+
6
9
return (
7
10
< styled . nav
8
11
display = "flex"
@@ -60,22 +63,27 @@ export function Nav() {
60
63
</ NavItem >
61
64
</ styled . div >
62
65
63
- < styled . div mt = "auto" mb = "space.09" >
64
- < NavItem href = "/blog" icon = "newspaper" >
65
- Blog
66
- </ NavItem >
66
+ { allNavItems && (
67
+ < styled . div mt = "auto" mb = "space.09" >
68
+ < NavItem href = "/blog" icon = "newspaper" >
69
+ Blog
70
+ </ NavItem >
67
71
68
- < NavItem href = "/guides" icon = "glasses" >
69
- Guides
70
- </ NavItem >
72
+ < NavItem href = "/guides" icon = "glasses" >
73
+ Guides
74
+ </ NavItem >
71
75
72
- < NavItem href = "/dev-docs" icon = "terminal" >
73
- Dev Docs
74
- </ NavItem >
76
+ < NavItem href = "/dev-docs" icon = "terminal" >
77
+ Dev Docs
78
+ </ NavItem >
75
79
76
- < NavItem href = "/support" icon = "support" >
77
- Support
78
- </ NavItem >
80
+ < NavItem href = "/support" icon = "support" >
81
+ Support
82
+ </ NavItem >
83
+ </ styled . div >
84
+ ) }
85
+ < styled . div mt = "auto" mb = "space.04" >
86
+ < AuthButton state = "extension-pre-onboarding" mx = "space.04" />
79
87
</ styled . div >
80
88
</ styled . nav >
81
89
) ;
Original file line number Diff line number Diff line change @@ -3,16 +3,6 @@ import { expect, test } from '@playwright/test';
3
3
test . describe ( 'Homepage' , ( ) => {
4
4
test ( 'has title' , async ( { page } ) => {
5
5
await page . goto ( '/' ) ;
6
- await expect ( page . getByRole ( 'heading' , { name : 'Bitcoin for the rest of us' } ) ) . toBeVisible ( ) ;
7
- } ) ;
8
-
9
- test ( 'get started link' , async ( { page } ) => {
10
- await page . goto ( '/' ) ;
11
-
12
- // Click the get started link.
13
- await page . getByRole ( 'link' , { name : 'Docs' } ) . click ( ) ;
14
-
15
- // Expects page to have a heading with the name of Installation.
16
- await expect ( page . getByRole ( 'heading' , { name : 'Leather web app' } ) ) . toBeVisible ( ) ;
6
+ await expect ( page . getByRole ( 'heading' , { name : 'Earn rewards with BTC' } ) ) . toBeVisible ( ) ;
17
7
} ) ;
18
8
} ) ;
You can’t perform that action at this time.
0 commit comments