Skip to content

Commit 3c4c5d6

Browse files
author
Lucas Araujo
committed
[DDW-863] Remove absolute position styles
1 parent 9d76870 commit 3c4c5d6

File tree

9 files changed

+33
-53
lines changed

9 files changed

+33
-53
lines changed

source/renderer/app/components/layout/TopBar.scss

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
display: flex;
3131
flex-direction: column;
3232
font-family: var(--font-regular);
33-
max-width: 60%;
33+
overflow: hidden;
3434
text-align: center;
3535
user-select: text;
3636

@@ -64,6 +64,7 @@
6464
align-items: center;
6565
cursor: pointer;
6666
display: flex;
67+
flex-shrink: 0;
6768
height: 50px;
6869
justify-content: center;
6970
width: 50px;
@@ -82,23 +83,15 @@
8283
.topBarTitle {
8384
align-items: center;
8485
display: flex;
85-
flex-grow: 1;
8686
justify-content: center;
87-
left: 70px;
88-
position: absolute;
89-
width: calc(100% - 230px);
87+
margin: auto;
88+
min-width: 0;
89+
padding-left: 26px;
9090
}
9191

9292
.rectangle {
93-
&.hasTadaIcon {
94-
right: 220px;
95-
}
96-
97-
background-color: var(--theme-node-sync-icon-color);
93+
border-right: 1px solid var(--theme-node-sync-icon-color);
9894
height: 12px;
9995
opacity: 0.3;
100-
position: absolute;
101-
right: 162px;
102-
width: 1px;
10396
}
10497
}

source/renderer/app/components/loading/syncing-connecting/SyncingConnecting.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,14 @@ export default class SyncingConnecting extends Component<Props, State> {
188188
/>
189189
)}
190190
{showNewsFeedIcon && (
191-
<NewsFeedIcon
192-
onNewsFeedIconClick={onToggleNewsFeedIconClick}
193-
newsFeedIconClass={newsFeedIconStyles}
194-
hasNotification={hasNotification}
195-
hasUpdate={hasUpdate}
196-
/>
191+
<div className={styles.newsFeedContainer}>
192+
<NewsFeedIcon
193+
onNewsFeedIconClick={onToggleNewsFeedIconClick}
194+
newsFeedIconClass={newsFeedIconStyles}
195+
hasNotification={hasNotification}
196+
hasUpdate={hasUpdate}
197+
/>
198+
</div>
197199
)}
198200
<LogosDisplay isConnected={isConnected} />
199201
</div>

source/renderer/app/components/loading/syncing-connecting/SyncingConnecting.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
z-index: 2000;
1414
}
1515

16+
.newsFeedContainer {
17+
display: flex;
18+
justify-content: flex-end;
19+
padding-right: 29px;
20+
padding-top: 20px;
21+
position: absolute;
22+
width: 100%;
23+
}
24+
1625
:global {
1726
.connectingScreen {
1827
span svg path {

source/renderer/app/components/widgets/NewsFeedIcon.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
.component {
2-
position: absolute;
3-
right: 29px;
4-
top: 20px;
2+
position: relative;
53

64
&.notificationDot {
75
@extend .dot;

source/renderer/app/components/widgets/NodeSyncStatusIcon.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
.component {
2+
margin: 0 40px;
23
overflow: visible;
3-
position: absolute;
4-
right: 202px;
5-
6-
&.hasTadaIcon {
7-
right: 260px;
8-
}
94

105
&:hover {
116
.info {

source/renderer/app/components/widgets/TadaButton.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.component {
22
cursor: pointer;
33
font-size: 19px;
4-
position: absolute;
5-
right: 94px;
4+
margin-left: 8px;
5+
margin-right: 20px;
66
transform-origin: bottom left;
77
&.animate {
88
animation: animation 0.7s cubic-bezier(0.7, 0, 0.24, 1.01) infinite;

source/renderer/app/containers/TopBarContainer.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// @flow
22
import React from 'react';
33
import { observer, inject } from 'mobx-react';
4-
import classnames from 'classnames';
54
import TopBar from '../components/layout/TopBar';
65
import NodeSyncStatusIcon from '../components/widgets/NodeSyncStatusIcon';
76
import { DiscreetToggleTopBar } from '../features/discreet-mode';
@@ -94,18 +93,9 @@ const TopBarContainer = (
9493
isShelleyActivated={isShelleyActivated}
9594
>
9695
{testnetLabel}
97-
<NodeSyncStatusIcon
98-
isSynced={isSynced}
99-
syncPercentage={syncPercentage}
100-
hasTadaIcon={shouldShowTadaIcon}
101-
/>
102-
<span
103-
className={classnames(
104-
topBarStyles.rectangle,
105-
shouldShowTadaIcon && topBarStyles.hasTadaIcon
106-
)}
107-
/>
108-
<DiscreetToggleTopBar hasTadaIcon={shouldShowTadaIcon} />
96+
<NodeSyncStatusIcon isSynced={isSynced} syncPercentage={syncPercentage} />
97+
<span className={topBarStyles.rectangle} />
98+
<DiscreetToggleTopBar />
10999
{shouldShowTadaIcon && (
110100
<TadaButton
111101
onClick={onClickTadaButton}

source/renderer/app/features/discreet-mode/ui/discreet-toggle-top-bar/DiscreetToggleTopBar.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @flow
22
import React, { useState } from 'react';
3-
import classnames from 'classnames';
43
import { observer } from 'mobx-react';
54
import { PopOver } from 'react-polymorph/lib/components/PopOver';
65
import { injectIntl, FormattedHTMLMessage } from 'react-intl';
@@ -12,10 +11,9 @@ import type { Intl } from '../../../../types/i18nTypes';
1211

1312
type Props = {
1413
intl: Intl,
15-
hasTadaIcon?: boolean,
1614
};
1715

18-
const DiscreetToggleTopBar = ({ intl, hasTadaIcon }: Props) => {
16+
const DiscreetToggleTopBar = ({ intl }: Props) => {
1917
const {
2018
isDiscreetMode,
2119
isSettingsTooltipEnabled,
@@ -27,7 +25,7 @@ const DiscreetToggleTopBar = ({ intl, hasTadaIcon }: Props) => {
2725

2826
return (
2927
<div
30-
className={classnames(styles.root, hasTadaIcon && styles.hasTadaIcon)}
28+
className={styles.root}
3129
onMouseEnter={() => setVisible(true)}
3230
onMouseLeave={() => setVisible(false)}
3331
>

source/renderer/app/features/discreet-mode/ui/discreet-toggle-top-bar/DiscreetToggleTopBar.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
.root {
2-
position: absolute;
3-
right: 91px;
4-
5-
&.hasTadaIcon {
6-
right: 149px;
7-
}
2+
margin: 0 28px;
83

94
.discreetToggle {
105
border-radius: 50%;

0 commit comments

Comments
 (0)