Skip to content

Commit

Permalink
Merge pull request #159 from gnosis/formatting-improvements
Browse files Browse the repository at this point in the history
Resolves formatting issues mentioned in issue #136
  • Loading branch information
cedricwaxwing authored Jul 28, 2022
2 parents 7e36c9c + cf17ea3 commit a74cd87
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 18 deletions.
33 changes: 16 additions & 17 deletions packages/app/src/components/commons/Markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ReactMarkdown from "markdown-to-jsx"
import { List, ListItem, Typography } from "@mui/material"
import Link from "@mui/material/Link"
import { palette, typography } from "../../theme"
import { typography } from "../../theme"

const options = {
overrides: {
Expand Down Expand Up @@ -50,13 +50,26 @@ const options = {
props: { gutterBottom: true, paragraph: true },
},
a: { component: Link },
ol: {
component: List,
dense: true,
props: {
sx: {
mb: 2,
pl: 2,
"& li": {
listStyleType: "decimal"
}
},
},
},
ul: {
component: List,
dense: true,
props: {
sx: {
mb: 2,
pl: 0,
pl: 2,
},
},
},
Expand All @@ -65,27 +78,13 @@ const options = {
props: {
sx: {
display: "list-item",
listStylePosition: "inside",
listStylePosition: "outside",
listStyleType: "circle",
pl: 0,
py: "0.25rem",
},
},
},
pre: {
props: {
style: {
background: palette.grays[800],
borderRadius: 4,
color: palette.whites[1000],
fontFamily: typography.fontFamilies.monospace,
marginBottom: "1rem",
overflow: "auto",
paddingBottom: "1rem",
paddingTop: "1rem",
},
},
},
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const ArticleView: React.FC<ArticleViewProps> = ({ updateChainId }) => {
))}
</Grid>
)}
<Grid item my={5}>
<Grid item my={5} width="100%">
<Markdown>{articleToShow}</Markdown>
</Grid>

Expand Down
14 changes: 14 additions & 0 deletions packages/app/src/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,20 @@ let theme = createTheme({
em {
font-style: italic;
}
blockquote {
padding: 0 1rem;
border-left: 2px solid ${palette.grays[200]};
color: ${palette.grays[800]};
}
pre, :not(pre) > code {
background-color: ${palette.grays[800]};
border-radius: 4px;
color: ${palette.whites[1000]};
font-family: ${typography.fontFamilies.monospace};
margin-bottom: 1rem;
overflow: auto;
padding: 1rem;
}
`,
},
},
Expand Down

0 comments on commit a74cd87

Please sign in to comment.