Skip to content

Commit

Permalink
Interactive-SICP: Mobile bug fixes (#1805)
Browse files Browse the repository at this point in the history
* Left align text

* Set default scale for images

* Increase spacing between toc caret and label

* Update failing snapshots
  • Loading branch information
samuelfangjw committed Jun 18, 2021
1 parent 558f213 commit 2870d76
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/features/sicp/parser/ParseJson.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const handleImage = (obj: JsonType, refs: React.MutableRefObject<{}>) => {
<img
src={Constants.interactiveSicpDataUrl + obj['src']}
alt={obj['id']}
width={obj['scale']}
width={obj['scale'] || '100%'}
/>
);
} else if (obj['snippet']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ exports[`Parse figures FIGURE with image and scale successful 1`] = `
exports[`Parse figures FIGURE with image successful 1`] = `
"<div className=\\"sicp-figure\\">
<img src=\\"https://source-academy.github.io/sicp/sicp.png\\" alt=\\"id\\" width={[undefined]} />
<img src=\\"https://source-academy.github.io/sicp/sicp.png\\" alt=\\"id\\" width=\\"100%\\" />
<h5 className=\\"sicp-caption\\">
name
<span>
Expand Down
23 changes: 8 additions & 15 deletions src/styles/_sicp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ $sicp-background-color: #ffffff;

.Sicp {
width: 100%;
text-align: justify;
color: $sicp-text-color;
overflow: auto;
background-color: $sicp-background-color;
Expand Down Expand Up @@ -46,10 +45,6 @@ $sicp-background-color: #ffffff;
height: fit-content;
background-color: $sicp-background-color;

h1 {
text-align: left;
}

p {
display: inline;
}
Expand Down Expand Up @@ -204,23 +199,13 @@ $sicp-background-color: #ffffff;
}
}

// text container
.sicp-text {
text-align: justify;
}

.sicp-epigraph {
text-align: justify;
}

.sicp-attribution {
text-align: right;
}

.sicp-exercise {
margin: 10px 0;
padding: 10px;
text-align: justify;
background-color: $sicp-background-color !important;

.sicp-button-container {
Expand All @@ -242,6 +227,14 @@ $sicp-background-color: #ffffff;
overflow-y: auto;
text-align: left;

.bp3-tree-node-list {
padding: 0;
}

.bp3-tree-node-label {
padding-left: 7px;
}

.bp3-tree-node-caret {
color: #777777 !important;
scale: 1.25;
Expand Down

0 comments on commit 2870d76

Please sign in to comment.