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

Commit

Permalink
Merge pull request #217 from tabler/responsive-fixes
Browse files Browse the repository at this point in the history
Responsive fixes
  • Loading branch information
AaronCoplan authored Jun 4, 2018
2 parents 01d190b + f85b58a commit 3ef2495
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 20 deletions.
18 changes: 7 additions & 11 deletions example/src/HomePage.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,23 +327,23 @@ function Home() {
</Card.Body>
</Card>
</Grid.Col>
<Grid.Col sm={4}>
<Grid.Col sm={6}>
<ProgressCard
header="New feedback"
content="62"
progressColor="red"
progressWidth={28}
/>
</Grid.Col>
<Grid.Col sm={4}>
<Grid.Col sm={6}>
<ProgressCard
header="Today profit"
content="$652"
progressColor="green"
progressWidth={84}
/>
</Grid.Col>
<Grid.Col sm={4}>
<Grid.Col sm={6}>
<ProgressCard
header="Users online"
content="76"
Expand All @@ -359,8 +359,7 @@ function Home() {
icon="dollar-sign"
header={
<a>
132
<small>Sales</small>
132 <small>Sales</small>
</a>
}
footer={"12 waiting payments"}
Expand All @@ -372,8 +371,7 @@ function Home() {
icon="shopping-cart"
header={
<a>
78
<small>Orders</small>
78 <small>Orders</small>
</a>
}
footer={"32 shipped"}
Expand All @@ -385,8 +383,7 @@ function Home() {
icon="users"
header={
<a>
1,352
<small>Members</small>
1,352 <small>Members</small>
</a>
}
footer={"163 registered today"}
Expand All @@ -398,8 +395,7 @@ function Home() {
icon="message-square"
header={
<a>
132
<small>Comments</small>
132 <small>Comments</small>
</a>
}
footer={"16 waiting"}
Expand Down
17 changes: 15 additions & 2 deletions src/components/Dropdown/Dropdown.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ type DefaultProps = {|
* Is this Dropdown a Card option?
*/
+isOption?: boolean,
/**
* Add flex classes to the Dropdown
*/
+flex?: boolean | "xs" | "sm" | "md" | "lg" | "xl",
|};

type WithAnyTriggerProps = {|
Expand Down Expand Up @@ -159,13 +163,22 @@ class Dropdown extends React.Component<Props, State> {
};

render(): React.Node {
const { className, children, desktopOnly, isOption, ...props } = this.props;
const {
className,
children,
desktopOnly,
isOption,
flex = false,
...props
} = this.props;

const classes = cn(
{
dropdown: true,
"d-none": desktopOnly,
"d-md-flex": desktopOnly,
"d-md-flex": desktopOnly || flex === "md",
[`d-{flex}-flex`]: ["xs", "sm", "lg", "xl"].includes(flex),
"d-flex": flex === true,
"card-options-dropdown": isOption,
show: this.state.isOpen,
},
Expand Down
3 changes: 3 additions & 0 deletions src/components/Header/H1.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ type Props = {|
+className?: string,
|};

/**
* A Header component rendered as a h1 HTML element with a margin below
*/
function H1({ className, children }: Props): React.Node {
const classes: string = cn("mt-0 mb-4", className);
return (
Expand Down
3 changes: 3 additions & 0 deletions src/components/Header/H2.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ type Props = {|
+className?: string,
|};

/**
* A Header component rendered as a h2 HTML element with a margin below
*/
function H2({ className, children }: Props): React.Node {
const classes: string = cn("mt-0 mb-4", className);
return (
Expand Down
3 changes: 3 additions & 0 deletions src/components/Header/H3.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ type Props = {|
+className?: string,
|};

/**
* A Header component rendered as a h3 HTML element with a margin below
*/
function H3({ className, children }: Props): React.Node {
const classes: string = cn("mt-0 mb-4", className);
return (
Expand Down
3 changes: 3 additions & 0 deletions src/components/Header/H4.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ type Props = {|
+className?: string,
|};

/**
* A Header component rendered as a h4 HTML element with a margin below
*/
function H4({ className, children }: Props): React.Node {
const classes: string = cn("mt-0 mb-4", className);
return (
Expand Down
3 changes: 3 additions & 0 deletions src/components/Header/H5.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ type Props = {|
+className?: string,
|};

/**
* A Header component rendered as a h5 HTML element with a margin below
*/
function H5({ className, children }: Props): React.Node {
const classes: string = cn("mt-0 mb-4", className);
return (
Expand Down
3 changes: 3 additions & 0 deletions src/components/Header/H6.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ type Props = {|
+className?: string,
|};

/**
* A Header component rendered as a h6 HTML element with a margin below
*/
function H6({ className, children }: Props): React.Node {
const classes: string = cn("mt-0 mb-4", className);
return (
Expand Down
1 change: 1 addition & 0 deletions src/components/Header/Header.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Props = {|

/**
* A header
* By default renders a div not a <hX> tag and has no additional spacing classes applied
*/
function Header({
RootComponent,
Expand Down
1 change: 1 addition & 0 deletions src/components/Notification/NotificationTray.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function NotificationTray(props: Props): React.Node {
position="bottom-end"
arrow={true}
arrowPosition="right"
flex
items={
<React.Fragment>
{(notifications &&
Expand Down
6 changes: 5 additions & 1 deletion src/components/StampCard/StampCard.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ function StampCard({
<div className="d-flex align-items-center">
<Stamp color={color} icon={icon} className="mr-3" />
<div>
{header && <Header.H4 className="m-0">{header}</Header.H4>}
{header && (
<Header size={4} className="m-0">
{header}
</Header>
)}
{children}
{footer && <Text.Small muted>{footer}</Text.Small>}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/Table.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.Table.table-responsive {
.table-responsive {
overflow-x: inherit !important;
}
6 changes: 1 addition & 5 deletions src/components/Table/Table.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,7 @@ function Table({
</table>
);

return !responsive ? (
table
) : (
<div className="Table.table-responsive">{table}</div>
);
return !responsive ? table : <div className="table-responsive">{table}</div>;
}

Table.defaultProps = {
Expand Down

0 comments on commit 3ef2495

Please sign in to comment.