Skip to content

Commit 65cc238

Browse files
authored
Merge pull request #216 from arangodb/fix/style-refactoring
Grouping style elements in 1 place
2 parents d229457 + 6f9dcd0 commit 65cc238

12 files changed

+88
-156
lines changed

dashboard/assets.go

+46-46
Large diffs are not rendered by default.

dashboard/src/deployment/DeploymentDetails.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
import { Loader } from 'semantic-ui-react';
22
import React, { Component } from 'react';
33
import ReactTimeout from 'react-timeout';
4-
import styled from 'react-emotion';
54

5+
import { LoaderBox } from '../style/style';
66
import { withAuth } from '../auth/Auth.js';
77
import api, { isUnauthorized } from '../api/api';
88
import Loading from '../util/Loading';
99
import MemberList from './MemberList';
1010

11-
const LoaderBox = styled('span')`
12-
float: right;
13-
width: 0;
14-
padding-right: 1em;
15-
margin-right: 1em;
16-
margin-top: 1em;
17-
max-width: 0;
18-
display: inline-block;
19-
`;
20-
2111
const MemberGroupsView = ({memberGroups, namespace}) => (
2212
<div>
2313
{memberGroups.map((item) => <MemberList

dashboard/src/deployment/DeploymentList.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,13 @@ import { Icon, Loader, Popup, Table } from 'semantic-ui-react';
22
import { Link } from "react-router-dom";
33
import React, { Component } from 'react';
44
import ReactTimeout from 'react-timeout';
5-
import styled from 'react-emotion';
65

6+
import { LoaderBoxForTable as LoaderBox } from '../style/style';
77
import { withAuth } from '../auth/Auth';
88
import api, { isUnauthorized } from '../api/api';
99
import CommandInstruction from '../util/CommandInstruction';
1010
import Loading from '../util/Loading';
1111

12-
const LoaderBox = styled('span')`
13-
float: right;
14-
width: 0;
15-
padding-right: 1em;
16-
max-width: 0;
17-
display: inline-block;
18-
`;
19-
2012
const HeaderView = ({loading}) => (
2113
<Table.Header>
2214
<Table.Row>

dashboard/src/deployment/DeploymentOperator.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
11
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
22
import { Header, Menu, Message, Segment } from 'semantic-ui-react';
33
import React, { Component } from 'react';
4-
import styled from 'react-emotion';
54

5+
import { StyledMenu, StyledContentBox } from '../style/style';
66
import DeploymentDetails from './DeploymentDetails';
77
import DeploymentList from './DeploymentList';
88
import LogoutContext from '../auth/LogoutContext';
99

10-
const StyledMenu = styled(Menu)`
11-
width: 15rem !important;
12-
@media (max-width: 768px) {
13-
width: 10rem !important;
14-
}
15-
`;
16-
17-
const StyledContentBox = styled('div')`
18-
margin-left: 15rem;
19-
@media (max-width: 768px) {
20-
margin-left: 10rem;
21-
}
22-
`;
23-
2410
const ListView = () => (
2511
<div>
2612
<Header dividing>

dashboard/src/logo.svg

-7
This file was deleted.

dashboard/src/replication/DeploymentReplicationDetails.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
import { Header, Loader, Segment } from 'semantic-ui-react';
22
import React, { Component } from 'react';
33
import ReactTimeout from 'react-timeout';
4-
import styled from 'react-emotion';
54

65
import { Field, FieldContent as FC, FieldLabel as FL } from '../style/style';
6+
import { LoaderBox } from '../style/style';
77
import { withAuth } from '../auth/Auth';
88
import api, { isUnauthorized } from '../api/api';
99
import Loading from '../util/Loading';
1010

11-
const LoaderBox = styled('span')`
12-
float: right;
13-
width: 0;
14-
padding-right: 1em;
15-
margin-right: 1em;
16-
margin-top: 1em;
17-
max-width: 0;
18-
display: inline-block;
19-
`;
20-
2111
const EndpointView = ({title, deploymentName, masterEndpoint, authKeyfileSecretName, authUserSecretName, tlsCACert, tlsCACertSecretName}) => (
2212
<Segment>
2313
<Header>{title}</Header>

dashboard/src/replication/DeploymentReplicationList.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,13 @@ import { Icon, Loader, Popup, Table } from 'semantic-ui-react';
22
import { Link } from "react-router-dom";
33
import React, { Component } from 'react';
44
import ReactTimeout from 'react-timeout';
5-
import styled from 'react-emotion';
65

6+
import { LoaderBoxForTable as LoaderBox } from '../style/style';
77
import { withAuth } from '../auth/Auth';
88
import api, { isUnauthorized } from '../api/api';
99
import CommandInstruction from '../util/CommandInstruction';
1010
import Loading from '../util/Loading';
1111

12-
const LoaderBox = styled('span')`
13-
float: right;
14-
width: 0;
15-
padding-right: 1em;
16-
max-width: 0;
17-
display: inline-block;
18-
`;
19-
2012
const HeaderView = ({loading}) => (
2113
<Table.Header>
2214
<Table.Row>

dashboard/src/replication/DeploymentReplicationOperator.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
11
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
22
import { Header, Menu, Message, Segment } from 'semantic-ui-react';
33
import React, { Component } from 'react';
4-
import styled from 'react-emotion';
54

5+
import { StyledMenu, StyledContentBox } from '../style/style';
66
import DeploymentReplicationDetails from './DeploymentReplicationDetails';
77
import DeploymentReplicationList from './DeploymentReplicationList';
88
import LogoutContext from '../auth/LogoutContext';
99

10-
const StyledMenu = styled(Menu)`
11-
width: 15rem !important;
12-
@media (max-width: 768px) {
13-
width: 10rem !important;
14-
}
15-
`;
16-
17-
const StyledContentBox = styled('div')`
18-
margin-left: 15rem;
19-
@media (max-width: 768px) {
20-
margin-left: 10rem;
21-
}
22-
`;
23-
2410
const ListView = () => (
2511
<div>
2612
<Header dividing>

dashboard/src/storage/StorageList.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
import { Loader, Table } from 'semantic-ui-react';
22
import React, { Component } from 'react';
33
import ReactTimeout from 'react-timeout';
4-
import styled from 'react-emotion';
54

5+
import { LoaderBoxForTable as LoaderBox } from '../style/style';
66
import { withAuth } from '../auth/Auth';
77
import api, { isUnauthorized } from '../api/api';
88
import Loading from '../util/Loading';
99
import StorageRow from './StorageRow';
1010

11-
const LoaderBox = styled('span')`
12-
float: right;
13-
width: 0;
14-
padding-right: 1em;
15-
max-width: 0;
16-
display: inline-block;
17-
`;
18-
1911
const HeaderView = ({loading}) => (
2012
<Table.Header>
2113
<Table.Row>

dashboard/src/storage/StorageOperator.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
11
import { Header, Menu, Message, Segment } from 'semantic-ui-react';
22
import React, { Component } from 'react';
3-
import styled from 'react-emotion';
43

4+
import { StyledMenu, StyledContentBox } from '../style/style';
55
import LogoutContext from '../auth/LogoutContext';
66
import StorageList from './StorageList';
77

8-
const StyledMenu = styled(Menu)`
9-
width: 15rem !important;
10-
@media (max-width: 768px) {
11-
width: 10rem !important;
12-
}
13-
`;
14-
15-
const StyledContentBox = styled('div')`
16-
margin-left: 15rem;
17-
@media (max-width: 768px) {
18-
margin-left: 10rem;
19-
}
20-
`;
21-
228
const ListView = () => (
239
<div>
2410
<Header dividing>

dashboard/src/storage/VolumeList.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
import { Icon, Loader, Popup, Table } from 'semantic-ui-react';
22
import React, { Component } from 'react';
33
import ReactTimeout from 'react-timeout';
4-
import styled from 'react-emotion';
54

5+
import { LoaderBoxForTable as LoaderBox } from '../style/style';
66
import { withAuth } from '../auth/Auth';
77
import api, { isUnauthorized } from '../api/api';
88
import CommandInstruction from '../util/CommandInstruction';
99
import Loading from '../util/Loading';
1010

11-
const LoaderBox = styled('span')`
12-
float: right;
13-
width: 0;
14-
padding-right: 1em;
15-
max-width: 0;
16-
display: inline-block;
17-
`;
18-
1911
const HeaderView = ({loading}) => (
2012
<Table.Header>
2113
<Table.Row>

dashboard/src/style/style.js

+33
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import styled from 'react-emotion';
2+
import { Menu } from 'semantic-ui-react';
23

34
export const Field = styled('div')`
45
padding-top: 0.3em;
@@ -19,3 +20,35 @@ export const FieldContent = styled('div')`
1920
export const FieldIcons = styled('div')`
2021
float: right;
2122
`;
23+
24+
export const LoaderBox = styled('span')`
25+
float: right;
26+
width: 0;
27+
padding-right: 1em;
28+
margin-right: 1em;
29+
margin-top: 1em;
30+
max-width: 0;
31+
display: inline-block;
32+
`;
33+
34+
export const LoaderBoxForTable = styled('span')`
35+
float: right;
36+
width: 0;
37+
padding-right: 1em;
38+
max-width: 0;
39+
display: inline-block;
40+
`;
41+
42+
export const StyledMenu = styled(Menu)`
43+
width: 15rem !important;
44+
@media (max-width: 768px) {
45+
width: 10rem !important;
46+
}
47+
`;
48+
49+
export const StyledContentBox = styled('div')`
50+
margin-left: 15rem;
51+
@media (max-width: 768px) {
52+
margin-left: 10rem;
53+
}
54+
`;

0 commit comments

Comments
 (0)