mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
feat: add empty Loop page with tests and stories
This commit is contained in:
parent
da9fdda5e2
commit
725609fbc2
7 changed files with 51 additions and 3 deletions
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import './App.scss';
|
||||
import { Store, StoreProvider } from 'store';
|
||||
import { Layout } from 'components/layout';
|
||||
import SamplePage from 'components/pages/SamplePage';
|
||||
import LoopPage from 'components/loop/LoopPage';
|
||||
import { ThemeProvider } from 'components/theme';
|
||||
|
||||
const App = () => {
|
||||
|
|
@ -11,7 +11,7 @@ const App = () => {
|
|||
<StoreProvider store={store}>
|
||||
<ThemeProvider>
|
||||
<Layout>
|
||||
<SamplePage />
|
||||
<LoopPage />
|
||||
</Layout>
|
||||
</ThemeProvider>
|
||||
</StoreProvider>
|
||||
|
|
|
|||
9
app/src/__stories__/LoopPage.stories.tsx
Normal file
9
app/src/__stories__/LoopPage.stories.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import React from 'react';
|
||||
import LoopPage from 'components/loop/LoopPage';
|
||||
|
||||
export default {
|
||||
title: 'Loop Page',
|
||||
component: LoopPage,
|
||||
};
|
||||
|
||||
export const Default = () => <LoopPage />;
|
||||
|
|
@ -4,6 +4,6 @@ import App from '../App';
|
|||
|
||||
it('renders the App', () => {
|
||||
const { getByText } = render(<App />);
|
||||
const linkElement = getByText('Node Info');
|
||||
const linkElement = getByText('Node Status');
|
||||
expect(linkElement).toBeInTheDocument();
|
||||
});
|
||||
|
|
|
|||
14
app/src/__tests__/components/loop/LoopPage.spec.tsx
Normal file
14
app/src/__tests__/components/loop/LoopPage.spec.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import React from 'react';
|
||||
import { renderWithProviders } from 'util/tests';
|
||||
import LoopPage from 'components/loop/LoopPage';
|
||||
|
||||
describe('LoopPage component', () => {
|
||||
const render = () => {
|
||||
return renderWithProviders(<LoopPage />);
|
||||
};
|
||||
|
||||
it('should display the page title', () => {
|
||||
const { getByText } = render();
|
||||
expect(getByText('Lightning Loop')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
|
@ -30,3 +30,12 @@ export const XLargeText = styled.span<BlockProps>`
|
|||
font-size: ${props => props.theme.sizes.xl};
|
||||
letter-spacing: 0.43px;
|
||||
`;
|
||||
|
||||
export const PageTitle = styled.h1`
|
||||
font-size: ${props => props.theme.sizes.l};
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2.7px;
|
||||
line-height: 30px;
|
||||
margin-top: 40px;
|
||||
`;
|
||||
|
|
|
|||
15
app/src/components/loop/LoopPage.tsx
Normal file
15
app/src/components/loop/LoopPage.tsx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import React from 'react';
|
||||
import usePrefixedTranslation from 'hooks/usePrefixedTranslation';
|
||||
import { PageTitle } from 'components/common/text';
|
||||
|
||||
const LoopPage: React.FC = () => {
|
||||
const { l } = usePrefixedTranslation('cmps.loop.LoopPage');
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageTitle>{l('pageTitle')}</PageTitle>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default LoopPage;
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"cmps.loop.LoopPage.pageTitle": "Lightning Loop",
|
||||
"App.nodeInfo": "Node Info",
|
||||
"App.pubkey": "Pubkey",
|
||||
"App.alias": "Alias",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue