-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
153 additions
and
40 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
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
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
60 changes: 60 additions & 0 deletions
60
app/frontend/Pages/Screens/Edit/ScreenTabControls/EditScreenTabButton.tsx
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,60 @@ | ||
import React from 'react' | ||
import { Routes } from '@/lib' | ||
import { Accordion, Box, Divider, Text } from '@/Components' | ||
import { EditIcon } from '@/Components/Icons' | ||
import { modals } from '@mantine/modals' | ||
import ScreenForm from '../../Form' | ||
import { DeleteButton } from '@/Components/Button' | ||
|
||
interface EditScreenTabButtonProps { | ||
screen: Schema.ScreensEdit | ||
onSuccess?: () => void | ||
} | ||
|
||
const EditScreenTabButton = ({ screen, onSuccess, ...props }: EditScreenTabButtonProps) => { | ||
|
||
const handleEditButtonClick = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => { | ||
e.stopPropagation() | ||
e.preventDefault() | ||
|
||
modals.open({ | ||
title: 'Edit Screen', | ||
children: ( | ||
<> | ||
<ScreenForm | ||
to={ Routes.screen(screen.slug) } | ||
screen={ screen } | ||
method="patch" | ||
onSubmit={ () => modals.closeAll() } | ||
/> | ||
<Divider /> | ||
<Accordion> | ||
<Accordion.Item value="delete"> | ||
<Accordion.Control>Permanently Delete</Accordion.Control> | ||
<Accordion.Panel> | ||
<Text>Will permanently delete this screen and all controls on the screen</Text> | ||
<DeleteButton | ||
href={ Routes.screen(screen.slug) } | ||
onClick={ () => modals.closeAll() } | ||
> | ||
Delete | ||
</DeleteButton> | ||
</Accordion.Panel> | ||
</Accordion.Item> | ||
</Accordion> | ||
</> | ||
), | ||
}) | ||
} | ||
|
||
return ( | ||
<Box | ||
onMouseUp={ handleEditButtonClick } | ||
{ ...props } | ||
> | ||
<EditIcon size={ 11 } /> | ||
</Box> | ||
) | ||
} | ||
|
||
export default EditScreenTabButton |
30 changes: 30 additions & 0 deletions
30
app/frontend/Pages/Screens/Edit/ScreenTabControls/NewScreenTabButton.tsx
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,30 @@ | ||
import React from 'react' | ||
import { Button } from '@/Components' | ||
import { modals } from '@mantine/modals' | ||
import ScreenForm from '../../Form' | ||
import { Routes } from '@/lib' | ||
|
||
const NewScreenTabButton = () => { | ||
|
||
const handleNewScreenModalTrigger = () => { | ||
modals.open({ | ||
title: 'Create a New Screen', | ||
children: ( | ||
<ScreenForm | ||
to={ Routes.screens() } | ||
onSubmit={ () => modals.closeAll() } | ||
/> | ||
), | ||
}) | ||
} | ||
|
||
return ( | ||
<Button | ||
p="xs" | ||
variant="subtle" | ||
onClick={ handleNewScreenModalTrigger } | ||
>+</Button> | ||
) | ||
} | ||
|
||
export default NewScreenTabButton |
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