Skip to content

Commit aa5b33f

Browse files
committed
Fix responsive looks for tables
1 parent 8afe556 commit aa5b33f

File tree

4 files changed

+35
-11
lines changed

4 files changed

+35
-11
lines changed

src/components/Table/Table.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ export const Table = ({ data, columns }: ITableProps) => {
1818

1919
return (
2020
<div className="table-wrapper">
21-
<AutoSizer>
22-
{({width, height}) => (
21+
<AutoSizer disableHeight>
22+
{({width}) => (
2323
<RTable
2424
headerClassName="table-custom-header"
2525
rowClassName={getRowClassName}
2626
gridClassName="table-custom-grid"
2727
width={width}
28-
height={height || 400}
28+
height={400}
2929
headerHeight={80}
3030
rowHeight={56}
3131
rowCount={data.length}

src/components/Table/table.scss

+6
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@
1717
display: flex;
1818
justify-content: center;
1919
align-items: center;
20+
21+
.ReactVirtualized__Table__headerTruncatedText {
22+
white-space: pre-wrap;
23+
text-align: center;
24+
}
2025
}
2126

2227
.table-custom-grid {
2328
background-color: $container;
29+
border-radius: 0 0 8px 8px;
2430
}
2531

2632
.table-custom-row {

src/containers/Dashboard/dashboard.scss

+16-7
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,28 @@ body {
4242
}
4343

4444
.column.left .container {
45-
margin-right: 0.67rem;
45+
@media #{$mq-medium} {
46+
margin-right: 0.67rem;
47+
}
4648
}
4749

4850
.column.right .container {
49-
margin-left: 0.67rem;
51+
@media #{$mq-medium} {
52+
margin-left: 0.67rem;
53+
}
5054
}
5155

5256
.tables {
5357
display: flex;
5458
flex-direction: column;
59+
margin-bottom: 2rem;
5560

5661
@media #{$mq-medium} {
5762
flex-direction: row;
5863
}
5964

6065
.table-wrapper {
61-
height: 20rem;
62-
63-
@media #{$mq-medium} {
64-
height: auto;
65-
}
66+
height: auto;
6667
}
6768

6869
.left {
@@ -77,6 +78,14 @@ body {
7778
display: flex;
7879
flex: 1;
7980
}
81+
82+
.right {
83+
margin-top: 2.67rem;
84+
85+
@media #{$mq-medium} {
86+
margin-top: 0;
87+
}
88+
}
8089
}
8190
}
8291

src/containers/Login/LoginForm.tsx

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
import React from "react";
2+
import { useHistory } from "react-router-dom";
3+
24
import {Input} from "../../components/Input/Input";
35
import {Button} from "../../components/Button/Button";
6+
import {Routes} from "../../constants/routes";
47

58
export const LoginForm = () => {
9+
const history = useHistory();
10+
11+
const onClick = () => {
12+
history.push(Routes.DASHBOARD_ROUTE);
13+
};
14+
615
return (
716
<form>
817
<Input placeholder="Email" icon="email" />
918
<Input placeholder="Password" icon="lock" />
1019

11-
<Button type="primary">Login</Button>
20+
<Button type="primary" onClick={onClick}>Login</Button>
1221
</form>
1322
);
1423
};

0 commit comments

Comments
 (0)