Move title bar functionality to rail (#1816)
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/1816 Now that Sandy is the default in OSS builds as well, we can remove the temporarily title bar and switch to small topbar windows in Electron. This diff removes any remaining elements in the titlebar - version number went into the title bar - the update check warning is shown on top of the bottom section of the left rail (orange triangle) - the development only perf graphs are moved to the left bar as well and are now aligned vertically. Reviewed By: jknoxville Differential Revision: D25805957 fbshipit-source-id: fba4b60c246b8f5d99a93087af31af9ac55defe8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
bd6c5c0f71
commit
ffeb47ed75
@@ -8,8 +8,8 @@
|
||||
*/
|
||||
|
||||
import {LauncherMsg} from '../reducers/application';
|
||||
import {colors, FlexRow, Glyph, styled} from '../ui';
|
||||
import Tooltip from '../ui/components/Tooltip';
|
||||
import {FlexRow, Glyph, styled} from '../ui';
|
||||
import {Tooltip} from 'antd';
|
||||
import isProduction from '../utils/isProduction';
|
||||
import {
|
||||
checkForUpdate,
|
||||
@@ -20,10 +20,13 @@ import React from 'react';
|
||||
import {shell} from 'electron';
|
||||
import config from '../utils/processConfig';
|
||||
import fbConfig from '../fb-stubs/config';
|
||||
import {useStore} from '../utils/useStore';
|
||||
import {remote} from 'electron';
|
||||
import {theme} from 'flipper-plugin';
|
||||
const version = remote.app.getVersion();
|
||||
|
||||
const Container = styled(FlexRow)({
|
||||
alignItems: 'center',
|
||||
marginLeft: 4,
|
||||
});
|
||||
|
||||
type Props = {
|
||||
@@ -38,13 +41,13 @@ type State = {
|
||||
function getSeverityColor(severity: 'warning' | 'error'): string {
|
||||
switch (severity) {
|
||||
case 'warning':
|
||||
return colors.light30;
|
||||
return theme.warningColor;
|
||||
case 'error':
|
||||
return colors.cherry;
|
||||
return theme.errorColor;
|
||||
}
|
||||
}
|
||||
|
||||
export default class UpdateIndicator extends React.PureComponent<Props, State> {
|
||||
class UpdateIndicatorImpl extends React.PureComponent<Props, State> {
|
||||
state = {
|
||||
versionCheckResult: {kind: 'up-to-date'} as VersionCheckResult,
|
||||
};
|
||||
@@ -87,7 +90,7 @@ export default class UpdateIndicator extends React.PureComponent<Props, State> {
|
||||
);
|
||||
return (
|
||||
<Tooltip
|
||||
options={{position: 'toLeft'}}
|
||||
placement="right"
|
||||
title={`Update to Flipper v${result.version} available. Click to download.`}
|
||||
children={container}
|
||||
/>
|
||||
@@ -119,3 +122,8 @@ export default class UpdateIndicator extends React.PureComponent<Props, State> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default function UpdateIndicator() {
|
||||
const launcherMsg = useStore((state) => state.application.launcherMsg);
|
||||
return <UpdateIndicatorImpl launcherMsg={launcherMsg} version={version} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user