@@ -5,6 +5,8 @@ import { Link } from 'react-router-dom';
55import {
66 Breadcrumb , Col , Container , Row , Button , Badge ,
77 Stack ,
8+ useMediaQuery ,
9+ breakpoints ,
810} from '@openedx/paragon' ;
911
1012interface BreadcrumbLink {
@@ -37,23 +39,25 @@ export const ActionButton = ({ label, icon, onClick }: Action) => (
3739
3840const AuthZTitle = ( {
3941 activeLabel, navLinks = [ ] , pageTitle, pageSubtitle, actions = [ ] ,
40- } : AuthZTitleProps ) => (
41- < Container className = "p-5 bg-light-100" >
42- < Breadcrumb
43- linkAs = { Link }
44- links = { navLinks }
45- activeLabel = { activeLabel }
46- />
47- < Row className = "mt-4" >
48- < Col xs = { 12 } md = { 7 } className = "mb-4" >
49- < h1 className = "text-primary" > { pageTitle } </ h1 >
50- { typeof pageSubtitle === 'string'
51- ? < h3 > < Badge className = "py-2 px-3 font-weight-normal" variant = "light" > { pageSubtitle } </ Badge > </ h3 >
52- : pageSubtitle }
53- </ Col >
54- < Col xs = { 12 } md = { 5 } >
55- < Stack gap = { 3 } direction = "horizontal" >
56- {
42+ } : AuthZTitleProps ) => {
43+ const isDesktop = useMediaQuery ( { minWidth : breakpoints . large . minWidth } ) ;
44+ return (
45+ < Container className = "p-5 bg-light-100" >
46+ < Breadcrumb
47+ linkAs = { Link }
48+ links = { navLinks }
49+ activeLabel = { activeLabel }
50+ />
51+ < Row className = "mt-4" >
52+ < Col xs = { 12 } md = { 7 } className = "mb-4" >
53+ < h1 className = "text-primary" > { pageTitle } </ h1 >
54+ { typeof pageSubtitle === 'string'
55+ ? < h3 > < Badge className = "py-2 px-3 font-weight-normal" variant = "light" > { pageSubtitle } </ Badge > </ h3 >
56+ : pageSubtitle }
57+ </ Col >
58+ < Col xs = { 12 } md = { 5 } >
59+ < Stack className = "justify-content-end" direction = { isDesktop ? 'horizontal' : 'vertical' } >
60+ {
5761 actions . map ( ( action , index ) => {
5862 const content = isValidElement ( action )
5963 ? action
@@ -65,15 +69,16 @@ const AuthZTitle = ({
6569 < Fragment key = { `authz-header-action-${ key } ` } >
6670 { content }
6771 { ( index === actions . length - 1 ) ? null
68- : ( < hr className = "border-right " /> ) }
72+ : ( < hr className = "mx-lg-5 " /> ) }
6973 </ Fragment >
7074 ) ;
7175 } )
7276 }
73- </ Stack >
74- </ Col >
75- </ Row >
76- </ Container >
77- ) ;
77+ </ Stack >
78+ </ Col >
79+ </ Row >
80+ </ Container >
81+ ) ;
82+ } ;
7883
7984export default AuthZTitle ;
0 commit comments