feat(ott-139): header (#25)

keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Ruslan Khayrullin 6 years ago committed by GitHub
parent d45a32c150
commit 2564bb1557
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      public/images/menuIcon.svg
  2. 11
      src/features/Header/index.tsx
  3. 6
      src/features/Header/styled.tsx
  4. 39
      src/features/HomePage/index.tsx
  5. 6
      src/features/MainWrapper/index.tsx
  6. 9
      src/features/Menu/index.tsx
  7. 20
      src/features/Menu/styled.tsx

@ -0,0 +1,5 @@
<svg width="20" height="18" viewBox="0 0 20 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="1" y="1" width="18" height="2" rx="0.5" fill="#CCCCCC" stroke="#CCCCCC" stroke-width="0.5"/>
<rect x="1" y="8" width="18" height="2" rx="0.5" fill="#CCCCCC" stroke="#CCCCCC" stroke-width="0.5"/>
<rect x="1" y="15" width="18" height="2" rx="0.5" fill="#CCCCCC" stroke="#CCCCCC" stroke-width="0.5"/>
</svg>

After

Width:  |  Height:  |  Size: 410 B

@ -0,0 +1,11 @@
import React from 'react'
import { Menu } from 'features/Menu'
import { Wrapper } from './styled'
export const Header = () => (
<Wrapper>
<Menu />
</Wrapper>
)

@ -0,0 +1,6 @@
import styled from 'styled-components/macro'
export const Wrapper = styled.header`
display: flex;
padding-top: 16px;
`

@ -1,33 +1,10 @@
import React from 'react'
import styled from 'styled-components/macro'
import { Logo } from 'features/Logo'
import { CenterBlock } from 'features/Login/styled'
import { useAuthStore } from 'features/AuthStore'
// временные компоненты
const TempContainer = styled.div`
margin-top: 50px;
color: white;
font-size: 20px;
display: flex;
flex-direction: column;
`
const TempPageTitle = styled.span`
margin: 20px 0;
`
export const HomePage = () => {
const { logout } = useAuthStore()
return (
<CenterBlock>
<Logo />
<TempContainer>
<TempPageTitle>HOME PAGE</TempPageTitle>
<button type='button' onClick={logout}>Logout</button>
</TempContainer>
</CenterBlock>
)
}
import { Header } from 'features/Header'
import { MainWrapper } from 'features/MainWrapper'
export const HomePage = () => (
<MainWrapper>
<Header />
</MainWrapper>
)

@ -0,0 +1,6 @@
import styled from 'styled-components/macro'
export const MainWrapper = styled.div`
width: 100%;
padding-left: 80px;
`

@ -0,0 +1,9 @@
import React from 'react'
import { Wrapper, ToggleButton } from './styled'
export const Menu = () => (
<Wrapper>
<ToggleButton />
</Wrapper>
)

@ -0,0 +1,20 @@
import styled from 'styled-components/macro'
export const Wrapper = styled.div`
display: flex;
justify-content: center;
align-items: center;
width: 304px;
height: 48px;
`
export const ToggleButton = styled.button`
width: 18px;
height: 16px;
background-image: url(/images/menuIcon.svg);
background-size: 100%;
background-repeat: no-repeat;
background-color: transparent;
border: none;
outline: none;
cursor: pointer;
`
Loading…
Cancel
Save