Skip to content

Commit 218b4a9

Browse files
committed
style: add mx-5 to divider to avoid wide growth
1 parent 82b5f05 commit 218b4a9

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

src/authz-module/components/AuthZTitle.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { Link } from 'react-router-dom';
55
import {
66
Breadcrumb, Col, Container, Row, Button, Badge,
77
Stack,
8+
useMediaQuery,
9+
breakpoints,
810
} from '@openedx/paragon';
911

1012
interface BreadcrumbLink {
@@ -37,7 +39,9 @@ export const ActionButton = ({ label, icon, onClick }: Action) => (
3739

3840
const AuthZTitle = ({
3941
activeLabel, navLinks = [], pageTitle, pageSubtitle, actions = [],
40-
}: AuthZTitleProps) => (
42+
}: AuthZTitleProps) => {
43+
const isDesktop = useMediaQuery({ minWidth: breakpoints.large.minWidth });
44+
return (
4145
<Container className="p-5 bg-light-100">
4246
<Breadcrumb
4347
linkAs={Link}
@@ -51,8 +55,8 @@ const AuthZTitle = ({
5155
? <h3><Badge className="py-2 px-3 font-weight-normal" variant="light">{pageSubtitle}</Badge></h3>
5256
: pageSubtitle}
5357
</Col>
54-
<Col xs={12} md={5}>
55-
<Stack gap={3} direction="horizontal">
58+
<Col xs={12} md={5} >
59+
<Stack className="justify-content-end" direction={isDesktop ? "horizontal" :"vertical" }>
5660
{
5761
actions.map((action, index) => {
5862
const content = isValidElement(action)
@@ -65,7 +69,7 @@ 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
})
@@ -74,6 +78,6 @@ const AuthZTitle = ({
7478
</Col>
7579
</Row>
7680
</Container>
77-
);
81+
)};
7882

7983
export default AuthZTitle;

src/authz-module/index.scss

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1+
@use "@openedx/paragon/styles/css/core/custom-media-breakpoints" as paragonCustomMediaBreakpoints;
2+
13
.authz-libraries {
2-
--height-action-devider: 30px;
4+
--height-action-divider: 30px;
35

46
.pgn__breadcrumb li:first-child a {
57
color: var(--pgn-color-breadcrumb-active);
68
text-decoration: none;
79
}
10+
811
hr {
9-
height: var(--height-action-devider);
12+
border-top: var(--pgn-size-border-width) solid var(--pgn-color-border);
13+
width: 100%;
14+
}
15+
16+
@media (--pgn-size-breakpoint-min-width-lg) {
17+
hr {
18+
border-right: var(--pgn-size-border-width) solid var(--pgn-color-border);
19+
height: var(--height-action-divider);
20+
width: 0;
21+
}
1022
}
1123

1224
.tab-content {
@@ -53,4 +65,4 @@
5365
// Move toast to the right
5466
left: auto;
5567
right: var(--pgn-spacing-toast-container-gutter-lg);
56-
}
68+
}

0 commit comments

Comments
 (0)