Skip to content

Commit

Permalink
Merge pull request #180 from GTBitsOfGood/ash/168-allowTitleEditing
Browse files Browse the repository at this point in the history
ash/168-allowTitleEditing
  • Loading branch information
avayedawadi authored Sep 15, 2023
2 parents 7fbcc3d + 00d78ae commit ce4ea78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Modals/CardModal/CardModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,12 @@ const CardModal = ({
<ModalContent rounded={14}>
<ModalCloseButton right={2} top={0} m={4} />
<ModalHeader mt={10} mx={6}>
<Flex justifyContent="space-between">
<Heading mb={2}>{card.title}</Heading>
<Flex justifyContent="space-between" align="center" gap={4}>
{editing ? (
<InputControl name="title" size="lg"></InputControl>
) : (
<Heading mb={2}>{card.title}</Heading>
)}
{user?.isAdmin ? (
!editing ? (
<Button
Expand Down
3 changes: 3 additions & 0 deletions src/components/Modals/CardModal/cardEditValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { DEFAULT_IMAGE } from "src/lib/utils/constants";

const cardEditValidator = (values) => {
const errors = {};
if (!values.title || values.title.length == 0) {
errors.title = "Title cannot be blank";
}
if (!values.criteria || values.criteria.length == 0) {
errors.criteria = "Criteria cannot be blank";
}
Expand Down

1 comment on commit ce4ea78

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for southface ready!

✅ Preview
https://southface-2vmzazhh9-bitsofgood.vercel.app

Built with commit ce4ea78.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.