-
Notifications
You must be signed in to change notification settings - Fork 350
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] Moving around/renaming components (#1379)
## Summary: When working on the "Start coordinates" UI (requirement for Hint Mode), I will need to use the `LockedFiguresSettingsAccordion` and `CoordinatePairInput`. To make these more intuitive to use, I renamed `LockedFiguresSettingsAccordion` to `PerseusEditorAccordion` (since it's not only used for locked figures anymore), and I also moved `CoordinatePairInput` out of the `locked-figures` directory. I also moved `Heading` into its own component, since I'd like to reuse it outside the `interactive-graph-settings.tsx` file. Issue: https://khanacademy.atlassian.net/browse/LEMS-2052 ## Test plan: `yarn jest` `yarn typecheck` Author: nishasy Reviewers: mark-fitzgerald Required Reviewers: Approved By: mark-fitzgerald Checks: ✅ gerald, ✅ Upload Coverage (ubuntu-latest, 20.x), ⏭️ Publish npm snapshot, ✅ 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), ✅ Check builds for changes in size (ubuntu-latest, 20.x), 🚫 Upload Coverage, ✅ gerald, ⏭️ Publish npm snapshot, 🚫 Check builds for changes in size (ubuntu-latest, 20.x), 🚫 Cypress (ubuntu-latest, 20.x), 🚫 Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), 🚫 Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), 🚫 Jest Coverage (ubuntu-latest, 20.x), ✅ gerald Pull Request URL: #1379
- Loading branch information
Showing
13 changed files
with
86 additions
and
67 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,6 @@ | ||
--- | ||
"@khanacademy/perseus": patch | ||
"@khanacademy/perseus-editor": patch | ||
--- | ||
|
||
[Interactive Graph Editor] Moving around/renaming components so they make more sense for the upcoming hint mode work |
File renamed without changes.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import {View} from "@khanacademy/wonder-blocks-core"; | ||
import {color, spacing} from "@khanacademy/wonder-blocks-tokens"; | ||
import {LabelSmall} from "@khanacademy/wonder-blocks-typography"; | ||
import * as React from "react"; | ||
|
||
import ToggleableCaret from "./toggleable-caret"; | ||
|
||
function Heading({ | ||
title, | ||
isOpen, | ||
onToggle, | ||
}: { | ||
title: string; | ||
isOpen: boolean; | ||
onToggle?: (isOpen: boolean) => void; | ||
}) { | ||
return ( | ||
<View | ||
style={{ | ||
flexDirection: "row", | ||
justifyContent: "space-between", | ||
backgroundColor: color.offBlack8, | ||
padding: spacing.xSmall_8, | ||
marginTop: spacing.small_12, | ||
// NOTE(jeremy): This is the inverse of the @editorPadding CSS | ||
// variable found in perseus-editor.less. For now, it must | ||
// match otherwise there's a gap from this header to the edge | ||
// of the editor borders. | ||
marginInline: -10, | ||
cursor: "pointer", | ||
}} | ||
onClick={() => onToggle?.(!isOpen)} | ||
> | ||
<LabelSmall>{title}</LabelSmall> | ||
<ToggleableCaret isExpanded={isOpen} /> | ||
</View> | ||
); | ||
} | ||
|
||
export default Heading; |
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