Skip to content

Commit

Permalink
fix: only show events link if editing
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois committed Feb 27, 2024
1 parent c891e01 commit c52a0d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
TokenGeneration,
useIncomingWebhooksForm,
} from './IncomingWebhooksForm/useIncomingWebhooksForm';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';

const StyledHeader = styled('div')(({ theme }) => ({
display: 'flex',
Expand Down Expand Up @@ -158,7 +159,10 @@ export const IncomingWebhooksModal = ({
>
<StyledHeader>
<StyledTitle>{title}</StyledTitle>
<Link onClick={onOpenEvents}>View events</Link>
<ConditionallyRender
condition={editing}
show={<Link onClick={onOpenEvents}>View events</Link>}
/>
</StyledHeader>
<StyledForm onSubmit={onSubmit}>
<IncomingWebhooksForm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { ProjectActionsForm } from './ProjectActionsForm/ProjectActionsForm';
import { useProjectActionsForm } from './ProjectActionsForm/useProjectActionsForm';
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';

const StyledHeader = styled('div')(({ theme }) => ({
display: 'flex',
Expand Down Expand Up @@ -163,7 +164,10 @@ export const ProjectActionsModal = ({
>
<StyledHeader>
<StyledTitle>{title}</StyledTitle>
<Link onClick={onOpenEvents}>View events</Link>
<ConditionallyRender
condition={editing}
show={<Link onClick={onOpenEvents}>View events</Link>}
/>
</StyledHeader>
<StyledForm onSubmit={onSubmit}>
<ProjectActionsForm
Expand Down

0 comments on commit c52a0d2

Please sign in to comment.