forked from odigos-io/odigos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from alonkeyval/gen-1136-overview-header
[GEN-1136] chore: overview header
- Loading branch information
Showing
14 changed files
with
248 additions
and
2 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,36 @@ | ||
'use client'; | ||
import { MainHeader } from '@/components'; | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
const LayoutContainer = styled.div` | ||
width: 100%; | ||
height: 100vh; | ||
background-color: ${({ theme }) => theme.colors.primary}; | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
`; | ||
|
||
const MainContent = styled.div` | ||
display: flex; | ||
width: 100vw; | ||
height: 76px; | ||
flex-direction: column; | ||
align-items: center; | ||
`; | ||
|
||
export default function MainLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<LayoutContainer> | ||
<MainContent> | ||
<MainHeader /> | ||
{children} | ||
</MainContent> | ||
</LayoutContainer> | ||
); | ||
} |
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 MainPage() { | ||
return <></>; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react'; | ||
import Image from 'next/image'; | ||
import styled from 'styled-components'; | ||
import { Text } from '@/reuseable-components'; | ||
|
||
interface PlatformProps { | ||
type: 'k8s' | 'vm'; | ||
} | ||
|
||
const PlatformWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
padding: 10px; | ||
`; | ||
|
||
const IconWrapper = styled.div` | ||
margin-right: 10px; | ||
`; | ||
|
||
const TextWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
`; | ||
|
||
const Title = styled(Text)` | ||
font-size: 14px; | ||
margin-right: 10px; | ||
color: ${({ theme }) => theme.colors.white}; | ||
`; | ||
|
||
const PlatformTitle: React.FC<PlatformProps> = ({ type }) => { | ||
return ( | ||
<PlatformWrapper> | ||
<IconWrapper> | ||
<Image | ||
src={`/icons/cp/${type}.svg`} | ||
alt={type} | ||
width={28} | ||
height={28} | ||
/> | ||
</IconWrapper> | ||
<TextWrapper> | ||
<Title> | ||
{type === 'k8s' ? 'Kubernetes Cluster' : 'Virtual Machine'} | ||
</Title> | ||
</TextWrapper> | ||
</PlatformWrapper> | ||
); | ||
}; | ||
|
||
export { PlatformTitle }; |
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,49 @@ | ||
import React from 'react'; | ||
import Image from 'next/image'; | ||
import styled from 'styled-components'; | ||
import { ConnectionStatus } from '@/reuseable-components'; | ||
import { PlatformTitle } from './cp-title'; | ||
|
||
interface MainHeaderProps {} | ||
|
||
const HeaderContainer = styled.div` | ||
display: flex; | ||
padding: 10px 0; | ||
align-items: center; | ||
background-color: ${({ theme }) => theme.colors.dark_grey}; | ||
border-bottom: 1px solid rgba(249, 249, 249, 0.16); | ||
width: 100%; | ||
`; | ||
|
||
const Logo = styled.div` | ||
display: flex; | ||
align-items: center; | ||
margin-left: 32px; | ||
`; | ||
|
||
const PlatformTitleWrapper = styled.div` | ||
margin-left: 32px; | ||
`; | ||
|
||
export const MainHeader: React.FC<MainHeaderProps> = () => { | ||
return ( | ||
<HeaderContainer> | ||
<Logo> | ||
<Image | ||
src="/brand/transparent-logo-white.svg" | ||
alt="logo" | ||
width={84} | ||
height={20} | ||
/> | ||
</Logo> | ||
<PlatformTitleWrapper> | ||
<PlatformTitle type="k8s" /> | ||
</PlatformTitleWrapper> | ||
<ConnectionStatus | ||
title="Connection Status" | ||
status="lost" | ||
subtitle="Please check your internet connection" | ||
/> | ||
</HeaderContainer> | ||
); | ||
}; |
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 @@ | ||
export * from './header'; |
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
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.
89 changes: 89 additions & 0 deletions
89
frontend/webapp/reuseable-components/connection-status/index.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,89 @@ | ||
import Image from 'next/image'; | ||
import React from 'react'; | ||
import { Text } from '../text'; | ||
import styled from 'styled-components'; | ||
|
||
interface ConnectionStatusProps { | ||
title: string; | ||
subtitle?: string; | ||
status: 'alive' | 'lost'; | ||
} | ||
|
||
const StatusWrapper = styled.div<{ status: 'alive' | 'lost' }>` | ||
display: flex; | ||
align-items: center; | ||
padding: 8px 24px; | ||
border-radius: 32px; | ||
background: ${({ status }) => | ||
status === 'alive' | ||
? `linear-gradient( | ||
90deg, | ||
rgba(23, 32, 19, 0) 0%, | ||
rgba(23, 32, 19, 0.8) 50%, | ||
#172013 100% | ||
)` | ||
: `linear-gradient(90deg, rgba(51, 21, 21, 0.00) 0%, rgba(51, 21, 21, 0.80) 50%, #331515 100%)`}; | ||
`; | ||
|
||
const IconWrapper = styled.div` | ||
margin-right: 8px; | ||
display: flex; | ||
align-items: center; | ||
`; | ||
|
||
const TextWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
`; | ||
|
||
const Title = styled(Text)<{ status: 'alive' | 'lost' }>` | ||
font-weight: 400; | ||
font-size: 14px; | ||
color: ${({ status, theme }) => | ||
status === 'alive' ? theme.text.success : theme.text.error}; | ||
`; | ||
|
||
const Subtitle = styled(Text)` | ||
font-size: 12px; | ||
font-weight: 400; | ||
color: #db5151; | ||
`; | ||
|
||
const TextDivider = styled.div` | ||
width: 1px; | ||
height: 12px; | ||
background: rgba(237, 124, 124, 0.16); | ||
margin: 0 8px; | ||
`; | ||
|
||
const ConnectionStatus: React.FC<ConnectionStatusProps> = ({ | ||
title, | ||
subtitle, | ||
status, | ||
}) => { | ||
return ( | ||
<StatusWrapper status={status}> | ||
<IconWrapper> | ||
<Image | ||
src={`/icons/notification/${ | ||
status === 'alive' ? 'success-icon' : 'error-icon2' | ||
}.svg`} | ||
alt="status" | ||
width={16} | ||
height={16} | ||
/> | ||
</IconWrapper> | ||
<TextWrapper> | ||
<Title status={status}>{title}</Title> | ||
{subtitle && ( | ||
<TextWrapper> | ||
<TextDivider /> | ||
<Subtitle>{subtitle}</Subtitle> | ||
</TextWrapper> | ||
)} | ||
</TextWrapper> | ||
</StatusWrapper> | ||
); | ||
}; | ||
|
||
export { ConnectionStatus }; |
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