Skip to content

Commit

Permalink
move constants file
Browse files Browse the repository at this point in the history
  • Loading branch information
handeyeco committed Oct 25, 2024
1 parent 9dd0f8c commit b60ddfa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions packages/perseus-editor/src/components/device-framer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
* A component that displays its contents inside a device frame.
*/

import {constants} from "@khanacademy/perseus";
import * as React from "react";

import {lintGutterWidth, perseusFrameBorderWidth} from "../styles/constants";

import type {DeviceType} from "@khanacademy/perseus";

const SCREEN_SIZES = {
Expand Down Expand Up @@ -71,8 +72,8 @@ const DeviceFramer = ({
overflow: "scroll",
width:
SCREEN_SIZES[deviceType].framedWidth +
2 * constants.perseusFrameBorderWidth +
constants.lintGutterWidth,
2 * perseusFrameBorderWidth +
lintGutterWidth,
}}
>
<div>{children}</div>
Expand Down
5 changes: 3 additions & 2 deletions packages/perseus-editor/src/components/viewport-resizer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
* A component that displays controls for choosing a viewport size.
* Renders three buttons: "Phone", "Tablet", and "Desktop".
*/
import {components, constants, icons} from "@khanacademy/perseus";
import {components, icons} from "@khanacademy/perseus";
import * as React from "react";

import {devices} from "../styles/constants";

import type {DeviceType} from "@khanacademy/perseus";

const {ButtonGroup, InlineIcon} = components;
const {devices} = constants;
const {iconDesktop, iconMobilePhone, iconTablet} = icons;

type Props = {
Expand Down
5 changes: 3 additions & 2 deletions packages/perseus-editor/src/content-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
import {MobileKeypad} from "@khanacademy/math-input";
import {
Renderer,
constants,
usePerseusI18n,
type APIOptions,
type DeviceType,
Expand All @@ -16,6 +15,8 @@ import {spacing} from "@khanacademy/wonder-blocks-tokens";
import {StyleSheet} from "aphrodite";
import * as React from "react";

import {lintGutterWidth} from "./styles/constants";

import type {LinterContextProps} from "@khanacademy/perseus-linter";

/**
Expand Down Expand Up @@ -85,7 +86,7 @@ const styles = StyleSheet.create({
containerType: "inline-size",
containerName: "perseus-root",
},
gutter: {marginRight: constants.lintGutterWidth},
gutter: {marginRight: lintGutterWidth},
});

export default ContentPreview;
1 change: 0 additions & 1 deletion packages/perseus/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export * as GrapherUtil from "./widgets/grapher/util";
* Misc
*/
export * as components from "./components";
export * as constants from "./components/constants";
// TODO(FEI-4504): Replace globalStyles with wonder-blocks where possible
export * as globalStyles from "./styles/global-styles";
// TODO(FEI-4504): Replace globalStyles with wonder-blocks where possible
Expand Down

0 comments on commit b60ddfa

Please sign in to comment.