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

Commit 3ef2495

Browse files
authored
Merge pull request #217 from tabler/responsive-fixes
Responsive fixes
2 parents 01d190b + f85b58a commit 3ef2495

File tree

13 files changed

+49
-20
lines changed

13 files changed

+49
-20
lines changed

example/src/HomePage.react.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -327,23 +327,23 @@ function Home() {
327327
</Card.Body>
328328
</Card>
329329
</Grid.Col>
330-
<Grid.Col sm={4}>
330+
<Grid.Col sm={6}>
331331
<ProgressCard
332332
header="New feedback"
333333
content="62"
334334
progressColor="red"
335335
progressWidth={28}
336336
/>
337337
</Grid.Col>
338-
<Grid.Col sm={4}>
338+
<Grid.Col sm={6}>
339339
<ProgressCard
340340
header="Today profit"
341341
content="$652"
342342
progressColor="green"
343343
progressWidth={84}
344344
/>
345345
</Grid.Col>
346-
<Grid.Col sm={4}>
346+
<Grid.Col sm={6}>
347347
<ProgressCard
348348
header="Users online"
349349
content="76"
@@ -359,8 +359,7 @@ function Home() {
359359
icon="dollar-sign"
360360
header={
361361
<a>
362-
132
363-
<small>Sales</small>
362+
132 <small>Sales</small>
364363
</a>
365364
}
366365
footer={"12 waiting payments"}
@@ -372,8 +371,7 @@ function Home() {
372371
icon="shopping-cart"
373372
header={
374373
<a>
375-
78
376-
<small>Orders</small>
374+
78 <small>Orders</small>
377375
</a>
378376
}
379377
footer={"32 shipped"}
@@ -385,8 +383,7 @@ function Home() {
385383
icon="users"
386384
header={
387385
<a>
388-
1,352
389-
<small>Members</small>
386+
1,352 <small>Members</small>
390387
</a>
391388
}
392389
footer={"163 registered today"}
@@ -398,8 +395,7 @@ function Home() {
398395
icon="message-square"
399396
header={
400397
<a>
401-
132
402-
<small>Comments</small>
398+
132 <small>Comments</small>
403399
</a>
404400
}
405401
footer={"16 waiting"}

src/components/Dropdown/Dropdown.react.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ type DefaultProps = {|
2828
* Is this Dropdown a Card option?
2929
*/
3030
+isOption?: boolean,
31+
/**
32+
* Add flex classes to the Dropdown
33+
*/
34+
+flex?: boolean | "xs" | "sm" | "md" | "lg" | "xl",
3135
|};
3236

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

161165
render(): React.Node {
162-
const { className, children, desktopOnly, isOption, ...props } = this.props;
166+
const {
167+
className,
168+
children,
169+
desktopOnly,
170+
isOption,
171+
flex = false,
172+
...props
173+
} = this.props;
163174

164175
const classes = cn(
165176
{
166177
dropdown: true,
167178
"d-none": desktopOnly,
168-
"d-md-flex": desktopOnly,
179+
"d-md-flex": desktopOnly || flex === "md",
180+
[`d-{flex}-flex`]: ["xs", "sm", "lg", "xl"].includes(flex),
181+
"d-flex": flex === true,
169182
"card-options-dropdown": isOption,
170183
show: this.state.isOpen,
171184
},

src/components/Header/H1.react.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ type Props = {|
99
+className?: string,
1010
|};
1111

12+
/**
13+
* A Header component rendered as a h1 HTML element with a margin below
14+
*/
1215
function H1({ className, children }: Props): React.Node {
1316
const classes: string = cn("mt-0 mb-4", className);
1417
return (

src/components/Header/H2.react.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ type Props = {|
99
+className?: string,
1010
|};
1111

12+
/**
13+
* A Header component rendered as a h2 HTML element with a margin below
14+
*/
1215
function H2({ className, children }: Props): React.Node {
1316
const classes: string = cn("mt-0 mb-4", className);
1417
return (

src/components/Header/H3.react.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ type Props = {|
99
+className?: string,
1010
|};
1111

12+
/**
13+
* A Header component rendered as a h3 HTML element with a margin below
14+
*/
1215
function H3({ className, children }: Props): React.Node {
1316
const classes: string = cn("mt-0 mb-4", className);
1417
return (

src/components/Header/H4.react.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ type Props = {|
99
+className?: string,
1010
|};
1111

12+
/**
13+
* A Header component rendered as a h4 HTML element with a margin below
14+
*/
1215
function H4({ className, children }: Props): React.Node {
1316
const classes: string = cn("mt-0 mb-4", className);
1417
return (

src/components/Header/H5.react.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ type Props = {|
99
+className?: string,
1010
|};
1111

12+
/**
13+
* A Header component rendered as a h5 HTML element with a margin below
14+
*/
1215
function H5({ className, children }: Props): React.Node {
1316
const classes: string = cn("mt-0 mb-4", className);
1417
return (

src/components/Header/H6.react.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ type Props = {|
99
+className?: string,
1010
|};
1111

12+
/**
13+
* A Header component rendered as a h6 HTML element with a margin below
14+
*/
1215
function H6({ className, children }: Props): React.Node {
1316
const classes: string = cn("mt-0 mb-4", className);
1417
return (

src/components/Header/Header.react.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type Props = {|
2525

2626
/**
2727
* A header
28+
* By default renders a div not a <hX> tag and has no additional spacing classes applied
2829
*/
2930
function Header({
3031
RootComponent,

src/components/Notification/NotificationTray.react.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function NotificationTray(props: Props): React.Node {
3333
position="bottom-end"
3434
arrow={true}
3535
arrowPosition="right"
36+
flex
3637
items={
3738
<React.Fragment>
3839
{(notifications &&

src/components/StampCard/StampCard.react.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ function StampCard({
2727
<div className="d-flex align-items-center">
2828
<Stamp color={color} icon={icon} className="mr-3" />
2929
<div>
30-
{header && <Header.H4 className="m-0">{header}</Header.H4>}
30+
{header && (
31+
<Header size={4} className="m-0">
32+
{header}
33+
</Header>
34+
)}
3135
{children}
3236
{footer && <Text.Small muted>{footer}</Text.Small>}
3337
</div>

src/components/Table/Table.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
.Table.table-responsive {
1+
.table-responsive {
22
overflow-x: inherit !important;
33
}

src/components/Table/Table.react.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,7 @@ function Table({
9696
</table>
9797
);
9898

99-
return !responsive ? (
100-
table
101-
) : (
102-
<div className="Table.table-responsive">{table}</div>
103-
);
99+
return !responsive ? table : <div className="table-responsive">{table}</div>;
104100
}
105101

106102
Table.defaultProps = {

0 commit comments

Comments
 (0)