Skip to content

PM-876 Add a requests button on opportunity feed #1062

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

Merged
merged 1 commit into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,16 @@ const CopilotOpportunityList: FC<{}> = () => {
onClick: () => navigate(copilotRoutesMap.CopilotRequestForm),
}

const addCopilotRequestsButton: ButtonProps = {
label: 'Copilot Requests',
onClick: () => navigate(copilotRoutesMap.CopilotRequests),
}

return (
<ContentLayout
title='Copilot Opportunities'
buttonConfig={isAdminOrPM ? addNewRequestButton : undefined}
secondaryButtonConfig={isAdminOrPM ? addCopilotRequestsButton : undefined}
>
<PageTitle>Copilot Opportunities</PageTitle>
<Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
border-bottom: $border solid $black-5;
margin-top: $sp-2;
padding: $sp-6 0;
gap: $sp-6;

h1 {
flex: 1;
Expand Down
11 changes: 11 additions & 0 deletions src/libs/ui/lib/components/content-layout/ContentLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import styles from './ContentLayout.module.scss'

export interface ContentLayoutProps {
buttonConfig?: ButtonProps
secondaryButtonConfig?: ButtonProps
children?: ReactNode
contentClass?: string
innerClass?: string
Expand All @@ -29,6 +30,16 @@ const ContentLayout: FC<ContentLayoutProps> = (props: ContentLayoutProps) => (
{props.title}
</h1>

{!!props.secondaryButtonConfig && (
<div>

Choose a reason for hiding this comment

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

Consider adding a key prop to the div element if this block is part of a list or if there is a possibility of rendering multiple secondary buttons dynamically. This helps React identify which items have changed, are added, or are removed.

<Button
{...props.secondaryButtonConfig}
secondary
size='lg'
/>
</div>
)}

{!!props.buttonConfig && (
<div>
<Button
Expand Down