-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[interactive graph editor] Refactor sections (#1416)
## Summary: This puts the correct answer and locked figures into their own section so that its easier to get the right things on the screen. Uploading editor-2.mov… <img width="832" alt="Screenshot 2024-07-16 at 1 10 43 PM" src="https://github.com/user-attachments/assets/294d5440-9abf-4647-bec1-2c5f7bf7e8e9"> Issue: LEMS-2179 ## Test plan: - Open Storybook - Open a graph editor - **You should be able to collapse and expand sections for locked figures and the correct answer** Author: nicolecomputer Reviewers: mark-fitzgerald, catandthemachines, nishasy Required Reviewers: Approved By: mark-fitzgerald, catandthemachines, nishasy Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check builds for changes in size (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 for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald Pull Request URL: #1416
- Loading branch information
1 parent
8b128b5
commit daa3082
Showing
8 changed files
with
147 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@khanacademy/perseus-editor": minor | ||
--- | ||
|
||
Organizes the graph editor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
packages/perseus-editor/src/components/interactive-graph-correct-answer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import {View} from "@khanacademy/wonder-blocks-core"; | ||
import {spacing, color} from "@khanacademy/wonder-blocks-tokens"; | ||
import { | ||
BodyMonospace, | ||
LabelXSmall, | ||
} from "@khanacademy/wonder-blocks-typography"; | ||
import * as React from "react"; | ||
|
||
import Heading from "./heading"; | ||
|
||
type Props = { | ||
equationString: string; | ||
children: React.ReactNode; | ||
}; | ||
export function InteractiveGraphCorrectAnswer(props: Props) { | ||
return ( | ||
<> | ||
<Heading | ||
title="Correct Answer" | ||
isOpen={true} | ||
isCollapsible={false} | ||
/> | ||
<View> | ||
<View> | ||
<LabelXSmall | ||
style={{ | ||
paddingTop: spacing.xxSmall_6, | ||
paddingBottom: spacing.xxSmall_6, | ||
color: color.offBlack64, | ||
}} | ||
> | ||
Graph the correct answer in the graph below and ensure | ||
the equation or point coordinates displayed represent | ||
the correct answer. | ||
</LabelXSmall> | ||
|
||
<BodyMonospace | ||
style={{ | ||
fontSize: 12, | ||
backgroundColor: "#eee", | ||
paddingInline: spacing.xxSmall_6, | ||
borderColor: "#ccc", | ||
borderStyle: "solid", | ||
borderWidth: 1, | ||
}} | ||
> | ||
{props.equationString} | ||
</BodyMonospace> | ||
</View> | ||
{props.children} | ||
</View> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters