diff --git a/desktop/app/src/chrome/FpsGraph.tsx b/desktop/app/src/chrome/FpsGraph.tsx index 39f6364c6..befb7c5ae 100644 --- a/desktop/app/src/chrome/FpsGraph.tsx +++ b/desktop/app/src/chrome/FpsGraph.tsx @@ -83,7 +83,7 @@ export default function FpsGraph({ }, []); return ( -
+
+
); diff --git a/desktop/app/src/chrome/TitleBar.tsx b/desktop/app/src/chrome/TitleBar.tsx index 81b04a2a6..c773e59ce 100644 --- a/desktop/app/src/chrome/TitleBar.tsx +++ b/desktop/app/src/chrome/TitleBar.tsx @@ -101,7 +101,10 @@ const VersionText = styled(Text)({ }, }); -class Version extends React.Component<{children: string}, {copied: boolean}> { +export class Version extends React.Component< + {children: string}, + {copied: boolean} +> { state = { copied: false, }; diff --git a/desktop/app/src/sandy-chrome/TemporarilyTitlebar.tsx b/desktop/app/src/sandy-chrome/TemporarilyTitlebar.tsx index dbb2a015a..bee4b0e67 100644 --- a/desktop/app/src/sandy-chrome/TemporarilyTitlebar.tsx +++ b/desktop/app/src/sandy-chrome/TemporarilyTitlebar.tsx @@ -8,20 +8,24 @@ */ import React from 'react'; -import {connect} from 'react-redux'; -import {State as Store} from '../reducers'; -import {Settings, updateSettings} from '../reducers/settings'; +import {updateSettings} from '../reducers/settings'; import {styled, colors} from 'flipper'; -import {Button} from 'antd'; +import {Button, Space} from 'antd'; import {CloseCircleOutlined} from '@ant-design/icons'; +import FpsGraph from '../chrome/FpsGraph'; +import NetworkGraph from '../chrome/NetworkGraph'; +import isProduction from '../utils/isProduction'; +import {isAutoUpdaterEnabled} from '../utils/argvUtils'; +import AutoUpdateVersion from '../chrome/AutoUpdateVersion'; +import UpdateIndicator from '../chrome/UpdateIndicator'; +import RatingButton from '../chrome/RatingButton'; +import {Version} from '../chrome/TitleBar'; +import {useDispatch, useStore} from '../utils/useStore'; +import config from '../fb-stubs/config'; +import {remote} from 'electron'; -type StateFromProps = {settings: Settings}; -type DispatchFromProps = {disableSandy: (settings: Settings) => void}; -type OwnProps = {}; +const version = remote.app.getVersion(); -type Props = StateFromProps & DispatchFromProps & OwnProps; - -// This component should be dropped, and insetTitlebar should be removed from Electron startup once Sandy is the default const TemporarilyTitlebarContainer = styled('div')<{focused?: boolean}>( ({focused}) => ({ textAlign: 'center', @@ -37,29 +41,40 @@ const TemporarilyTitlebarContainer = styled('div')<{focused?: boolean}>( focused ? colors.macOSTitleBarBorder : colors.macOSTitleBarBorderBlur }`, WebkitAppRegion: 'drag', + display: 'flex', + flexDirection: 'row', + justifyContent: 'center', + alignItems: 'center', }), ); -export const TemporarilyTitlebar = connect< - StateFromProps, - DispatchFromProps, - OwnProps, - Store ->( - ({settingsState}) => ({settings: settingsState}), - (dispatch) => ({ - disableSandy: (settings: Settings) => { - console.log(settings); - dispatch(updateSettings({...settings, enableSandy: false})); - }, - }), -)((props: Props) => ( - - [Sandy] Flipper{' '} - - -)); +// This component should be dropped, and insetTitlebar should be removed from Electron startup once Sandy is the default +// But: figure out where to put the graphs, version numbers, flipper rating ets :) +export function TemporarilyTitlebar() { + const dispatch = useDispatch(); + const settings = useStore((state) => state.settingsState); + const launcherMsg = useStore((state) => state.application.launcherMsg); + const isFocused = useStore((state) => state.application.windowIsFocused); + + return ( + + [Sandy] Flipper{' '} + + {!isProduction() && } + {!isProduction() && } + {config.showFlipperRating ? : null} + {version + (isProduction() ? '' : '-dev')} + {isAutoUpdaterEnabled() ? ( + + ) : ( + + )} + + ); +}