Skip to content

Commit c67363c

Browse files
committed
nav: add Lightning Terminal to the sidebar
1 parent 9eed507 commit c67363c

File tree

7 files changed

+74
-37
lines changed

7 files changed

+74
-37
lines changed

app/src/__tests__/components/history/HistoryPage.spec.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@ describe('HistoryPage', () => {
2121
expect(getByText('Loop History')).toBeInTheDocument();
2222
});
2323

24-
it('should display the back link', () => {
25-
const { getByText } = render();
26-
expect(getByText('Lightning Loop')).toBeInTheDocument();
27-
});
28-
29-
it('should display the back icon', () => {
30-
const { getByText } = render();
31-
expect(getByText('arrow-left.svg')).toBeInTheDocument();
32-
});
33-
3424
it('should display the export icon', () => {
3525
const { getByText } = render();
3626
expect(getByText('download.svg')).toBeInTheDocument();
@@ -45,12 +35,6 @@ describe('HistoryPage', () => {
4535
expect(getByText('Updated')).toBeInTheDocument();
4636
});
4737

48-
it('should navigate back to the Loop Page', () => {
49-
const { getByText } = render();
50-
fireEvent.click(getByText('arrow-left.svg'));
51-
expect(store.router.location.pathname).toBe('/loop');
52-
});
53-
5438
it('should export channels', () => {
5539
const { getByText } = render();
5640
fireEvent.click(getByText('download.svg'));

app/src/components/auth/AuthPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ const AuthPage: React.FC = () => {
8282
<Background gradient>
8383
<Wrapper>
8484
<Logo />
85-
<Title>{l('lightning')}</Title>
86-
<Title>{l('terminal')}</Title>
85+
<Title>{l('common.lightning')}</Title>
86+
<Title>{l('common.terminal')}</Title>
8787
<Subtitle>{l('subtitle')}</Subtitle>
8888
<Form onSubmit={handleSubmit}>
8989
<Input

app/src/components/common/PageHeader.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const Styled = {
1414
Left: styled.span<{ sidebar?: boolean }>`
1515
flex: 1;
1616
text-align: left;
17-
padding-left: ${props => (props.sidebar ? '0' : '40px')};
1817
`,
1918
Center: styled.span`
2019
flex: 1;

app/src/components/history/HistoryPage.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,12 @@ const Styled = {
1414

1515
const HistoryPage: React.FC = () => {
1616
const { l } = usePrefixedTranslation('cmps.history.HistoryPage');
17-
const { uiStore, swapStore } = useStore();
17+
const { swapStore } = useStore();
1818

1919
const { Wrapper } = Styled;
2020
return (
2121
<Wrapper>
22-
<PageHeader
23-
title={l('pageTitle')}
24-
backText={l('backText')}
25-
onBackClick={uiStore.goToLoop}
26-
onExportClick={swapStore.exportSwaps}
27-
/>
22+
<PageHeader title={l('pageTitle')} onExportClick={swapStore.exportSwaps} />
2823
<HistoryList />
2924
</Wrapper>
3025
);

app/src/components/layout/Brand.tsx

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import React from 'react';
2+
import { ReactComponent as LogoImage } from 'assets/images/logo.svg';
3+
import { usePrefixedTranslation } from 'hooks';
4+
import { styled } from 'components/theme';
5+
6+
const Styled = {
7+
Wrapper: styled.div`
8+
display: flex;
9+
align-items: center;
10+
`,
11+
Logo: styled(LogoImage)`
12+
color: ${props => props.theme.colors.offWhite};
13+
height: 35px;
14+
margin-left: 10px;
15+
margin-right: 5px;
16+
`,
17+
BrandName: styled.div`
18+
display: flex;
19+
flex-direction: column;
20+
text-align: center;
21+
22+
span:first-of-type {
23+
font-family: ${props => props.theme.fonts.open.regular};
24+
font-size: ${props => props.theme.sizes.xs};
25+
text-transform: uppercase;
26+
letter-spacing: 5px;
27+
}
28+
29+
span:last-of-type {
30+
font-family: ${props => props.theme.fonts.work.semiBold};
31+
font-size: ${props => props.theme.sizes.m};
32+
text-transform: uppercase;
33+
letter-spacing: 3px;
34+
}
35+
`,
36+
};
37+
38+
const Brand: React.FC = () => {
39+
const { l } = usePrefixedTranslation('common');
40+
41+
const { Wrapper, Logo, BrandName } = Styled;
42+
return (
43+
<Wrapper>
44+
<Logo />
45+
<BrandName>
46+
<span>{l('lightning')}</span>
47+
<span>{l('terminal')}</span>
48+
</BrandName>
49+
</Wrapper>
50+
);
51+
};
52+
53+
export default Brand;

app/src/components/layout/Layout.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { observer } from 'mobx-react-lite';
33
import { useStore } from 'store';
44
import { Background, Menu } from 'components/base';
55
import { styled } from 'components/theme';
6+
import Brand from './Brand';
67
import Sidebar from './Sidebar';
78

89
interface CollapsedProps {
@@ -17,13 +18,18 @@ const Styled = {
1718
width: 100%;
1819
margin: 0 auto;
1920
`,
20-
Hamburger: styled.span<CollapsedProps>`
21-
display: inline-block;
21+
Header: styled.div<CollapsedProps>`
22+
display: flex;
23+
align-items: center;
2224
position: ${props => (props.collapsed ? 'absolute' : 'fixed')};
2325
top: 35px;
2426
margin-left: 10px;
2527
z-index: 2;
2628
padding: 4px;
29+
`,
30+
Hamburger: styled.span`
31+
display: inline-block;
32+
height: 36px;
2733
2834
&:hover {
2935
color: ${props => props.theme.colors.blue};
@@ -64,16 +70,16 @@ const Styled = {
6470
export const Layout: React.FC = ({ children }) => {
6571
const { settingsStore } = useStore();
6672

67-
const { Container, Hamburger, Aside, Content } = Styled;
73+
const { Container, Header, Hamburger, Aside, Content } = Styled;
6874
return (
6975
<Background>
7076
<Container>
71-
<Hamburger
72-
collapsed={!settingsStore.sidebarVisible}
73-
onClick={settingsStore.toggleSidebar}
74-
>
75-
<Menu size="large" />
76-
</Hamburger>
77+
<Header collapsed={!settingsStore.sidebarVisible}>
78+
<Hamburger onClick={settingsStore.toggleSidebar}>
79+
<Menu size="large" />
80+
</Hamburger>
81+
<Brand />
82+
</Header>
7783
<Aside collapsed={!settingsStore.sidebarVisible}>
7884
<Sidebar />
7985
</Aside>

app/src/i18n/locales/en-US.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"common.loop": "Loop",
33
"common.loopIn": "Loop In",
44
"common.loopOut": "Loop Out",
5+
"common.lightning": "Lightning",
6+
"common.terminal": "Terminal",
57
"enums.BalanceMode.receive": "Receiving",
68
"enums.BalanceMode.send": "Sending",
79
"enums.BalanceMode.routing": "Routing",
8-
"cmps.auth.AuthPage.lightning": "Lightning",
9-
"cmps.auth.AuthPage.terminal": "Terminal",
1010
"cmps.auth.AuthPage.subtitle": "Efficiently manage Lightning node liquidity",
1111
"cmps.auth.AuthPage.passLabel": "Enter your password in the field above",
1212
"cmps.auth.AuthPage.submitBtn": "Submit",

0 commit comments

Comments
 (0)