Remove non-Sandy UI
Summary: This removes the Non-Sandy UI from the Flipper codebase. It is a pretty rough scan for unused components, over time when converting more advanced components to Ant design probably even more code can be removed. Partially used `npx ts-purge` to reveal never imported source files. Changelog: It is no longer possible to opt out of the new Sandy UI Reviewed By: jknoxville Differential Revision: D25825282 fbshipit-source-id: 9041dbc7e03bce0760c9a0a34f1877851b5f06cf
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ba74b074c2
commit
12e59afdc6
@@ -7,23 +7,11 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import styled from '@emotion/styled';
|
||||
import {colors} from './colors';
|
||||
import {useCallback} from 'react';
|
||||
import {shell} from 'electron';
|
||||
import React from 'react';
|
||||
import {useIsSandy} from '../../sandy-chrome/SandyContext';
|
||||
import {Typography} from 'antd';
|
||||
|
||||
const StyledLink = styled.span({
|
||||
color: colors.highlight,
|
||||
'&:hover': {
|
||||
cursor: 'pointer',
|
||||
textDecoration: 'underline',
|
||||
},
|
||||
});
|
||||
StyledLink.displayName = 'Link:StyledLink';
|
||||
|
||||
const AntOriginalLink = Typography.Link;
|
||||
|
||||
export default function Link(props: {
|
||||
@@ -32,7 +20,6 @@ export default function Link(props: {
|
||||
style?: React.CSSProperties;
|
||||
onClick?: ((event: React.MouseEvent<any>) => void) | undefined;
|
||||
}) {
|
||||
const isSandy = useIsSandy();
|
||||
const onClick = useCallback(
|
||||
(e: React.MouseEvent<any>) => {
|
||||
shell.openExternal(props.href);
|
||||
@@ -42,13 +29,7 @@ export default function Link(props: {
|
||||
[props.href],
|
||||
);
|
||||
|
||||
return isSandy ? (
|
||||
<AntOriginalLink {...props} onClick={props.onClick ?? onClick} />
|
||||
) : (
|
||||
<StyledLink onClick={props.onClick ?? onClick} style={props.style}>
|
||||
{props.children || props.href}
|
||||
</StyledLink>
|
||||
);
|
||||
return <AntOriginalLink {...props} onClick={props.onClick ?? onClick} />;
|
||||
}
|
||||
|
||||
// XXX. For consistent usage, we monkey patch AntDesign's Link component,
|
||||
|
||||
Reference in New Issue
Block a user