Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Simplify Generator controls #184

Merged
merged 3 commits into from
Sep 20, 2024
Merged

Conversation

going-confetti
Copy link
Collaborator

No description provided.

import { CheckCircledIcon, DotsVerticalIcon } from '@radix-ui/react-icons'
import { useGeneratorParams } from '../Generator.hooks'
import { useNavigate } from 'react-router-dom'
import { getRoutePath } from '@/routeMap'

interface GeneratorControlsProps {
onSave: () => void
isDirty: boolean
}

export function GeneratorControls({ onSave, isDirty }: GeneratorControlsProps) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

</Flex>

<SortableRuleList rules={rules} onSwapRules={swapRules} />
<Flex py="3" px="6" align="center" direction="column" gap="3">
{rules.length === 0 ? (
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

<NewRuleMenu variant="solid" size="2" />
</>
) : (
<NewRuleMenu />
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

const tooltip = hasError ? 'Invalid script. Please check your rules' : ''

const handleDeleteGenerator = async () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a confirmation dialog. I'll add a reusable one in a separate PR - we'll need it in other views and the sidebar as well

Copy link
Member

@Llandy3d Llandy3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⌨️

@going-confetti going-confetti merged commit 72211ae into main Sep 20, 2024
1 check passed
@going-confetti going-confetti deleted the feat/generator-controls-2 branch September 20, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants