-
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.
* Info page initial commit. * Frontend > cleanup. --------- Co-authored-by: Pavel <[email protected]>
- Loading branch information
Showing
33 changed files
with
1,692 additions
and
32 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 |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
|
||
package-lock.json | ||
vite.config.ts | ||
.eslintrc.cjs | ||
.eslintrc.cjs | ||
|
||
*styles.module.scss* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
import { ChakraProvider } from '@chakra-ui/react'; | ||
import { PhoneIphone } from '@mui/icons-material'; | ||
|
||
import { LearningBlock } from './Info'; | ||
|
||
export function App() { | ||
return <div></div>; | ||
return ( | ||
<ChakraProvider> | ||
<LearningBlock icon={PhoneIphone} text="" title="" /> | ||
</ChakraProvider> | ||
); | ||
} |
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,21 @@ | ||
import { Button, Stack, Text } from '@chakra-ui/react'; | ||
|
||
import { useLocale } from '~/locale'; | ||
|
||
export const Footer: React.FC = () => { | ||
const { root, buttons } = useLocale(); | ||
|
||
return ( | ||
<Stack spacing={'24px'} alignItems={'center'}> | ||
<Text fontSize={35} fontWeight={'bold'}> | ||
{root.footer.title} | ||
</Text> | ||
|
||
<Text fontSize={21}>{root.footer.text}</Text> | ||
|
||
<Button colorScheme={'messenger'} width={150}> | ||
{buttons.gitHub} | ||
</Button> | ||
</Stack> | ||
); | ||
}; |
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 './Footer'; |
68 changes: 68 additions & 0 deletions
68
code/frontend/src/Info/components/Introduction/Introduction.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,68 @@ | ||
import { Button, Flex, HStack, Image, Stack, Text } from '@chakra-ui/react'; | ||
|
||
import Logo from '~/assets/logo.png'; | ||
import { useLocale } from '~/locale'; | ||
|
||
export const Introduction: React.FC = () => { | ||
return ( | ||
<HStack spacing={'80px'}> | ||
<Stack maxWidth={{ sm: '100%', md: 550 }} spacing={'24px'}> | ||
<Title /> | ||
|
||
<Description /> | ||
|
||
<Links /> | ||
</Stack> | ||
|
||
<Image display={{ sm: 'none', md: 'unset' }} src={Logo} /> | ||
</HStack> | ||
); | ||
}; | ||
|
||
const Title: React.FC = () => { | ||
const { root } = useLocale(); | ||
|
||
return ( | ||
<Flex alignItems={'flex-start'}> | ||
<Text fontSize={56} fontWeight={'bold'}> | ||
{root.header.title} | ||
</Text> | ||
|
||
<Text fontSize={'sm'} fontWeight={'bold'}> | ||
{root.header.tm} | ||
</Text> | ||
</Flex> | ||
); | ||
}; | ||
|
||
const Description: React.FC = () => { | ||
const { root } = useLocale(); | ||
|
||
return ( | ||
<> | ||
{root.header.description.map((paragrath, index) => { | ||
return ( | ||
<Text key={`paragraph-${index}`} fontSize={24}> | ||
{paragrath} | ||
</Text> | ||
); | ||
})} | ||
</> | ||
); | ||
}; | ||
|
||
const Links: React.FC = () => { | ||
const { buttons } = useLocale(); | ||
|
||
return ( | ||
<HStack width={'100%'} spacing={'40px'} justifyContent={'center'}> | ||
<Button width={131} colorScheme={'messenger'} variant={'solid'}> | ||
{buttons.signUp} | ||
</Button> | ||
|
||
<Button width={131} colorScheme={'messenger'} variant={'outline'}> | ||
{buttons.hostAWS} | ||
</Button> | ||
</HStack> | ||
); | ||
}; |
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 './Introduction'; |
20 changes: 20 additions & 0 deletions
20
code/frontend/src/Info/components/LearningBlock/LearningBlock.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,20 @@ | ||
import { Stack, Text } from '@chakra-ui/react'; | ||
import React from 'react'; | ||
|
||
import { LearningBlockProps } from './LearningBlock.types'; | ||
|
||
export const LearningBlock: React.FC<LearningBlockProps> = props => { | ||
const { icon: Icon, text, title } = props; | ||
|
||
return ( | ||
<Stack maxWidth={300} spacing={'8px'}> | ||
<Icon /> | ||
|
||
<Text fontSize={'lg'} fontWeight={'bold'}> | ||
{title} | ||
</Text> | ||
|
||
<Text fontSize={'lg'}>{text}</Text> | ||
</Stack> | ||
); | ||
}; |
9 changes: 9 additions & 0 deletions
9
code/frontend/src/Info/components/LearningBlock/LearningBlock.types.ts
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,9 @@ | ||
import { SvgIcon } from '@mui/material'; | ||
|
||
export type LearningBlockProps = LearningOption; | ||
|
||
export interface LearningOption { | ||
icon: typeof SvgIcon; | ||
title: string; | ||
text: string; | ||
} |
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,2 @@ | ||
export * from './LearningBlock'; | ||
export * from './LearningBlock.types'; |
12 changes: 12 additions & 0 deletions
12
code/frontend/src/Info/components/SetupGuide/SetupGuide.styles.module.scss
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,12 @@ | ||
.setupGuide { | ||
> *:not(:last-child) { | ||
margin-right: 20px; | ||
} | ||
|
||
@media only screen and (max-width: 48em) { | ||
> *:not(:last-child) { | ||
margin-right: 0px; | ||
margin-bottom: 20px; | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
code/frontend/src/Info/components/SetupGuide/SetupGuide.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,32 @@ | ||
import { Flex } from '@chakra-ui/react'; | ||
import { DoneAll, GetAppOutlined, LoginOutlined, SettingsOutlined } from '@mui/icons-material'; | ||
|
||
import { LearningBlock } from '../LearningBlock'; | ||
|
||
import { useLocale } from '~/locale'; | ||
|
||
import classes from './SetupGuide.styles.module.scss'; | ||
|
||
export const SetupGuide: React.FC = () => { | ||
const { root } = useLocale(); | ||
|
||
return ( | ||
<Flex | ||
className={classes.setupGuide} | ||
direction={{ sm: 'column', md: 'row' }} | ||
alignItems={'top'} | ||
justifyContent={'space-between'} | ||
> | ||
{root.setupGuide.steps.map(({ name, ...step }) => { | ||
return <LearningBlock key={name} icon={iconsMap[name as keyof typeof iconsMap]} {...step} />; | ||
})} | ||
</Flex> | ||
); | ||
}; | ||
|
||
const iconsMap = { | ||
signUp: LoginOutlined, | ||
installLesspass: GetAppOutlined, | ||
configureLesspass: SettingsOutlined, | ||
youAreAllSet: DoneAll | ||
}; |
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 './SetupGuide'; |
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 @@ | ||
export * from './Footer'; | ||
export * from './Introduction'; | ||
export * from './LearningBlock'; | ||
export * from './SetupGuide'; |
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,2 @@ | ||
export * from './components'; | ||
export * from './pages'; |
8 changes: 8 additions & 0 deletions
8
code/frontend/src/Info/pages/InfoPage/InfoPage.styles.module.scss
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,8 @@ | ||
.infopage { | ||
min-height: 100vh; | ||
|
||
box-sizing: border-box; | ||
|
||
background-color: white; | ||
padding: 24px 60px; | ||
} |
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,19 @@ | ||
import { Stack } from '@chakra-ui/react'; | ||
|
||
import { Introduction, Footer, SetupGuide } from '~/Info/components'; | ||
|
||
import classes from './InfoPage.styles.module.scss'; | ||
|
||
export const InfoPage: React.FC = () => { | ||
return ( | ||
<div className={classes.infopage}> | ||
<Stack spacing={'80px'} alignItems={'center'}> | ||
<Introduction /> | ||
|
||
<SetupGuide /> | ||
|
||
<Footer /> | ||
</Stack> | ||
</div> | ||
); | ||
}; |
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 './InfoPage'; |
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 './InfoPage'; |
16 changes: 16 additions & 0 deletions
16
code/frontend/src/Info/stories/components/Footer.stories.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,16 @@ | ||
import { Meta, Story } from '@storybook/react'; | ||
|
||
import { Footer } from '~/Info'; | ||
|
||
export default { | ||
title: 'Info/Footer', | ||
parameters: { | ||
layout: 'centered' | ||
} | ||
} as Meta; | ||
|
||
export const Default: Story = args => { | ||
return <Footer {...args} />; | ||
}; | ||
|
||
Default.storyName = 'Footer'; |
16 changes: 16 additions & 0 deletions
16
code/frontend/src/Info/stories/components/Introduction.stories.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,16 @@ | ||
import { Meta, Story } from '@storybook/react'; | ||
|
||
import { Introduction } from '~/Info'; | ||
|
||
export default { | ||
title: 'Info/Introduction', | ||
parameters: { | ||
layout: 'centered' | ||
} | ||
} as Meta; | ||
|
||
export const Default: Story = args => { | ||
return <Introduction {...args} />; | ||
}; | ||
|
||
Default.storyName = 'Introduction'; |
21 changes: 21 additions & 0 deletions
21
code/frontend/src/Info/stories/components/LearningBlock.stories.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,21 @@ | ||
import { PhoneIphone } from '@mui/icons-material'; | ||
import type { Meta, StoryFn } from '@storybook/react'; | ||
|
||
import { LearningBlock, LearningBlockProps } from '~/Info'; | ||
|
||
export default { | ||
title: 'Info/LearningBlock' | ||
} as Meta; | ||
|
||
type Args = LearningBlockProps; | ||
|
||
export const Default: StoryFn<Args> = args => { | ||
return <LearningBlock {...args} />; | ||
}; | ||
|
||
Default.args = { | ||
icon: PhoneIphone, | ||
title: 'Configure LessPass', | ||
text: 'Configure LessPass to use https://api.lesspass.staticsoft.org \n and sign in using your new account' | ||
}; | ||
Default.storyName = 'LearningBlock'; |
Oops, something went wrong.