diff options
author | 2019-09-07 15:50:23 +0200 | |
---|---|---|
committer | 2019-09-07 15:50:23 +0200 | |
commit | e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e (patch) | |
tree | b8314e4155503b135dcb07e8b4a0e847e25c19cf /src/components/layout | |
parent | Update CHANGELOG.md (diff) | |
parent | Update CHANGELOG.md (diff) | |
download | ferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.tar.gz ferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.tar.zst ferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.zip |
Merge branch 'master' of https://github.com/meetfranz/franz into franz-5.3.0
Diffstat (limited to 'src/components/layout')
-rw-r--r-- | src/components/layout/AppLayout.js | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 5c3d301e0..ed004d07e 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js | |||
@@ -16,6 +16,8 @@ import { isWindows } from '../../environment'; | |||
16 | import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; | 16 | import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; |
17 | import { workspaceStore } from '../../features/workspaces'; | 17 | import { workspaceStore } from '../../features/workspaces'; |
18 | import AppUpdateInfoBar from '../AppUpdateInfoBar'; | 18 | import AppUpdateInfoBar from '../AppUpdateInfoBar'; |
19 | import TrialActivationInfoBar from '../TrialActivationInfoBar'; | ||
20 | import Todos from '../../features/todos/containers/TodosScreen'; | ||
19 | 21 | ||
20 | function createMarkup(HTMLString) { | 22 | function createMarkup(HTMLString) { |
21 | return { __html: HTMLString }; | 23 | return { __html: HTMLString }; |
@@ -42,7 +44,8 @@ const messages = defineMessages({ | |||
42 | 44 | ||
43 | const styles = theme => ({ | 45 | const styles = theme => ({ |
44 | appContent: { | 46 | appContent: { |
45 | width: `calc(100% + ${theme.workspaces.drawer.width}px)`, | 47 | // width: `calc(100% + ${theme.workspaces.drawer.width}px)`, |
48 | width: '100%', | ||
46 | transition: 'transform 0.5s ease', | 49 | transition: 'transform 0.5s ease', |
47 | transform() { | 50 | transform() { |
48 | return workspaceStore.isWorkspaceDrawerOpen ? 'translateX(0)' : `translateX(-${theme.workspaces.drawer.width}px)`; | 51 | return workspaceStore.isWorkspaceDrawerOpen ? 'translateX(0)' : `translateX(-${theme.workspaces.drawer.width}px)`; |
@@ -60,7 +63,6 @@ class AppLayout extends Component { | |||
60 | services: PropTypes.element.isRequired, | 63 | services: PropTypes.element.isRequired, |
61 | children: PropTypes.element, | 64 | children: PropTypes.element, |
62 | news: MobxPropTypes.arrayOrObservableArray.isRequired, | 65 | news: MobxPropTypes.arrayOrObservableArray.isRequired, |
63 | // isOnline: PropTypes.bool.isRequired, | ||
64 | showServicesUpdatedInfoBar: PropTypes.bool.isRequired, | 66 | showServicesUpdatedInfoBar: PropTypes.bool.isRequired, |
65 | appUpdateIsDownloaded: PropTypes.bool.isRequired, | 67 | appUpdateIsDownloaded: PropTypes.bool.isRequired, |
66 | nextAppReleaseVersion: PropTypes.string, | 68 | nextAppReleaseVersion: PropTypes.string, |
@@ -72,6 +74,8 @@ class AppLayout extends Component { | |||
72 | areRequiredRequestsSuccessful: PropTypes.bool.isRequired, | 74 | areRequiredRequestsSuccessful: PropTypes.bool.isRequired, |
73 | retryRequiredRequests: PropTypes.func.isRequired, | 75 | retryRequiredRequests: PropTypes.func.isRequired, |
74 | areRequiredRequestsLoading: PropTypes.bool.isRequired, | 76 | areRequiredRequestsLoading: PropTypes.bool.isRequired, |
77 | isDelayAppScreenVisible: PropTypes.bool.isRequired, | ||
78 | hasActivatedTrial: PropTypes.bool.isRequired, | ||
75 | }; | 79 | }; |
76 | 80 | ||
77 | static defaultProps = { | 81 | static defaultProps = { |
@@ -91,7 +95,6 @@ class AppLayout extends Component { | |||
91 | sidebar, | 95 | sidebar, |
92 | services, | 96 | services, |
93 | children, | 97 | children, |
94 | // isOnline, | ||
95 | news, | 98 | news, |
96 | showServicesUpdatedInfoBar, | 99 | showServicesUpdatedInfoBar, |
97 | appUpdateIsDownloaded, | 100 | appUpdateIsDownloaded, |
@@ -104,6 +107,8 @@ class AppLayout extends Component { | |||
104 | areRequiredRequestsSuccessful, | 107 | areRequiredRequestsSuccessful, |
105 | retryRequiredRequests, | 108 | retryRequiredRequests, |
106 | areRequiredRequestsLoading, | 109 | areRequiredRequestsLoading, |
110 | isDelayAppScreenVisible, | ||
111 | hasActivatedTrial, | ||
107 | } = this.props; | 112 | } = this.props; |
108 | 113 | ||
109 | const { intl } = this.context; | 114 | const { intl } = this.context; |
@@ -125,29 +130,31 @@ class AppLayout extends Component { | |||
125 | sticky={item.sticky} | 130 | sticky={item.sticky} |
126 | onHide={() => removeNewsItem({ newsId: item.id })} | 131 | onHide={() => removeNewsItem({ newsId: item.id })} |
127 | > | 132 | > |
128 | <span dangerouslySetInnerHTML={createMarkup(item.message)} /> | 133 | <span |
134 | dangerouslySetInnerHTML={createMarkup(item.message)} | ||
135 | onClick={(event) => { | ||
136 | const { target } = event; | ||
137 | if (target && target.hasAttribute('data-is-news-cta')) { | ||
138 | removeNewsItem({ newsId: item.id }); | ||
139 | } | ||
140 | }} | ||
141 | /> | ||
129 | </InfoBar> | 142 | </InfoBar> |
130 | ))} | 143 | ))} |
131 | {/* {!isOnline && ( | 144 | {hasActivatedTrial && ( |
132 | <InfoBar | 145 | <TrialActivationInfoBar /> |
133 | type="danger" | 146 | )} |
134 | sticky | ||
135 | > | ||
136 | <span className="mdi mdi-flash" /> | ||
137 | {intl.formatMessage(globalMessages.notConnectedToTheInternet)} | ||
138 | </InfoBar> | ||
139 | )} */} | ||
140 | {!areRequiredRequestsSuccessful && showRequiredRequestsError && ( | 147 | {!areRequiredRequestsSuccessful && showRequiredRequestsError && ( |
141 | <InfoBar | 148 | <InfoBar |
142 | type="danger" | 149 | type="danger" |
143 | ctaLabel="Try again" | 150 | ctaLabel="Try again" |
144 | ctaLoading={areRequiredRequestsLoading} | 151 | ctaLoading={areRequiredRequestsLoading} |
145 | sticky | 152 | sticky |
146 | onClick={retryRequiredRequests} | 153 | onClick={retryRequiredRequests} |
147 | > | 154 | > |
148 | <span className="mdi mdi-flash" /> | 155 | <span className="mdi mdi-flash" /> |
149 | {intl.formatMessage(messages.requiredRequestsFailed)} | 156 | {intl.formatMessage(messages.requiredRequestsFailed)} |
150 | </InfoBar> | 157 | </InfoBar> |
151 | )} | 158 | )} |
152 | {authRequestFailed && ( | 159 | {authRequestFailed && ( |
153 | <InfoBar | 160 | <InfoBar |
@@ -183,6 +190,7 @@ class AppLayout extends Component { | |||
183 | {services} | 190 | {services} |
184 | {children} | 191 | {children} |
185 | </div> | 192 | </div> |
193 | <Todos /> | ||
186 | </div> | 194 | </div> |
187 | </div> | 195 | </div> |
188 | </ErrorBoundary> | 196 | </ErrorBoundary> |