Skip to content

Commit

Permalink
Merge pull request #516 from DnD-Montreal/514-hide-dm-entry-button-wh…
Browse files Browse the repository at this point in the history
…en-campaign-is-joined

Hide DM entry button when user joined a campaign with a character
  • Loading branch information
willyyhuang authored Mar 16, 2022
2 parents 7c70448 + 1eb2668 commit 66e0fbd
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions resources/js/Components/Detail/CampaignDetail/CampaignDetailBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const CampaignDetailBox = ({
onClick={() => setIsEditDrawerOpen(true)}>
{t('common.update')}
</Button>
{userCharacter && (
{userCharacter ? (
<Link
href={route('entry.create').concat(
`?character_id=${userCharacter.id}&campaign_id=${campaign.id}`,
Expand All @@ -99,17 +99,18 @@ const CampaignDetailBox = ({
{t('common.entry')}
</Button>
</Link>
) : (
<Link
href={route('dm-entry.create').concat(
`?campaign_id=${campaign.id}`,
)}>
<Button
variant='contained'
startIcon={<AutoStoriesIcon fontSize='small' />}>
{t('common.dm-entry')}
</Button>
</Link>
)}
<Link
href={route('dm-entry.create').concat(
`?campaign_id=${campaign.id}`,
)}>
<Button
variant='contained'
startIcon={<AutoStoriesIcon fontSize='small' />}>
{t('common.dm-entry')}
</Button>
</Link>
<Button
data-cy='kick-button'
variant='contained'
Expand Down

0 comments on commit 66e0fbd

Please sign in to comment.