-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(packages): add ledgerhq react-ui dependency
- Loading branch information
1 parent
b3d76e0
commit 2912ff8
Showing
13 changed files
with
698 additions
and
192 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {} | ||
|
||
module.exports = nextConfig | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
compiler: { | ||
styledComponents: true, | ||
}, | ||
}; | ||
|
||
module.exports = nextConfig; |
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
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
import { createGlobalStyle } from "styled-components"; | ||
|
||
export const GlobalStyle = createGlobalStyle` | ||
html, | ||
body, | ||
#__next { | ||
width: 100%; | ||
height: 100%; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
`; |
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,14 @@ | ||
import { CustomThemeProvider } from "@/providers/theme"; | ||
import { GlobalStyle } from "@/components/globalstyles"; | ||
import type { AppProps } from "next/app"; | ||
|
||
export default function App({ Component, pageProps }: AppProps) { | ||
return ( | ||
<> | ||
<CustomThemeProvider> | ||
<GlobalStyle /> | ||
<Component {...pageProps} /> | ||
</CustomThemeProvider> | ||
</> | ||
); | ||
} |
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,28 @@ | ||
import type { DocumentContext, DocumentInitialProps } from "next/document"; | ||
import Document from "next/document"; | ||
import { ServerStyleSheet } from "styled-components"; | ||
|
||
export default class MyDocument extends Document { | ||
static async getInitialProps( | ||
ctx: DocumentContext | ||
): Promise<DocumentInitialProps> { | ||
const sheet = new ServerStyleSheet(); | ||
const originalRenderPage = ctx.renderPage; | ||
|
||
try { | ||
ctx.renderPage = () => | ||
originalRenderPage({ | ||
enhanceApp: (App) => (props) => | ||
sheet.collectStyles(<App {...props} />), | ||
}); | ||
|
||
const initialProps = await Document.getInitialProps(ctx); | ||
return { | ||
...initialProps, | ||
styles: [initialProps.styles, sheet.getStyleElement()], | ||
}; | ||
} finally { | ||
sheet.seal(); | ||
} | ||
} | ||
} |
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,17 @@ | ||
"use client"; | ||
import React from "react"; | ||
import { Box } from "@ledgerhq/react-ui/index"; | ||
import styled from "styled-components"; | ||
|
||
const MainContainer = styled(Box)` | ||
width: 100%; | ||
height: 100%; | ||
background-color: ${({ theme }) => theme.colors.background.main}; | ||
color: ${({ theme }) => theme.colors.neutral.c90}; | ||
`; | ||
|
||
const Home: React.FC = () => { | ||
return <MainContainer>Test</MainContainer>; | ||
}; | ||
|
||
export default Home; |
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,27 @@ | ||
import React, { useMemo } from "react"; | ||
import { defaultTheme, palettes } from "@ledgerhq/react-ui/styles/index"; | ||
import { ThemeProvider } from "styled-components"; | ||
|
||
interface CustomThemeProviderProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
export const CustomThemeProvider: React.FC<CustomThemeProviderProps> = ({ | ||
children, | ||
}) => { | ||
const selectedPalettes: "dark" | "light" = "dark"; | ||
|
||
const theme = useMemo( | ||
() => ({ | ||
...defaultTheme, | ||
theme: selectedPalettes, | ||
colors: { | ||
...defaultTheme.colors, | ||
...palettes[selectedPalettes], | ||
}, | ||
}), | ||
[] | ||
); | ||
|
||
return <ThemeProvider theme={theme}>{children}</ThemeProvider>; | ||
}; |
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.