diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-07-20 17:04:32 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-07-20 17:04:32 +0200 |
| commit | 37d64e43949a4f3be69cd802ea2f2f20ab98c1b4 (patch) | |
| tree | 5f9c439a775a4f7ba59017244a28022371faa218 /app | |
| parent | 25186fc12514e6ec061252bdef2964bb3d21b36d (diff) | |
| download | mullvadvpn-37d64e43949a4f3be69cd802ea2f2f20ab98c1b4.tar.xz mullvadvpn-37d64e43949a4f3be69cd802ea2f2f20ab98c1b4.zip | |
Migrate PlatformWindow to ReactXP
Diffstat (limited to 'app')
| -rw-r--r-- | app/assets/css/style.css | 1 | ||||
| -rw-r--r-- | app/components/PlatformWindow.css | 13 | ||||
| -rw-r--r-- | app/components/PlatformWindow.js | 14 |
3 files changed, 8 insertions, 20 deletions
diff --git a/app/assets/css/style.css b/app/assets/css/style.css index 22d8c1f046..c81dbe4c01 100644 --- a/app/assets/css/style.css +++ b/app/assets/css/style.css @@ -4,6 +4,5 @@ @import 'global.css'; /* app */ -@import '../../components/PlatformWindow.css'; @import '../../components/CustomScrollbars.css'; @import '../../components/Switch.css'; diff --git a/app/components/PlatformWindow.css b/app/components/PlatformWindow.css deleted file mode 100644 index 2c6b820a40..0000000000 --- a/app/components/PlatformWindow.css +++ /dev/null @@ -1,13 +0,0 @@ -/* macOS app runs as menubar; create an app chrome with arrow using mask */ -.window-chrome--darwin { - -webkit-mask: - url(../assets/images/app-triangle.svg) 50% 0% no-repeat, - url(../assets/images/app-header-backdrop.svg) no-repeat; -} - -.window-chrome { - flex: 1 1 auto; - height: 100%; - width: 100%; - display: flex; -}
\ No newline at end of file diff --git a/app/components/PlatformWindow.js b/app/components/PlatformWindow.js index 60f26dd6de..e54ce969e0 100644 --- a/app/components/PlatformWindow.js +++ b/app/components/PlatformWindow.js @@ -1,13 +1,15 @@ // @flow import * as React from 'react'; +import { Component, View, Styles } from 'reactxp'; -type Props = { - children?: React.Node, -}; +const platformWindowStyle = Styles.createViewStyle({ + WebkitMask: ` + url(./assets/images/app-triangle.svg) 50% 0% no-repeat, + url(./assets/images/app-header-backdrop.svg) no-repeat`, +}); -export default class PlatformWindow extends React.Component<Props> { +export default class PlatformWindow extends Component { render() { - const chromeClass = ['window-chrome', 'window-chrome--' + process.platform]; - return <div className={chromeClass.join(' ')}>{this.props.children}</div>; + return <View style={platformWindowStyle}>{this.props.children}</View>; } } |
