Make panel adhere to Figma design

Summary: css to change the header styling

Reviewed By: lblasa

Differential Revision: D50595982

fbshipit-source-id: 836ea7881426e95abb449c085fca39606cd8cfdd
This commit is contained in:
Luke De Feo
2023-10-26 05:24:30 -07:00
committed by Facebook GitHub Bot
parent 115cb1af71
commit f3449a5641
2 changed files with 17 additions and 4 deletions

View File

@@ -29,6 +29,7 @@ export const Panel: React.FC<{
pad?: Spacing; pad?: Spacing;
gap?: Spacing; gap?: Spacing;
extraActions?: React.ReactElement | null; extraActions?: React.ReactElement | null;
className?: string;
}> = (props) => { }> = (props) => {
const [collapsed, setCollapsed] = useLocalStorageState( const [collapsed, setCollapsed] = useLocalStorageState(
`panel:${props.title}:collapsed`, `panel:${props.title}:collapsed`,
@@ -45,6 +46,7 @@ export const Panel: React.FC<{
return ( return (
<TrackingScope scope={props.title}> <TrackingScope scope={props.title}>
<StyledCollapse <StyledCollapse
className={props.className}
bordered={false} bordered={false}
activeKey={collapsed ? undefined : props.title} activeKey={collapsed ? undefined : props.title}
onChange={toggle}> onChange={toggle}>

View File

@@ -39,6 +39,17 @@ type ModalData = {
title: string; title: string;
}; };
const panelCss = css`
& > .ant-collapse-item .ant-collapse-header {
background-color: ${theme.backgroundDefault};
padding-left: 0px;
}
& > .ant-collapse-item .ant-collapse-header .ant-collapse-expand-icon {
width: 18px;
}
`;
export function AttributesInspector({ export function AttributesInspector({
node, node,
metadata, metadata,
@@ -116,7 +127,7 @@ export function AttributesInspector({
<NoData message="No attributes match filter " /> <NoData message="No attributes match filter " />
) : ( ) : (
sections.concat([ sections.concat([
<Panel key="Raw" title="Raw Data" collapsed> <Panel key="Raw" title="Raw Data" className={panelCss} collapsed>
<DataInspector data={omit(node, ['attributes'])} /> <DataInspector data={omit(node, ['attributes'])} />
</Panel>, </Panel>,
]) ])
@@ -202,8 +213,8 @@ function AttributeSection(
if (children.length > 0) { if (children.length > 0) {
return ( return (
<Panel key={name} title={name}> <Panel className={panelCss} key={name} title={name}>
<Layout.Container gap="small" padv="small"> <Layout.Container gap="small" padv="small" style={{paddingLeft: 18}}>
{...children} {...children}
</Layout.Container> </Layout.Container>
</Panel> </Panel>
@@ -278,7 +289,7 @@ function NamedAttribute({
<Typography.Text <Typography.Text
style={{ style={{
marginTop: 4, //to center with top input when multiline marginTop: 4, //to center with top input when multiline
flex: '0 0 30%', //take 30% of the width flex: '0 0 40%', //take 40% of the width
color: theme.textColorSecondary, color: theme.textColorSecondary,
opacity: 0.7, opacity: 0.7,
fontWeight: 50, fontWeight: 50,