diff --git a/components/Editor/EditorControls.tsx b/components/Editor/EditorControls.tsx index 1b5fdee..8d15b9b 100644 --- a/components/Editor/EditorControls.tsx +++ b/components/Editor/EditorControls.tsx @@ -1,12 +1,13 @@ import { useRef } from 'react' import { RiLinksLine, RiQuestionLine } from '@remixicon/react' -import cn from 'classnames' import { Priority, useRegisterActions } from 'kbar' import { OnChangeValue } from 'react-select' import { Button, Input } from 'components/ui' +import { cn } from '../../util/styles' + import ExampleSelector from './ExampleSelector' type SelectOption = { diff --git a/components/Editor/EditorFooter.tsx b/components/Editor/EditorFooter.tsx index 2901109..39bdd32 100644 --- a/components/Editor/EditorFooter.tsx +++ b/components/Editor/EditorFooter.tsx @@ -1,9 +1,8 @@ import { useContext } from 'react' -import cn from 'classnames' - import { AppUiContext } from '../../context/appUiContext' import { CairoVMApiContext } from '../../context/cairoVMApiContext' +import { cn } from '../../util/styles' import KBarButton from '../KBar/Button' import ThemeSelector from '../ThemeSelector' import ToggleFullScreen from '../ToggleFullScreen' diff --git a/components/Editor/ExampleSelector.tsx b/components/Editor/ExampleSelector.tsx index be44bca..9d381d3 100644 --- a/components/Editor/ExampleSelector.tsx +++ b/components/Editor/ExampleSelector.tsx @@ -1,17 +1,17 @@ -import React, { useId } from 'react' +import { useId } from 'react' import { RiFileCodeLine } from '@remixicon/react' -import cn from 'classnames' import Select, { components, DropdownIndicatorProps, - StylesConfig, GroupBase, + StylesConfig, } from 'react-select' +import { cn } from '../../util/styles' import { Button } from '../ui' -import { Examples, CairoExampleNames } from './examples' +import { CairoExampleNames, Examples } from './examples' type SelectOption = { value: number diff --git a/components/Editor/ExtraColumn.tsx b/components/Editor/ExtraColumn.tsx index f36a355..bb02da4 100644 --- a/components/Editor/ExtraColumn.tsx +++ b/components/Editor/ExtraColumn.tsx @@ -1,11 +1,11 @@ import { useContext, useState } from 'react' import { Editor as MonacoEditor, Monaco } from '@monaco-editor/react' -import cn from 'classnames' import { editor } from 'monaco-editor' import { CodeType } from '../../context/appUiContext' import { CairoVMApiContext } from '../../context/cairoVMApiContext' +import { cn } from '../../util/styles' import Header from './Header' import { InstructionsTable } from './InstructionsTable' diff --git a/components/Editor/InstructionRow.tsx b/components/Editor/InstructionRow.tsx index 02c6991..3492e6f 100644 --- a/components/Editor/InstructionRow.tsx +++ b/components/Editor/InstructionRow.tsx @@ -1,8 +1,7 @@ -import { useState, forwardRef, ForwardedRef, useCallback } from 'react' - -import cn from 'classnames' +import { ForwardedRef, forwardRef, useCallback, useState } from 'react' import { toHex } from '../../util/string' +import { cn } from '../../util/styles' type RowProps = { instructionId: number diff --git a/components/Editor/InstructionsTable.tsx b/components/Editor/InstructionsTable.tsx index 103bc72..e1fcee1 100644 --- a/components/Editor/InstructionsTable.tsx +++ b/components/Editor/InstructionsTable.tsx @@ -1,6 +1,5 @@ import React, { memo, useCallback, useEffect, useRef } from 'react' -import cn from 'classnames' import ReactTooltip from 'react-tooltip' import { TableVirtuoso, TableVirtuosoHandle } from 'react-virtuoso' import { IInstruction } from 'types' @@ -9,6 +8,8 @@ import { CodeType } from 'context/appUiContext' import { SierraVariables } from 'components/Tracer' +import { cn } from '../../util/styles' + const sierraVariableRe = /\[(\d+)\]/ export const InstructionsTable = ({ diff --git a/components/Editor/index.tsx b/components/Editor/index.tsx index 89be2ef..64b8353 100644 --- a/components/Editor/index.tsx +++ b/components/Editor/index.tsx @@ -1,4 +1,4 @@ -import React, { +import { useCallback, useContext, useEffect, @@ -8,8 +8,7 @@ import React, { } from 'react' import { decode, encode } from '@kunigi/string-compression' -import { Editor as MonacoEditor, useMonaco, Monaco } from '@monaco-editor/react' -import cn from 'classnames' +import { Editor as MonacoEditor, Monaco, useMonaco } from '@monaco-editor/react' import copy from 'copy-to-clipboard' import { Priority, useRegisterActions } from 'kbar' import { editor } from 'monaco-editor' @@ -31,6 +30,7 @@ import { Examples } from 'components/Editor/examples' import { Tracer } from 'components/Tracer' import { AppUiContext, CodeType, LogType } from '../../context/appUiContext' +import { cn } from '../../util/styles' import { ArgumentsHelperModal } from './ArgumentsHelperModal' import { registerCairoLanguageSupport } from './cairoLangConfig' diff --git a/components/KBar/ResultItem.tsx b/components/KBar/ResultItem.tsx index 3a1d31e..daa6527 100644 --- a/components/KBar/ResultItem.tsx +++ b/components/KBar/ResultItem.tsx @@ -1,8 +1,9 @@ import { forwardRef } from 'react' -import cn from 'classnames' import { Action } from 'kbar' +import { cn } from '../../util/styles' + type Props = { action: Action active: boolean diff --git a/components/NavLink.tsx b/components/NavLink.tsx index 5a41e9e..8f5606e 100644 --- a/components/NavLink.tsx +++ b/components/NavLink.tsx @@ -1,8 +1,9 @@ import React from 'react' -import cn from 'classnames' import Link from 'next/link' +import { cn } from '../util/styles' + type Props = { href: string external?: boolean diff --git a/components/Tracer/ExecutionStatus.tsx b/components/Tracer/ExecutionStatus.tsx index 2221270..7d9f98f 100644 --- a/components/Tracer/ExecutionStatus.tsx +++ b/components/Tracer/ExecutionStatus.tsx @@ -6,6 +6,7 @@ import { import { Priority, useRegisterActions } from 'kbar' import { Button } from 'components/ui' + import { TraceEntry } from '.' const ExecutionStatus = ({ diff --git a/components/Tracer/index.tsx b/components/Tracer/index.tsx index 94c54cb..0b2ac77 100644 --- a/components/Tracer/index.tsx +++ b/components/Tracer/index.tsx @@ -1,22 +1,22 @@ import { + memo, useContext, useEffect, - useState, - useRef, useReducer, - memo, + useRef, + useState, } from 'react' -import cn from 'classnames' import { Priority, useRegisterActions } from 'kbar' import { TableVirtuoso, TableVirtuosoHandle } from 'react-virtuoso' import { - CairoVMApiContext, BreakPoints, + CairoVMApiContext, ProgramExecutionState, } from 'context/cairoVMApiContext' +import { cn } from '../../util/styles' import Console from '../Editor/Console' import ExecutionStatus from './ExecutionStatus' @@ -222,28 +222,30 @@ export const Tracer = () => {