Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

Commit cc9b1ff

Browse files
authored
Merge pull request #260 from alanbueno/feat/optional-header-alignment
feat(*): Add SiteHeader center alignment capability
2 parents 8f11777 + 61250b8 commit cc9b1ff

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

src/components/Container.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@charset "UTF-8";
2+
/**
3+
Container customization
4+
*/
5+
6+
.container.center {
7+
display: flex;
8+
align-items: center;
9+
justify-content: center;
10+
}

src/components/Container.react.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
// @flow
22

33
import * as React from "react";
4+
import cn from "classnames";
5+
6+
import "./Container.css";
47

58
type Props = {|
69
+children?: React.Node,
10+
+className?: string,
711
|};
812

9-
function Container(props: Props): React.Node {
10-
return <div className={"container"}>{props.children}</div>;
13+
function Container({ className, children }: Props): React.Node {
14+
const classes = cn("container", className);
15+
return <div className={classes}>{children}</div>;
1116
}
1217

1318
export default Container;

src/components/Site/SiteHeader.react.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import type { Props as AccountDropdownProps } from "../AccountDropdown/AccountDr
88
export type Props = {|
99
+children?: React.Node,
1010
/**
11-
* href attributefor the logo
11+
* header alignment
12+
*/
13+
+align?: string,
14+
/**
15+
* href attribute for the logo
1216
*/
1317
+href?: string,
1418
/**
@@ -38,6 +42,7 @@ export type Props = {|
3842
const SiteHeader = ({
3943
children,
4044
href,
45+
align,
4146
imageURL,
4247
alt,
4348
notificationsTray: notificationsTrayFromProps,
@@ -55,7 +60,7 @@ const SiteHeader = ({
5560

5661
return (
5762
<div className="header py-4">
58-
<Container>
63+
<Container className={align}>
5964
<div className="d-flex">
6065
{children || (
6166
<React.Fragment>

0 commit comments

Comments
 (0)