Skip to content

Commit

Permalink
Возвращён старый дизайн переключателя условия (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryzZz authored Jan 27, 2024
1 parent 9edbb29 commit 123d183
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 51 deletions.
30 changes: 0 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"@floating-ui/react-dom": "^2.0.1",
"@monaco-editor/react": "^4.5.1",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-switch": "^1.0.3",
"@types/ws": "^8.5.10",
"@uiw/react-codesandbox": "^1.1.5",
"blob-util": "^2.0.2",
Expand Down
16 changes: 12 additions & 4 deletions src/renderer/src/components/CreateModal/Condition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { SingleValue } from 'react-select';
import { twMerge } from 'tailwind-merge';

import { Checkbox, Select, SelectOption, Switch, TextInput } from '@renderer/components/UI';
import { Checkbox, Select, SelectOption, TextInput } from '@renderer/components/UI';

const operand = [
{
Expand Down Expand Up @@ -104,11 +104,19 @@ export const Condition: React.FC<ConditionProps> = (props) => {
return (
<div className="my-3">
<div className="mb-2 flex items-center">
<span className="mr-2 font-bold">Условие: </span>
<Switch checked={show} onCheckedChange={handleChangeConditionShow} />
<label className="mr-2 font-bold">Если: </label>
<label className={twMerge('btn border-primary px-3', show && 'btn-primary')}>
<input
type="checkbox"
checked={show}
onChange={(e) => handleChangeConditionShow(e.target.checked)}
className="h-0 w-0 opacity-0"
/>
<span>{show ? 'Убрать условие' : 'Добавить условие'}</span>
</label>
</div>

<div className={twMerge('flex flex-col gap-2', !show && 'hidden')}>
<div className={twMerge('ml-12 flex flex-col gap-2', !show && 'hidden')}>
<div className="flex items-end">
<Checkbox
checked={!isParamOneInput1}
Expand Down
15 changes: 0 additions & 15 deletions src/renderer/src/components/UI/Switch.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/renderer/src/components/UI/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ export * from './WithHint';
export * from './Modal';
export * from './ColorInput';
export * from './TextInput';
export * from './Switch';
export * from './Checkbox';

0 comments on commit 123d183

Please sign in to comment.