Skip to content

Commit

Permalink
docs: fix json cycle on default theme printer
Browse files Browse the repository at this point in the history
refs:  (#114)
  • Loading branch information
beawar authored Aug 24, 2022
1 parent 546fe00 commit 380983e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/components/ThemePrinter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import React, { useContext } from 'react';
import styled, { DefaultTheme } from 'styled-components';
import styled from 'styled-components';
import { ThemeObj } from '../../src/theme/theme';
import { ThemeContext } from '../../src/theme/theme-context-provider';

const Pre = styled.pre`
color: ${({ theme }): string => theme.palette.text.regular};
`;

export default function ThemePrinter(): JSX.Element {
const theme = useContext<DefaultTheme>(ThemeContext);
const { windowObj, ...theme } = useContext<ThemeObj>(ThemeContext);

return <Pre>{JSON.stringify(theme, null, 2)}</Pre>;
}

0 comments on commit 380983e

Please sign in to comment.