tweak Doctor modal footer UI, replace deprecated UI components (#3331)
Summary: This PR fixes the unaligned checkbox in the Doctor modal (I have based the solution of the Settings modal code) and also replaces deprecated components `FlexRow` and `FlexColumn` in Settings modal. ## Changelog * fix checkbox placement in the Doctor modal footer Pull Request resolved: https://github.com/facebook/flipper/pull/3331 Test Plan: The change has been testes by running the desktop Flipper app locally from source. ## Preview (before & after) <img width="596" alt="Screenshot 2022-01-23 at 16 01 48" src="https://user-images.githubusercontent.com/719641/150685091-ce494847-eea6-4263-900a-2b5541d3d897.png"> <img width="596" alt="Screenshot 2022-01-23 at 16 01 44" src="https://user-images.githubusercontent.com/719641/150685096-29723d14-6cfc-42aa-9564-431a61b1061d.png"> Reviewed By: aigoncharov Differential Revision: D33738683 Pulled By: lblasa fbshipit-source-id: 900657d6cb095d6d32dd412205e714a46e64a564
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d897cfd765
commit
41950946a2
@@ -17,7 +17,7 @@ import {
|
|||||||
QuestionCircleFilled,
|
QuestionCircleFilled,
|
||||||
LoadingOutlined,
|
LoadingOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import {Layout} from '../ui';
|
import {Layout, styled} from '../ui';
|
||||||
import {theme} from 'flipper-plugin';
|
import {theme} from 'flipper-plugin';
|
||||||
import {
|
import {
|
||||||
startHealthchecks,
|
startHealthchecks,
|
||||||
@@ -161,6 +161,11 @@ function HealthCheckList(props: {report: FlipperDoctor.HealthcheckReport}) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const FooterContainer = styled(Layout.Horizontal)({
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
});
|
||||||
|
|
||||||
function SetupDoctorFooter(props: {
|
function SetupDoctorFooter(props: {
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
onRerunDoctor: () => Promise<void>;
|
onRerunDoctor: () => Promise<void>;
|
||||||
@@ -172,14 +177,15 @@ function SetupDoctorFooter(props: {
|
|||||||
return (
|
return (
|
||||||
<Layout.Right>
|
<Layout.Right>
|
||||||
{props.showAcknowledgeCheckbox ? (
|
{props.showAcknowledgeCheckbox ? (
|
||||||
|
<FooterContainer>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={props.acknowledgeCheck}
|
checked={props.acknowledgeCheck}
|
||||||
onChange={(e) => props.onAcknowledgeCheck(e.target.checked)}
|
onChange={(e) => props.onAcknowledgeCheck(e.target.checked)}>
|
||||||
style={{display: 'flex', alignItems: 'center'}}>
|
|
||||||
<Text style={{fontSize: theme.fontSize.small}}>
|
<Text style={{fontSize: theme.fontSize.small}}>
|
||||||
Do not show warning about these problems at startup
|
Do not show warning about these problems at startup
|
||||||
</Text>
|
</Text>
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
|
</FooterContainer>
|
||||||
) : (
|
) : (
|
||||||
<Layout.Container />
|
<Layout.Container />
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {cloneElement} from 'react';
|
import React, {cloneElement} from 'react';
|
||||||
import {styled, FlexRow, FlexColumn} from '../ui';
|
import {styled} from '../ui';
|
||||||
import {Modal, Button, Image, Checkbox, Space, Typography, Tooltip} from 'antd';
|
import {Modal, Button, Image, Checkbox, Space, Typography, Tooltip} from 'antd';
|
||||||
import {
|
import {
|
||||||
RocketOutlined,
|
RocketOutlined,
|
||||||
@@ -29,7 +29,7 @@ import {getFlipperLib} from 'flipper-plugin';
|
|||||||
import {ReleaseChannel} from 'flipper-common';
|
import {ReleaseChannel} from 'flipper-common';
|
||||||
import {showChangelog} from '../chrome/ChangelogSheet';
|
import {showChangelog} from '../chrome/ChangelogSheet';
|
||||||
|
|
||||||
const RowContainer = styled(FlexRow)({
|
const RowContainer = styled(Layout.Horizontal)({
|
||||||
alignItems: 'flex-start',
|
alignItems: 'flex-start',
|
||||||
padding: `${theme.space.small}px`,
|
padding: `${theme.space.small}px`,
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
@@ -53,19 +53,19 @@ function Row(props: {
|
|||||||
{cloneElement(props.icon, {
|
{cloneElement(props.icon, {
|
||||||
style: {fontSize: 36, color: theme.primaryColor},
|
style: {fontSize: 36, color: theme.primaryColor},
|
||||||
})}
|
})}
|
||||||
<FlexColumn>
|
<Layout.Container>
|
||||||
<Title level={3} style={{color: theme.primaryColor}}>
|
<Title level={3} style={{color: theme.primaryColor}}>
|
||||||
{props.title}
|
{props.title}
|
||||||
</Title>
|
</Title>
|
||||||
<Text type="secondary">{props.subtitle}</Text>
|
<Text type="secondary">{props.subtitle}</Text>
|
||||||
</FlexColumn>
|
</Layout.Container>
|
||||||
</Space>
|
</Space>
|
||||||
</RowContainer>
|
</RowContainer>
|
||||||
</Tracked>
|
</Tracked>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const FooterContainer = styled(FlexRow)({
|
const FooterContainer = styled(Layout.Horizontal)({
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user