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

Commit 7e5146a

Browse files
committed
add panel(without theme)
1 parent 3fd019f commit 7e5146a

File tree

11 files changed

+194
-9
lines changed

11 files changed

+194
-9
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
[查询客户端 franchise](https://github.com/HVF/franchise)
3838

3939
## packages
40+
[markjs](https://markjs.io/)
4041
[markdown-it](https://markdown-it.github.io/)
4142
[Autolinker](https://github.com/gregjacobs/Autolinker.js)
4243

43-
4444
## issues
4545
next.config.js 如果导出不存在的页面可能会使 build 过程出现奇怪的错误, 如
4646
polished 报错. 只导出需要的页面
@@ -61,7 +61,8 @@
6161

6262
- [ ] phoenix [新文档地址](https://github.com/phoenixframework/phoenix/tree/master/guides/docs)
6363
- [ ] 使用 Github Rest/GraphQl api 摸索数据层方案
64-
- [ ] Search panel && login panel
64+
- [ ] Search panel && login panel ----> 或许应该叫 UnverisalPanel ? --> 可以呼出
65+
debug 设置等等
6566
- [ ] [主页弄给](https://github.com/Sly777/ran)
6667
- [ ] add export config docs [see this](https://zhuanlan.zhihu.com/p/27847307)
6768
- [ ] test --> tests

components/A/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ import PropTypes from 'prop-types'
1010
import styled from 'styled-components'
1111

1212
export const StyledA = styled.a`
13-
text-decoration: underline;
13+
text-decoration: none;
1414
font-weight: bolder;
1515
color: ${props => props.theme.link};
1616
transition: color 0.3s;
17+
&:hover {
18+
text-decoration: underline;
19+
}
1720
`
1821

1922
function A(props) {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react'
2+
3+
// import lang from './lang'
4+
5+
import UniversePanel from '../UniversePanel'
6+
import { HorizontalCenter } from '../../components/BaseStyled'
7+
8+
const Home = () => {
9+
return (
10+
<HorizontalCenter>
11+
<div>Huck</div>
12+
<UniversePanel />
13+
</HorizontalCenter>
14+
)
15+
}
16+
17+
export default Home

containers/Body/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ import Theme from './Theme'
1818
import Home from './Home'
1919
import Feature from './Feature'
2020
import I18n from './I18n'
21-
import { HorizontalCenter } from '../../components/BaseStyled'
21+
import GithubRestExample from './GithubRestExample'
2222

2323
const debug = makeDebugger('C:Body')
2424

2525
const IntroPage = props => {
2626
const { route } = props
27-
console.log('route: ', route)
28-
console.log('props.body.theme --> : ', props.body.themeName)
27+
// console.log('route: ', route)
28+
// console.log('props.body.theme --> : ', props.body.themeName)
2929

3030
switch (route.query.name) {
3131
case 'index':
@@ -37,7 +37,7 @@ const IntroPage = props => {
3737
case 'i18n':
3838
return <I18n />
3939
case 'example':
40-
return <HorizontalCenter>example</HorizontalCenter>
40+
return <GithubRestExample />
4141
default:
4242
return <Home />
4343
}

containers/UniversePanel/Modal.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import styled from 'styled-components'
2+
3+
// center css see: https://stackoverflow.com/questions/1776915/how-to-center-absolutely-positioned-element-in-div
4+
// flex-grow example: http://zhoon.github.io/css3/2014/08/23/flex.html
5+
export const PanelContainer = styled.div`
6+
position: absolute;
7+
top: 20vh;
8+
left: 50%;
9+
`
10+
11+
export const Wraper = styled.div`
12+
position: relative;
13+
left: -50%;
14+
display: flex;
15+
flex-direction: column;
16+
justify-content: center;
17+
`
18+
19+
export const InfoBar = styled.div`
20+
border: 1px solid white;
21+
box-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.4);
22+
border: 1px solid #014354;
23+
width: 50vw;
24+
max-width: 600px;
25+
height: 70px;
26+
background: #001b21;
27+
color: white;
28+
display: flex;
29+
flex-direction: row;
30+
`
31+
32+
export const AddOn = styled.div`
33+
transform: rotate(-45deg);
34+
font-size: 5vh;
35+
margin-left: 15px;
36+
color: #365760;
37+
margin-top: 5px;
38+
margin-top: 3px;
39+
width: 20px;
40+
`
41+
42+
export const InputBar = styled.input`
43+
caret-color: #365760; /*cursor color*/
44+
flex-grow: 1;
45+
font-family: '.SFNSText-Light', 'SF UI Text', 'Helvetica Neue', 'Arial',
46+
'Lucida Grande', 'Segoe UI', Noto Sans, sans-serif;
47+
height: 100%;
48+
width: auto;
49+
outline: none;
50+
font-weight: 200;
51+
color: #365760;
52+
font-size: 24px;
53+
line-height: 70px;
54+
max-height: none;
55+
background-color: transparent;
56+
padding: 0 20px 0px 20px;
57+
border: 0;
58+
border-radius: 0;
59+
transition: all 400ms ease;
60+
`

containers/UniversePanel/index.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
*
3+
* UniversePanel
4+
*
5+
*/
6+
7+
import React from 'react'
8+
import { inject, observer } from 'mobx-react'
9+
10+
// import Link from 'next/link'
11+
// import styled from 'styled-components'
12+
13+
import { makeDebugger } from '../../utils/debug'
14+
import * as logic from './logic'
15+
16+
import { PanelContainer, InfoBar, Wraper, InputBar, AddOn } from './Modal'
17+
18+
const debug = makeDebugger('C:UniversePanel')
19+
20+
const SearchEditor = () => (
21+
<InfoBar>
22+
<AddOn>&#9906;</AddOn>
23+
<InputBar
24+
spellCheck={false}
25+
autoCapitalize={false}
26+
autoCorrect="off"
27+
autoComplete="off"
28+
/>
29+
</InfoBar>
30+
)
31+
32+
const selector = ({ store }) => ({
33+
store: store.sidebar,
34+
})
35+
36+
class UniversePanelContainer extends React.Component {
37+
componentDidMount() {
38+
debug('mount')
39+
logic.init(this.props.store)
40+
}
41+
42+
render() {
43+
/*
44+
<PanelContainer>
45+
<Wraper>
46+
<InfoBar>
47+
<SearchEditor ... />
48+
</InfoBar>
49+
50+
</Wraper>
51+
</PanelContainer>
52+
53+
54+
*/
55+
56+
return (
57+
<PanelContainer>
58+
<Wraper>
59+
<SearchEditor />
60+
<InfoBar>UniversePanel container!</InfoBar>
61+
</Wraper>
62+
</PanelContainer>
63+
)
64+
}
65+
}
66+
67+
export default inject(selector)(observer(UniversePanelContainer))

containers/UniversePanel/lang.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* UniversePanel Langs
3+
*
4+
* This contains all the text for the UniversePanel component.
5+
*/
6+
import { defineMessages } from 'react-intl'
7+
8+
export default defineMessages({
9+
header: {
10+
id: 'containers.UniversePanel.header',
11+
defaultMessage: 'This is the UniversePanel component !',
12+
},
13+
})

containers/UniversePanel/logic.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { makeDebugger } from '../../utils/debug'
2+
3+
const debug = makeDebugger('L:UniversePanel')
4+
5+
let store = null
6+
7+
export function otherLogic() {
8+
return 'otherLogic'
9+
}
10+
11+
export function init(selectedStore) {
12+
debug('store', store)
13+
store = selectedStore
14+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// import React from 'react'
2+
// import { shallow } from 'enzyme'
3+
4+
// import UniversePanel from '../index'
5+
6+
describe('<UniversePanel />', () => {
7+
it('Expect to have unit tests specified', () => {
8+
expect(true).toEqual(false)
9+
})
10+
})

utils/scripts/generators/container/class.js.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const selector = ({ store }) => ({
2626

2727
class {{ properCase name }}Container extends React.Component {
2828
componentDidMount() {
29-
debug('mount)
29+
debug('mount')
3030
logic.init(this.props.store)
3131
}
3232

0 commit comments

Comments
 (0)