Small design system simplifications

Summary:
So far we distinguished `Layout.Container` from `Layout.Vertical`, but they did almost exactly the same, so figured to unify them, so smaller API ftw :) Normal containers put children vertical, and if you want to use horizontal, use Layout.Horzontal

Also simplified code in Layout file a little bit.

Fixed issue I split container where the main container didn't go "underneath" the fixed container

Reviewed By: cekkaewnumchai

Differential Revision: D24502547

fbshipit-source-id: 517db3692749e670cda8f0cd7cb1c807df818b4d
This commit is contained in:
Michel Weststrate
2020-10-23 06:44:04 -07:00
committed by Facebook GitHub Bot
parent 26e040ea73
commit 30f5f0b59a
13 changed files with 137 additions and 182 deletions

View File

@@ -125,7 +125,7 @@ function NotificationEntry({notification}: {notification: PluginNotification}) {
style: {color: theme.primaryColor},
});
return (
<Layout.Vertical gap="small" pad="medium">
<Layout.Container gap="small" pad="medium">
<Layout.Horizontal gap="tiny" center>
{icon}
<Text>{pluginId}</Text>
@@ -140,7 +140,7 @@ function NotificationEntry({notification}: {notification: PluginNotification}) {
Open
</Button>
<DetailCollapse detail={content.message} />
</Layout.Vertical>
</Layout.Container>
);
}
@@ -151,14 +151,14 @@ function NotificationList({
}) {
return (
<Layout.ScrollContainer vertical>
<Layout.Vertical>
<Layout.Container>
{notifications.map((notification) => (
<NotificationEntry
key={notification.notification.id}
notification={notification}
/>
))}
</Layout.Vertical>
</Layout.Container>
</Layout.ScrollContainer>
);
}
@@ -175,12 +175,12 @@ export function Notification() {
return (
<LeftSidebar>
<Layout.Top>
<Layout.Vertical gap="tiny" padv="tiny" borderBottom>
<Layout.Container gap="tiny" padv="tiny" borderBottom>
<SidebarTitle actions={actions}>notifications</SidebarTitle>
<Layout.Container padh="medium" padv="small">
<Input placeholder="Search..." prefix={<SearchOutlined />} />
</Layout.Container>
</Layout.Vertical>
</Layout.Container>
<NotificationList notifications={notificationExample} />
</Layout.Top>
</LeftSidebar>