summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/components
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-07-06 13:17:46 +0200
committerOskar Nyberg <oskar@mullvad.net>2021-07-12 10:09:19 +0200
commit17d77726bffdebd4977ff9d39d5ef60acaf861f1 (patch)
tree662dd298b064e994282dd33c5d0f229685e81663 /gui/src/renderer/components
parentf3191b3d5d50b6aec641d0d0167f86085eba31c1 (diff)
downloadmullvadvpn-17d77726bffdebd4977ff9d39d5ef60acaf861f1.tar.xz
mullvadvpn-17d77726bffdebd4977ff9d39d5ef60acaf861f1.zip
Update usages of platform and node env in renderer
Diffstat (limited to 'gui/src/renderer/components')
-rw-r--r--gui/src/renderer/components/AdvancedSettings.tsx4
-rw-r--r--gui/src/renderer/components/CustomScrollbars.tsx2
-rw-r--r--gui/src/renderer/components/HeaderBar.tsx2
-rw-r--r--gui/src/renderer/components/NavigationBarStyles.tsx2
-rw-r--r--gui/src/renderer/components/PlatformWindow.tsx2
-rw-r--r--gui/src/renderer/components/Preferences.tsx4
-rw-r--r--gui/src/renderer/components/SplitTunnelingSettings.tsx4
7 files changed, 10 insertions, 10 deletions
diff --git a/gui/src/renderer/components/AdvancedSettings.tsx b/gui/src/renderer/components/AdvancedSettings.tsx
index 77c815fe61..62232b6b8c 100644
--- a/gui/src/renderer/components/AdvancedSettings.tsx
+++ b/gui/src/renderer/components/AdvancedSettings.tsx
@@ -441,11 +441,11 @@ export default class AdvancedSettings extends React.Component<IProps, IState> {
</Cell.CellButton>
</StyledButtonCellGroup>
- {(window.platform === 'linux' || window.platform === 'win32') && (
+ {(window.env.platform === 'linux' || window.env.platform === 'win32') && (
<StyledButtonCellGroup>
<Cell.CellButton onClick={this.props.onViewSplitTunneling}>
<Cell.Label>
- {window.platform === 'win32' && <StyledBetaLabel />}
+ {window.env.platform === 'win32' && <StyledBetaLabel />}
{messages.pgettext('advanced-settings-view', 'Split tunneling')}
</Cell.Label>
<Cell.Icon height={12} width={7} source="icon-chevron" />
diff --git a/gui/src/renderer/components/CustomScrollbars.tsx b/gui/src/renderer/components/CustomScrollbars.tsx
index 2b5119839c..3dacd26626 100644
--- a/gui/src/renderer/components/CustomScrollbars.tsx
+++ b/gui/src/renderer/components/CustomScrollbars.tsx
@@ -47,7 +47,7 @@ interface IScrollbarUpdateContext {
export default class CustomScrollbars extends React.Component<IProps, IState> {
public static defaultProps: IProps = {
// auto-hide on macOS by default
- autoHide: window.platform === 'darwin',
+ autoHide: window.env.platform === 'darwin',
trackPadding: { x: 2, y: 2 },
};
diff --git a/gui/src/renderer/components/HeaderBar.tsx b/gui/src/renderer/components/HeaderBar.tsx
index f3a69f5af2..0dcd2e7ea9 100644
--- a/gui/src/renderer/components/HeaderBar.tsx
+++ b/gui/src/renderer/components/HeaderBar.tsx
@@ -31,7 +31,7 @@ interface IHeaderBarContainerProps {
const HeaderBarContainer = styled.header({}, (props: IHeaderBarContainerProps) => ({
padding: '12px 16px',
- paddingTop: window.platform === 'darwin' && !props.unpinnedWindow ? '24px' : '12px',
+ paddingTop: window.env.platform === 'darwin' && !props.unpinnedWindow ? '24px' : '12px',
backgroundColor: headerBarStyleColorMap[props.barStyle ?? HeaderBarStyle.default],
}));
diff --git a/gui/src/renderer/components/NavigationBarStyles.tsx b/gui/src/renderer/components/NavigationBarStyles.tsx
index f8ac87f3e2..52aefe323d 100644
--- a/gui/src/renderer/components/NavigationBarStyles.tsx
+++ b/gui/src/renderer/components/NavigationBarStyles.tsx
@@ -20,7 +20,7 @@ export const StyledNavigationItems = styled.div({
export const StyledNavigationBar = styled.nav((props: { unpinnedWindow: boolean }) => ({
flex: 0,
padding: '12px',
- paddingTop: window.platform === 'darwin' && !props.unpinnedWindow ? '24px' : '12px',
+ paddingTop: window.env.platform === 'darwin' && !props.unpinnedWindow ? '24px' : '12px',
}));
export const StyledNavigationBarWrapper = styled.div({
diff --git a/gui/src/renderer/components/PlatformWindow.tsx b/gui/src/renderer/components/PlatformWindow.tsx
index 83aa7b3f7f..9b18f5f726 100644
--- a/gui/src/renderer/components/PlatformWindow.tsx
+++ b/gui/src/renderer/components/PlatformWindow.tsx
@@ -10,7 +10,7 @@ interface IPlatformWindowProps {
export default styled.div({}, (props: IPlatformWindowProps) => {
let mask: string | undefined;
- if (window.platform === 'darwin' && !props.unpinnedWindow) {
+ if (window.env.platform === 'darwin' && !props.unpinnedWindow) {
const arrowPositionCss =
props.arrowPosition !== undefined ? `${props.arrowPosition - ARROW_WIDTH * 0.5}px` : '50%';
diff --git a/gui/src/renderer/components/Preferences.tsx b/gui/src/renderer/components/Preferences.tsx
index c91330aee0..ebaa2da359 100644
--- a/gui/src/renderer/components/Preferences.tsx
+++ b/gui/src/renderer/components/Preferences.tsx
@@ -225,8 +225,8 @@ export default class Preferences extends React.Component<IProps> {
</Cell.Footer>
</AriaInputGroup>
- {(window.platform === 'win32' ||
- (window.platform === 'darwin' && window.runningInDevelopment)) && (
+ {(window.env.platform === 'win32' ||
+ (window.env.platform === 'darwin' && window.env.development)) && (
<AriaInputGroup>
<Cell.Container>
<AriaLabel>
diff --git a/gui/src/renderer/components/SplitTunnelingSettings.tsx b/gui/src/renderer/components/SplitTunnelingSettings.tsx
index d6f2bbbdcf..30948dae35 100644
--- a/gui/src/renderer/components/SplitTunnelingSettings.tsx
+++ b/gui/src/renderer/components/SplitTunnelingSettings.tsx
@@ -102,13 +102,13 @@ interface IPlatformSplitTunnelingSettingsProps {
}
function PlatformSpecificSplitTunnelingSettings(props: IPlatformSplitTunnelingSettingsProps) {
- switch (window.platform) {
+ switch (window.env.platform) {
case 'linux':
return <LinuxSplitTunnelingSettings {...props} />;
case 'win32':
return <WindowsSplitTunnelingSettings {...props} />;
default:
- throw new Error(`Split tunneling not implemented on ${window.platform}`);
+ throw new Error(`Split tunneling not implemented on ${window.env.platform}`);
}
}