-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e202d5c
commit b610fad
Showing
12 changed files
with
153 additions
and
4 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,6 @@ | ||
"use client"; | ||
import React from "react"; | ||
|
||
export default function SourcesOverviewPage() { | ||
return <div>SourcesOverviewPage</div>; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions
45
frontend/webapp/components/side.menu/menu.item/menu.item.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,45 @@ | ||
import { KeyvalText } from "@/design.system"; | ||
import React from "react"; | ||
import { styled } from "styled-components"; | ||
interface MenuItemContainerProps { | ||
focused: boolean; | ||
} | ||
|
||
interface MenuItem { | ||
name: string; | ||
icons: { | ||
focus: () => JSX.Element; | ||
notFocus: () => JSX.Element; | ||
}; | ||
} | ||
|
||
interface MenuItemProps { | ||
item: MenuItem; | ||
focused: boolean; | ||
onClick?: () => void; | ||
} | ||
|
||
const MenuItemContainer = styled.div<MenuItemContainerProps>` | ||
display: flex; | ||
padding: 0px 16px; | ||
height: 48px; | ||
align-items: center; | ||
gap: 10px; | ||
cursor: pointer; | ||
border-radius: 10px; | ||
background: ${({ focused, theme }) => | ||
focused ? theme.colors.blue_grey : "transparent"}; | ||
`; | ||
|
||
export default function MenuItem({ item, focused, onClick }: MenuItemProps) { | ||
const { name, icons } = item; | ||
|
||
return ( | ||
<MenuItemContainer onClick={onClick} focused={focused}> | ||
{focused ? icons.focus() : icons.notFocus()} | ||
<KeyvalText size={14} weight={600}> | ||
{name} | ||
</KeyvalText> | ||
</MenuItemContainer> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,75 @@ | ||
"use client"; | ||
import React from "react"; | ||
import { MenuContainer } from "./menu.styled"; | ||
import React, { useState } from "react"; | ||
import { MenuContainer, LogoWrapper, MenuItemsWrapper } from "./menu.styled"; | ||
import { KeyvalText } from "@/design.system"; | ||
import MenuItem from "../menu.item/menu.item"; | ||
import { useRouter } from "next/navigation"; | ||
|
||
import FocusOverview from "../../../assets/icons/focus-overview.svg"; | ||
import UnFocusOverview from "../../../assets/icons/unfocus-overview.svg"; | ||
import FocusSources from "../../../assets/icons/sources-focus.svg"; | ||
import UnFocusSources from "../../../assets/icons/sources-unfocus.svg"; | ||
import FocusDestinations from "../../../assets/icons/destinations-focus.svg"; | ||
import UnFocusDestinations from "../../../assets/icons/destinations-unfocus.svg"; | ||
import { OVERVIEW } from "@/utils/constants"; | ||
const MENU_ITEMS = [ | ||
{ | ||
id: 1, | ||
name: "Overview", | ||
icons: { | ||
focus: () => <FocusOverview />, | ||
notFocus: () => <UnFocusOverview />, | ||
}, | ||
navigate: "/overview", | ||
}, | ||
{ | ||
id: 2, | ||
name: "Sources", | ||
icons: { | ||
focus: () => <FocusSources />, | ||
notFocus: () => <UnFocusSources />, | ||
}, | ||
navigate: "/overview/sources", | ||
}, | ||
{ | ||
id: 3, | ||
name: "Destinations", | ||
icons: { | ||
focus: () => <FocusDestinations />, | ||
notFocus: () => <UnFocusDestinations />, | ||
}, | ||
navigate: "/overview/destinations", | ||
}, | ||
]; | ||
|
||
export function Menu() { | ||
return <MenuContainer></MenuContainer>; | ||
const [currentMenuItem, setCurrentMenuItem] = useState(MENU_ITEMS[0]); | ||
const router = useRouter(); | ||
|
||
function handleMenuItemClick(item) { | ||
setCurrentMenuItem(item); | ||
router.push(item?.navigate); | ||
} | ||
|
||
function renderMenuItemsList() { | ||
return MENU_ITEMS.map((item) => ( | ||
<MenuItem | ||
key={`${item.id}_${item.name}`} | ||
onClick={() => handleMenuItemClick(item)} | ||
focused={currentMenuItem?.id === item.id} | ||
item={item} | ||
/> | ||
)); | ||
} | ||
|
||
return ( | ||
<MenuContainer> | ||
<LogoWrapper> | ||
<KeyvalText size={32} weight={700}> | ||
{OVERVIEW.ODIGOS} | ||
</KeyvalText> | ||
</LogoWrapper> | ||
<MenuItemsWrapper>{renderMenuItemsList()}</MenuItemsWrapper> | ||
</MenuContainer> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export { ROUTES } from "./routes"; | ||
export { CONFIG } from "./config"; | ||
export { SETUP } from "./string"; | ||
export { SETUP, OVERVIEW } from "./string"; | ||
export { API, QUERIES } from "./urls"; |
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