Skip to content

Commit

Permalink
use toggle comments button
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmurraydavid committed Jul 10, 2024
1 parent 4c55217 commit abed4ef
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Helmet } from 'react-helmet-async';
import { makeStyles } from 'tss-react/mui';
import { EngagementStatusLabels } from '~/api/schema.graphql';
import { canEditAny, labelFrom } from '~/common';
import { ToggleCommentsButton } from '~/components/Comments/ToggleCommentButton';
import { BooleanProperty } from '../../../../components/BooleanProperty';
import { DataButton } from '../../../../components/DataButton';
import { useDialog } from '../../../../components/Dialog';
Expand Down Expand Up @@ -106,6 +107,9 @@ export const LanguageEngagementHeader = ({
</Tooltip>
</Grid>
)}
<Grid item>
<ToggleCommentsButton loading={!engagement} />
</Grid>
<Grid item>
<DeleteEngagement
project={engagement.project}
Expand Down
2 changes: 2 additions & 0 deletions src/scenes/Languages/Detail/LanguageDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { makeStyles } from 'tss-react/mui';
import { PartialDeep } from 'type-fest';
import { removeItemFromList } from '~/api';
import { canEditAny, listOrPlaceholders } from '~/common';
import { ToggleCommentsButton } from '~/components/Comments/ToggleCommentButton';
import { BooleanProperty } from '../../../components/BooleanProperty';
import { useDialog } from '../../../components/Dialog';
import {
Expand Down Expand Up @@ -140,6 +141,7 @@ export const LanguageDetail = () => {
args.input?.filter?.pinned ?? false
}
/>
<ToggleCommentsButton loading={!language} />
</div>
<Grid container spacing={2} alignItems="center">
<Grid item>
Expand Down
2 changes: 2 additions & 0 deletions src/scenes/Partners/Detail/PartnerDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Many, Nil } from '@seedcompany/common';
import { Helmet } from 'react-helmet-async';
import { useParams } from 'react-router-dom';
import { PartialDeep } from 'type-fest';
import { ToggleCommentsButton } from '~/components/Comments/ToggleCommentButton';
import { DataButton } from '~/components/DataButton';
import { useDialog } from '~/components/Dialog';
import { Error } from '~/components/Error';
Expand Down Expand Up @@ -128,6 +129,7 @@ const PartnerHeader = ({
args.input?.filter?.pinned ?? false
}
/>
<ToggleCommentsButton loading={!partner} />
</Stack>
{acronym && (
<Typography variant="h4" gutterBottom>
Expand Down
2 changes: 2 additions & 0 deletions src/scenes/Projects/Overview/ProjectOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { makeStyles } from 'tss-react/mui';
import { PartialDeep } from 'type-fest';
import { ProjectStepLabels, ProjectTypeLabels } from '~/api/schema.graphql';
import { labelFrom } from '~/common';
import { ToggleCommentsButton } from '~/components/Comments/ToggleCommentButton';
import { BudgetOverviewCard } from '../../../components/BudgetOverviewCard';
import { CardGroup } from '../../../components/CardGroup';
import { ChangesetPropertyBadge } from '../../../components/Changeset';
Expand Down Expand Up @@ -242,6 +243,7 @@ export const ProjectOverview = () => {
args.input?.filter?.pinned ?? false
}
/>
<ToggleCommentsButton loading={!project} />
{project && <DeleteProject project={project} />}
</header>

Expand Down
7 changes: 6 additions & 1 deletion src/scenes/Root/MainLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { ErrorBoundary } from 'react-error-boundary';
import { Outlet } from 'react-router-dom';
import { Outlet, useParams } from 'react-router-dom';
import { makeStyles } from 'tss-react/mui';
import { firstValue } from '~/common';
import { CommentsBar } from '~/components/Comments/CommentsBar';
import { Error } from '../../components/Error';
import { useAuthRequired } from '../Authentication';
import { CreateDialogProviders } from './Creates';
Expand All @@ -22,6 +24,8 @@ const useStyles = makeStyles()(() => ({

export const MainLayout = () => {
useAuthRequired();
const resourceId = firstValue(useParams());

const { classes } = useStyles();
return (
<div className={classes.root}>
Expand All @@ -30,6 +34,7 @@ export const MainLayout = () => {
</CreateDialogProviders>
<div className={classes.main}>
<Header />
<CommentsBar resourceId={resourceId} />
<ErrorBoundary fallback={<Error show page />}>
<Outlet />
</ErrorBoundary>
Expand Down
2 changes: 2 additions & 0 deletions src/scenes/Users/Detail/UserDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { makeStyles } from 'tss-react/mui';
import { PartialDeep } from 'type-fest';
import { RoleLabels } from '~/api/schema.graphql';
import { canEditAny, labelsFrom } from '~/common';
import { ToggleCommentsButton } from '~/components/Comments/ToggleCommentButton';
import { useDialog } from '../../../components/Dialog';
import {
DisplaySimpleProperty,
Expand Down Expand Up @@ -98,6 +99,7 @@ export const UserDetail = () => {
args.input?.filter?.pinned ?? false
}
/>
<ToggleCommentsButton loading={!user} />
<ImpersonationToggle user={user} />
</div>
<DisplayProperty
Expand Down

0 comments on commit abed4ef

Please sign in to comment.