From 862e7e2df11425643e7b5a7f1aad2758969f5c02 Mon Sep 17 00:00:00 2001 From: Peter Sanderson Date: Wed, 2 Oct 2024 16:54:05 +0200 Subject: [PATCH] fix: guide markown spacing --- .../src/components/Markdown/Markdown.tsx | 25 ++++----- packages/suite/src/components/guide/Guide.tsx | 54 ++++++++++--------- .../src/components/guide/GuideArticle.tsx | 11 +++- .../src/components/guide/GuideContent.tsx | 5 +- 4 files changed, 53 insertions(+), 42 deletions(-) diff --git a/packages/components/src/components/Markdown/Markdown.tsx b/packages/components/src/components/Markdown/Markdown.tsx index a5f5c6f7050..67cb605bd47 100644 --- a/packages/components/src/components/Markdown/Markdown.tsx +++ b/packages/components/src/components/Markdown/Markdown.tsx @@ -2,13 +2,12 @@ import styled from 'styled-components'; import ReactMarkdown, { Options } from 'react-markdown'; import { variables } from '../../config'; +import { typography } from '@trezor/theme'; const StyledMarkdown = styled.div` - color: ${({ theme }) => theme.legacy.TYPE_LIGHT_GREY}; - font-size: ${variables.FONT_SIZE.SMALL}; - font-weight: ${variables.FONT_WEIGHT.MEDIUM}; - line-height: 1.5; - padding: 0 0 32px; + ${typography.hint} + + color: ${({ theme }) => theme.textSubdued}; h1, h2, @@ -16,7 +15,7 @@ const StyledMarkdown = styled.div` h4, h5, h6 { - color: ${({ theme }) => theme.legacy.TYPE_DARK_GREY}; + color: ${({ theme }) => theme.textDefault}; font-weight: ${variables.FONT_WEIGHT.DEMI_BOLD}; } @@ -54,7 +53,7 @@ const StyledMarkdown = styled.div` } a { - color: ${({ theme }) => theme.legacy.TYPE_GREEN}; + color: ${({ theme }) => theme.textPrimaryDefault}; &:hover { text-decoration: underline; @@ -70,10 +69,8 @@ const StyledMarkdown = styled.div` } `; -export const Markdown = (options: Readonly) => { - return ( - - - - ); -}; +export const Markdown = (options: Readonly) => ( + + + +); diff --git a/packages/suite/src/components/guide/Guide.tsx b/packages/suite/src/components/guide/Guide.tsx index e4dc3ca01c3..3f128b3fbc2 100644 --- a/packages/suite/src/components/guide/Guide.tsx +++ b/packages/suite/src/components/guide/Guide.tsx @@ -12,13 +12,8 @@ import { GuideCategories, GuideSearch, } from 'src/components/guide'; -import { Icon } from '@trezor/components'; +import { Column, Divider, Icon } from '@trezor/components'; -const FeedbackBorder = styled.div` - height: 1px; - background-color: ${({ theme }) => theme.borderElevation1}; - margin: 0 ${spacingsPx.md}; -`; const FeedbackLinkWrapper = styled.div` padding: ${spacingsPx.md}; `; @@ -79,25 +74,34 @@ export const Guide = () => { return ( } /> - - - {!searchActive && } - - - - - - - - - - - - - + + + + {!searchActive && } + + +
+ + + + + + + + + + + + +
+
); }; diff --git a/packages/suite/src/components/guide/GuideArticle.tsx b/packages/suite/src/components/guide/GuideArticle.tsx index 2c187e3ce80..8b91eb2ba99 100644 --- a/packages/suite/src/components/guide/GuideArticle.tsx +++ b/packages/suite/src/components/guide/GuideArticle.tsx @@ -1,8 +1,15 @@ +import styled from 'styled-components'; + import { useSelector } from 'src/hooks/suite'; import { GuideHeader, GuideContent, GuideViewWrapper, GuideMarkdown } from 'src/components/guide'; import { Translation } from 'src/components/suite'; import { useGuideLoadArticle } from 'src/hooks/guide'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { spacingsPx } from '@trezor/theme'; + +const ArticleWrapper = styled.div` + padding-bottom: ${spacingsPx.xxl}; +`; export const GuideArticle = () => { const currentNode = useSelector(state => state.guide.currentNode); @@ -14,7 +21,9 @@ export const GuideArticle = () => { - + + + {hasError && } diff --git a/packages/suite/src/components/guide/GuideContent.tsx b/packages/suite/src/components/guide/GuideContent.tsx index df2791d057a..70794a3c5a2 100644 --- a/packages/suite/src/components/guide/GuideContent.tsx +++ b/packages/suite/src/components/guide/GuideContent.tsx @@ -1,9 +1,10 @@ import { ReactNode } from 'react'; import styled from 'styled-components'; +import { spacingsPx } from '@trezor/theme'; const Wrapper = styled.div` - height: 100%; - padding: 15px 21px 0; + padding: ${spacingsPx.md} ${spacingsPx.lg} 0; + flex: 1; `; type GuideContentProps = {