-
Notifications
You must be signed in to change notification settings - Fork 2
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
Campaign Index and Create/Edit form #411
Conversation
…tton based on type
characters, | ||
}: CampaignCreateFormPropType) => { | ||
const CAMPAIGN_CREATE_FORM_INITIAL_VALUE: CampaignFormDataType = { | ||
title: '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use undefined
instead
useForm<CampaignFormDataType>(CAMPAIGN_INITIAL_VALUE) | ||
|
||
return ( | ||
<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont need this empty tag
</Grid> | ||
<Grid container spacing={4}> | ||
<Grid item xs={4}> | ||
<Button onClick={() => onCloseDrawer && onCloseDrawer()} fullWidth> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont think this covers when you cancel from create view
|
||
const Campaign = ({campaigns, characters, adventures}: CampaignPropType) => { | ||
const [isEditDrawerOpen, setIsEditDrawerOpen] = useState<boolean>(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use useEditDrawer
…input properly
resources/js/Utils/formatter.ts
Outdated
@@ -1,2 +1,5 @@ | |||
export const itemFormatter = (items: any[]) => | |||
items.map((item: any) => item.name).join(', ') | |||
|
|||
export const characterNameFormatter = (characters: any[]) => | |||
characters.map((character: any) => character.name).join(', ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if these are the same as itemFormatter, I think you can write a more generic function to accommodate both
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, Ill join these two and update it in both the Campaign table and Item table
…ssion-tome into 384-campaign-index
@@ -76,7 +76,7 @@ const EntryTable = ({ | |||
{ | |||
property: 'items', | |||
title: 'Magic Items', | |||
render: (value: any) => itemFormatter(value), | |||
render: (value: any) => objectArrayFormatter(value), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for this!
Kudos, SonarCloud Quality Gate passed! |
Closes #384
Closes #386
Description
Changes made