-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add side menu component * Add side menu to settings page. Remove admin link from sidebar * Move NotificationPage * Move ConfigurationPage * Add Sources and Destinations pages to Settings. Delete Admin page * Add MetricsPage * Edit Notifications and Metrics pages * Update feedback for metrics and notification pages * Add update icons data to side menu * Add AccountPage
- Loading branch information
Showing
47 changed files
with
1,465 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
|
||
import MenuItem from "./components/MenuItem"; | ||
|
||
export type SideMenuItem = { | ||
id: string; | ||
name: string | React.ReactNode; | ||
indicatorCount?: number; | ||
}; | ||
|
||
type SideMenuProps = { | ||
data: SideMenuItem[]; | ||
activeItem?: string; | ||
onSelect: (id: string) => void; | ||
}; | ||
|
||
const Content = styled.nav` | ||
min-width: 147px; | ||
`; | ||
|
||
const SideMenu: React.FC<SideMenuProps> = ({ data, onSelect, activeItem }) => { | ||
return ( | ||
<Content> | ||
{data.map((item) => ( | ||
<MenuItem | ||
key={item.id} | ||
name={item.name} | ||
isActive={item.id === activeItem} | ||
count={item.indicatorCount} | ||
onClick={() => onSelect(item.id)} | ||
/> | ||
))} | ||
</Content> | ||
); | ||
}; | ||
|
||
export default SideMenu; |
51 changes: 51 additions & 0 deletions
51
airbyte-webapp/src/components/SideMenu/components/MenuItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
|
||
type IProps = { | ||
name: string | React.ReactNode; | ||
isActive?: boolean; | ||
count?: number; | ||
onClick: () => void; | ||
}; | ||
|
||
const Item = styled.div<{ | ||
isActive?: boolean; | ||
}>` | ||
width: 100%; | ||
padding: 6px 8px 7px; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
background: ${({ theme, isActive }) => | ||
isActive ? theme.primaryColor12 : "none"}; | ||
font-style: normal; | ||
font-weight: 500; | ||
font-size: 12px; | ||
line-height: 15px; | ||
color: ${({ theme, isActive }) => | ||
isActive ? theme.primaryColor : theme.greyColor60}; | ||
`; | ||
|
||
const Counter = styled.div` | ||
min-width: 12px; | ||
height: 12px; | ||
padding: 0 3px; | ||
text-align: center; | ||
border-radius: 15px; | ||
background: ${({ theme }) => theme.dangerColor}; | ||
font-size: 8px; | ||
line-height: 13px; | ||
color: ${({ theme }) => theme.whiteColor}; | ||
display: inline-block; | ||
margin-left: 5px; | ||
`; | ||
|
||
const MenuItem: React.FC<IProps> = ({ name, isActive, count, onClick }) => { | ||
return ( | ||
<Item isActive={isActive} onClick={onClick}> | ||
{name} | ||
{count ? <Counter>{count}</Counter> : null} | ||
</Item> | ||
); | ||
}; | ||
|
||
export default MenuItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import SideMenu from "./SideMenu"; | ||
|
||
export default SideMenu; | ||
export { SideMenu }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.