Skip to content

Commit

Permalink
Fix figure margins
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelfangjw committed Jun 16, 2021
1 parent f0ada7b commit 70f2be2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/features/sicp/parser/ParseJson.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const handleFigure = (obj: JsonType, refs: React.MutableRefObject<{}>) => (
<div ref={ref => (refs.current[obj['id']!] = ref)} className="sicp-figure">
{handleImage(obj, refs)}
{obj['captionName'] && (
<h5>
<h5 className="sicp-caption">
{obj['captionName']}
{parseArr(obj['captionBody']!, refs)}
</h5>
Expand All @@ -127,7 +127,7 @@ const handleFigure = (obj: JsonType, refs: React.MutableRefObject<{}>) => (
const handleImage = (obj: JsonType, refs: React.MutableRefObject<{}>) => {
if (obj['src']) {
return (
<div className={'sicp-figure'}>
<div>
{obj['src'] && (
<img
src={Constants.interactiveSicpUrl + obj['src']}
Expand Down
8 changes: 6 additions & 2 deletions src/styles/_sicp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,12 @@ $sicp-background-color: #ffffff;
}

.sicp-figure {
margin: auto;
text-align: center;
margin: 45px auto 25px auto;

> .sicp-caption {
margin: 15px auto;
text-align: center;
}
}

// text container
Expand Down

0 comments on commit 70f2be2

Please sign in to comment.