Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit d4edf47

Browse files
committed
refactor(sidebar-footer): add basic ui
1 parent 43a703c commit d4edf47

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

src/containers/Sidebar/Footer.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react'
2+
// eslint-disable-next-line import/named
3+
import { ICON_CMD } from '@config'
4+
5+
import { Wrapper, InnerWrapper, SettingIcon } from './styles/footer'
6+
7+
const Footer = ({ pin }) => (
8+
<Wrapper pin={pin}>
9+
<InnerWrapper pin={pin}>
10+
<SettingIcon src={`${ICON_CMD}/setting.svg`} />
11+
</InnerWrapper>
12+
</Wrapper>
13+
)
14+
15+
export default Footer

src/containers/Sidebar/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { connectStore, buildLog } from '@utils'
1010

1111
import Header from './Header'
1212
import MenuList from './MenuList'
13+
import Footer from './Footer'
1314

1415
import { Wrapper } from './styles'
1516
import { useInit, onSortMenuEnd } from './logic'
@@ -45,6 +46,7 @@ const SidebarContainer = ({ sidebar }) => {
4546
onSortEnd={onSortMenuEnd}
4647
distance={5}
4748
/>
49+
<Footer pin={pin} />
4850
</Wrapper>
4951
)
5052
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import styled from 'styled-components'
2+
3+
import { theme, cs } from '@utils'
4+
import Img from '@Img'
5+
6+
export const Wrapper = styled.div`
7+
// margin-bottom: ${({ pin }) => (pin ? '0' : '20px')};
8+
margin-top: -20px;
9+
background: ${theme('sidebar.bg')};
10+
box-shadow: -1px -4px 4px 0px rgba(0,0,0,0.2);
11+
border-top: 1px dashed #316d7b;
12+
z-index: 1;
13+
`
14+
export const InnerWrapper = styled.div`
15+
height: 5vh;
16+
color: wheat;
17+
${cs.flex('align-both')};
18+
`
19+
export const SettingIcon = styled(Img)`
20+
fill: ${theme('sidebar.menuLink')};
21+
width: 16px;
22+
height: 16px;
23+
`

0 commit comments

Comments
 (0)