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 #3 from alonkeyval/gen-1099-setup-side-menu
[GEN-1099] chore: setup side menu
- Loading branch information
Showing
6 changed files
with
191 additions
and
7 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 |
---|---|---|
@@ -1,16 +1,54 @@ | ||
'use client'; | ||
import React from 'react'; | ||
import { SetupHeader } from '@/components'; | ||
import styled from 'styled-components'; | ||
import { SetupHeader, SideMenu } from '@/components'; | ||
|
||
const LayoutContainer = styled.div` | ||
width: 100%; | ||
height: 100vh; | ||
background-color: ${({ theme }) => theme.colors.primary}; | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
`; | ||
|
||
const SideMenuWrapper = styled.div` | ||
position: absolute; | ||
left: 24px; | ||
top: 144px; | ||
`; | ||
|
||
const HeaderWrapper = styled.div` | ||
width: 100vw; | ||
`; | ||
|
||
const MainContent = styled.div` | ||
display: flex; | ||
max-width: 1440px; | ||
width: 100%; | ||
background-color: ${({ theme }) => theme.colors.secondary}; | ||
flex-direction: column; | ||
align-items: center; | ||
`; | ||
|
||
export default function SetupLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<> | ||
<SetupHeader /> | ||
{children} | ||
</> | ||
<LayoutContainer> | ||
<HeaderWrapper> | ||
<SetupHeader /> | ||
</HeaderWrapper> | ||
<SideMenuWrapper> | ||
<SideMenu /> | ||
</SideMenuWrapper> | ||
<MainContent> | ||
<SideMenu /> | ||
|
||
{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
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,124 @@ | ||
import { Text } from '@/reuseable-components'; | ||
import Image from 'next/image'; | ||
import React from 'react'; | ||
import styled, { css } from 'styled-components'; | ||
|
||
interface StepProps { | ||
title: string; | ||
subtitle?: string; | ||
state: 'finish' | 'active' | 'disabled'; | ||
stepNumber: number; | ||
} | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 32px; | ||
`; | ||
|
||
const Step = styled.div<{ state: 'finish' | 'active' | 'disabled' }>` | ||
display: flex; | ||
gap: 16px; | ||
padding: 10px 0; | ||
cursor: ${({ state }) => (state === 'disabled' ? 'not-allowed' : 'pointer')}; | ||
opacity: ${({ state }) => (state === 'disabled' ? 0.5 : 1)}; | ||
transition: opacity 0.3s; | ||
${({ state }) => state === 'active' && css``} | ||
& + & { | ||
margin-top: 10px; | ||
} | ||
`; | ||
|
||
const IconWrapper = styled.div<{ state: 'finish' | 'active' | 'disabled' }>` | ||
margin-right: 10px; | ||
border-radius: 32px; | ||
width: 24px; | ||
height: 24px; | ||
border: 1px solid #f9f9f9; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
${({ state }) => | ||
state === 'finish' | ||
? css` | ||
opacity: 0.8; | ||
` | ||
: state === 'disabled' && | ||
css` | ||
border: 1px dashed rgba(249, 249, 249, 0.4); | ||
`} | ||
`; | ||
|
||
const StepContent = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
flex-direction: column; | ||
gap: 8px; | ||
`; | ||
|
||
const StepTitle = styled(Text)` | ||
font-size: 16px; | ||
font-weight: bold; | ||
`; | ||
|
||
const StepSubtitle = styled(Text)``; | ||
|
||
const SideMenu: React.FC = () => { | ||
const steps: StepProps[] = [ | ||
{ | ||
title: 'INSTALLATION', | ||
subtitle: 'Success', | ||
state: 'finish', | ||
stepNumber: 1, | ||
}, | ||
{ | ||
title: 'SOURCES', | ||
state: 'active', | ||
stepNumber: 2, | ||
}, | ||
{ | ||
title: 'DESTINATIONS', | ||
state: 'disabled', | ||
stepNumber: 3, | ||
}, | ||
]; | ||
|
||
return ( | ||
<Container> | ||
{steps.map((step, index) => ( | ||
<Step key={index} state={step.state}> | ||
<IconWrapper state={step.state}> | ||
{step.state === 'finish' && ( | ||
<Image | ||
src="/icons/common/check.svg" | ||
width={20} | ||
height={20} | ||
alt={''} | ||
/> | ||
)} | ||
{step.state === 'active' && ( | ||
<Text size={12}>{step.stepNumber}</Text> | ||
)} | ||
{step.state === 'disabled' && ( | ||
<Text size={12}>{step.stepNumber}</Text> | ||
)} | ||
</IconWrapper> | ||
<StepContent> | ||
<StepTitle>{step.title}</StepTitle> | ||
{step.subtitle && ( | ||
<StepSubtitle size={10} weight={300} family={'secondary'}> | ||
{step.subtitle} | ||
</StepSubtitle> | ||
)} | ||
</StepContent> | ||
</Step> | ||
))} | ||
</Container> | ||
); | ||
}; | ||
|
||
export { SideMenu }; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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