Skip to content

Commit

Permalink
Adjust sizing (#1589)
Browse files Browse the repository at this point in the history
## Summary:
* Make PhET widget smaller

<img width="1117" alt="Storybook editor page with a PhET widget that has approximately a 16:9 aspect ratio and that does not leave its bounding box" src="https://github.com/user-attachments/assets/f6299524-98eb-424b-861f-81c4050745da">

Issue: LEMS-2306

## Test plan:
* `yarn jest packages/perseus/src/widgets/phet-simulation/phet-simulation.test.ts`
* Verify that the widget seems to have an appropriate aspect ratio in Storybook

Author: aemandine

Reviewers: SonicScrewdriver, aemandine

Required Reviewers:

Approved By: SonicScrewdriver

Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald

Pull Request URL: #1589
  • Loading branch information
aemandine authored Sep 4, 2024
1 parent 7ef97de commit d569525
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/nasty-balloons-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

Make PhET widget smaller
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import Banner from "@khanacademy/wonder-blocks-banner";
import {View} from "@khanacademy/wonder-blocks-core";
import IconButton from "@khanacademy/wonder-blocks-icon-button";
import {spacing} from "@khanacademy/wonder-blocks-tokens";
import cornersOutIcon from "@phosphor-icons/core/regular/corners-out.svg";
import {StyleSheet} from "aphrodite";
import * as React from "react";
Expand Down Expand Up @@ -189,8 +190,7 @@ export class PhetSimulation extends React.Component<Props, State> {
title={this.props.description}
sandbox={sandboxProperties}
style={{
minWidth: 400,
height: 360,
height: 225,
width: "100%",
borderWidth: 0,
}}
Expand Down Expand Up @@ -234,9 +234,10 @@ const styles = StyleSheet.create({
borderRadius: borderRadiusLarge,
borderWidth: 1,
borderColor: basicBorderColor,
padding: phoneMargin,
padding: spacing.medium_16,
paddingBottom: 0,
width: 650,
// Include space for medium_16 padding on each side
width: 400 + spacing.xLarge_32,
},
});

Expand Down

0 comments on commit d569525

Please sign in to comment.