@@ -15,6 +15,11 @@ import JourneyDashboardWelcomeBlock from '../../common/journeyDashboardWelcomeBl
15
15
import useDirectMessageDialog from '../../../communication/messaging/DirectMessaging/useDirectMessageDialog' ;
16
16
import { useTranslation } from 'react-i18next' ;
17
17
import { buildUpdatesUrl } from '../../../../main/routing/urlBuilders' ;
18
+ import OpportunityApplicationButtonContainer from '../../../community/application/containers/OpportunityApplicationButtonContainer' ;
19
+ import OpportunityApplicationButton from '../../../community/application/applicationButton/OpportunityApplicationButton' ;
20
+ import PageContentColumn from '../../../../core/ui/content/PageContentColumn' ;
21
+ import FullWidthButton from '../../../../core/ui/button/FullWidthButton' ;
22
+ import { Theme , useMediaQuery } from '@mui/material' ;
18
23
19
24
export interface OpportunityDashboardPageProps {
20
25
dialog ?: 'updates' | 'contributors' | 'calendar' ;
@@ -37,6 +42,7 @@ const OpportunityDashboardPage: FC<OpportunityDashboardPageProps> = ({ dialog })
37
42
throw new Error ( 'Must be within a Space route.' ) ;
38
43
}
39
44
const shareUpdatesUrl = buildUpdatesUrl ( { spaceNameId, challengeNameId, opportunityNameId } ) ;
45
+ const hasExtendedApplicationButton = useMediaQuery ( ( theme : Theme ) => theme . breakpoints . up ( 'sm' ) ) ;
40
46
41
47
return (
42
48
< OpportunityPageLayout currentSection = { EntityPageSection . Dashboard } >
@@ -45,6 +51,29 @@ const OpportunityDashboardPage: FC<OpportunityDashboardPageProps> = ({ dialog })
45
51
{ ( { callouts, ...entities } , state ) => (
46
52
< >
47
53
< JourneyDashboardView
54
+ ribbon = {
55
+ < OpportunityApplicationButtonContainer
56
+ challengeNameId = { challengeNameId }
57
+ opportunityNameId = { opportunityNameId }
58
+ >
59
+ { ( { applicationButtonProps, state : { loading } } ) => {
60
+ if ( loading || applicationButtonProps . isMember ) {
61
+ return null ;
62
+ }
63
+
64
+ return (
65
+ < PageContentColumn columns = { 12 } >
66
+ < OpportunityApplicationButton
67
+ { ...applicationButtonProps }
68
+ loading = { loading }
69
+ component = { FullWidthButton }
70
+ extended = { hasExtendedApplicationButton }
71
+ />
72
+ </ PageContentColumn >
73
+ ) ;
74
+ } }
75
+ </ OpportunityApplicationButtonContainer >
76
+ }
48
77
welcome = {
49
78
< JourneyDashboardWelcomeBlock
50
79
vision = { entities . opportunity ?. context ?. vision ?? '' }
0 commit comments