-
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.
user feedback & message to event_rating
- Loading branch information
Showing
14 changed files
with
155 additions
and
25 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
70 changes: 70 additions & 0 deletions
70
packages/client/src/pages/ratings/components/SubmitRatingModal.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,70 @@ | ||
import { | ||
Button, | ||
FormControl, | ||
FormLabel, | ||
Modal, | ||
ModalBody, | ||
ModalCloseButton, | ||
ModalContent, | ||
ModalFooter, | ||
ModalHeader, | ||
ModalOverlay, | ||
Text, | ||
Textarea, | ||
useDisclosure, | ||
} from '@chakra-ui/react' | ||
import { useState } from 'react' | ||
import { FaChevronRight } from 'react-icons/fa' | ||
import { useRatingContext } from 'src/api/contexts/useRatingContext' | ||
|
||
type Props = { | ||
variant?: string | ||
color?: string | ||
colorScheme?: string | ||
} | ||
|
||
export const SubmitRatingModal = ({ variant, color, colorScheme }: Props) => { | ||
const { submitRating, openSubmitModal } = useRatingContext() | ||
const [value, setValue] = useState('') | ||
const { isOpen, onClose, onOpen } = useDisclosure() | ||
return ( | ||
<> | ||
<Button | ||
color={color} | ||
colorScheme={colorScheme} | ||
rightIcon={<FaChevronRight />} | ||
variant={variant} | ||
onClick={() => openSubmitModal(onOpen)} | ||
> | ||
Véglegesítés | ||
</Button> | ||
<Modal isOpen={isOpen} onClose={onClose}> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalHeader>Értékelés véglegesítése</ModalHeader> | ||
<ModalCloseButton /> | ||
<ModalBody textAlign="justify"> | ||
<Text mb={5}> | ||
Köszönjük, hogy értékelted a versenyt! Az értékélest a 'Küldés' gombbal tudod véglegesíteni, ezután már nem fogod tudni | ||
szerkeszteni. Ha szeretnél még szöveges formában visszajelzést küldeni a szervezőknek, azt megteheted az alábbi | ||
szövegdobozban. | ||
</Text> | ||
<FormControl> | ||
<FormLabel>Szöveges visszajelzés (opcionális)</FormLabel> | ||
<Textarea rows={8} value={value} onChange={(e) => setValue(e.target.value)} /> | ||
</FormControl> | ||
</ModalBody> | ||
|
||
<ModalFooter> | ||
<Button mr={3} colorScheme="gray" onClick={onClose}> | ||
Mégse | ||
</Button> | ||
<Button colorScheme="brand" mr={3} onClick={() => submitRating(value)}> | ||
Küldés | ||
</Button> | ||
</ModalFooter> | ||
</ModalContent> | ||
</Modal> | ||
</> | ||
) | ||
} |
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
14 changes: 14 additions & 0 deletions
14
packages/functions/src/typeorm/migrations/1705141629515-message_to_rating.ts
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,14 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class MessageToRating1705141629515 implements MigrationInterface { | ||
name = 'MessageToRating1705141629515' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "event_rating" ADD "message" nvarchar(255)`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "event_rating" DROP COLUMN "message"`); | ||
} | ||
|
||
} |