Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit3b5bec4

Browse files
committed
chore: merge branch 'dev'
2 parents187f812 +02259b3 commit3b5bec4

File tree

11 files changed

+78
-52
lines changed

11 files changed

+78
-52
lines changed

‎containers/CommunitiesContent/CommunityCards.js‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@ import {
2727

2828
constCommunityCard=({ community, restProps})=>(
2929
<Card>
30-
<CommunityIcon
31-
nonFill={R.contains(community.raw,NON_FILL_COMMUNITY)}
32-
src={community.logo}
33-
loading={<CommunityHoldertext={community.raw}place="communities"/>}
34-
/>
30+
<a
31+
href={`/${community.raw}/posts`}
32+
rel="noopener noreferrer"
33+
target="_blank"
34+
>
35+
<CommunityIcon
36+
nonFill={R.contains(community.raw,NON_FILL_COMMUNITY)}
37+
src={community.logo}
38+
loading={<CommunityHoldertext={community.raw}place="communities"/>}
39+
/>
40+
</a>
3541
<CardTitle>{community.title}</CardTitle>
3642
<CardDesc>{community.desc}</CardDesc>
3743
<ActivitySpark>

‎containers/JobEditor/styles/editor.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const Wrapper = styled.div`
88
99
padding: 20px;
1010
background-color:${theme('editor.contentBg')};
11-
min-height:600px;
11+
min-height:400px;
1212
margin-top: 5px;
1313
margin-left: 4%;
1414
margin-right: 4%;

‎containers/JobViewer/styles/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const BodyWrapper = styled.div`
77
88
padding: 20px;
99
background:${theme('preview.articleBg')};
10-
min-height:600px;
10+
min-height:400px;
1111
margin-top: 5px;
1212
margin-left: 4%;
1313
margin-right: 4%;

‎containers/PostEditor/styles/editor.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const Wrapper = styled.div`
88
99
padding: 20px;
1010
background-color:${theme('editor.contentBg')};
11-
min-height:600px;
11+
min-height:400px;
1212
margin-top: 5px;
1313
margin-left: 4%;
1414
margin-right: 4%;

‎containers/PostViewer/styles/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const BodyWrapper = styled.div`
77
88
padding: 20px;
99
background:${theme('preview.articleBg')};
10-
min-height:600px;
10+
min-height:400px;
1111
margin-top: 5px;
1212
margin-left: 4%;
1313
margin-right: 4%;

‎containers/Sidebar/MenuBar.js‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515

1616
import{onCommunitySelect}from'./logic'
1717

18-
constMenuBar=({ pin, item, activeRaw})=>(
18+
constMenuBar=({ pin, item, activeRaw, forceRerender})=>(
1919
<WrapperonClick={onCommunitySelect.bind(this,item)}>
2020
<MenuItemBar>
2121
<MenuRowpin={pin}active={activeRaw===R.toLower(item.raw)}>
@@ -26,12 +26,17 @@ const MenuBar = ({ pin, item, activeRaw }) => (
2626
src={item.logo}
2727
/>
2828
{/* eslint-disable jsx-a11y/anchor-is-valid */}
29-
<MenuItemTitlepin={pin}active={activeRaw===R.toLower(item.raw)}>
29+
<MenuItemTitle
30+
pin={pin}
31+
active={activeRaw===R.toLower(item.raw)}
32+
forceRerender={forceRerender}
33+
>
3034
{item.title}
3135
</MenuItemTitle>
3236

3337
<MiniChartWrapperpin={pin}>
3438
<TrendLine
39+
key={uid.gen()}
3540
data={item.contributesDigest}
3641
duration={300}
3742
radius={15}

‎containers/Sidebar/MenuList.js‎

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,40 @@ import { SortableContainer, SortableElement } from 'react-sortable-hoc'
55
importMenuBarfrom'./MenuBar'
66
import{Wrapper}from'./styles/menu_list'
77

8-
constSortableMenuBar=SortableElement(({ pin, item, activeRaw})=>(
9-
<MenuBarpin={pin}item={item}activeRaw={activeRaw}/>
10-
))
8+
constSortableMenuBar=SortableElement(
9+
({ pin, item, activeRaw, forceRerender})=>(
10+
<MenuBar
11+
pin={pin}
12+
item={item}
13+
activeRaw={activeRaw}
14+
forceRerender={forceRerender}
15+
/>
16+
)
17+
)
1118

12-
constMenuList=SortableContainer(({ items, pin, activeRaw})=>{
13-
consthomeCommunities=R.filter(R.propEq('raw','home'),items)
14-
constsortableCommunities=R.reject(R.propEq('raw','home'),items)
19+
constMenuList=SortableContainer(
20+
({ items, pin, activeRaw, forceRerender})=>{
21+
consthomeCommunities=R.filter(R.propEq('raw','home'),items)
22+
constsortableCommunities=R.reject(R.propEq('raw','home'),items)
1523

16-
return(
17-
<Wrapper>
18-
{homeCommunities.map(item=>(
19-
<MenuBarkey={item.raw}pin={pin}item={item}activeRaw={activeRaw}/>
20-
))}
21-
{sortableCommunities.map((item,index)=>(
22-
<SortableMenuBar
23-
index={index}
24-
key={item.raw}
25-
pin={pin}
26-
item={item}
27-
activeRaw={activeRaw}
28-
/>
29-
))}
30-
</Wrapper>
31-
)
32-
})
24+
return(
25+
<Wrapper>
26+
{homeCommunities.map(item=>(
27+
<MenuBarkey={item.raw}pin={pin}item={item}activeRaw={activeRaw}/>
28+
))}
29+
{sortableCommunities.map((item,index)=>(
30+
<SortableMenuBar
31+
index={index}
32+
key={item.raw}
33+
pin={pin}
34+
item={item}
35+
activeRaw={activeRaw}
36+
forceRerender={forceRerender}
37+
/>
38+
))}
39+
</Wrapper>
40+
)
41+
}
42+
)
3343

3444
exportdefaultMenuList

‎containers/Sidebar/index.js‎

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,14 @@ import * as logic from './logic'
1919
constdebug=makeDebugger('C:Sidebar:index')
2020

2121
classSidebarContainerextendsReact.Component{
22-
constructor(props){
23-
super(props)
24-
25-
/* NOTE: this foreceReload state has no use, just forece community icons rerender */
26-
/* otherwise some community logo will be misorder, reazon unknown ... */
27-
/* eslint-disable-next-line */
28-
this.state={foreceReload:false}
29-
}
30-
3122
componentDidMount(){
3223
const{ sidebar}=this.props
3324
logic.init(sidebar)
25+
3426
setTimeout(()=>{
3527
/* eslint-disable-next-line */
36-
this.setState({foreceReload:true})
37-
},100)
28+
logic.toggleForeceRerender(true)
29+
},1000)
3830
}
3931

4032
componentWillUnmount(){
@@ -43,11 +35,15 @@ class SidebarContainer extends React.Component {
4335

4436
render(){
4537
const{ sidebar}=this.props
46-
const{ curCommunity, pin, communitiesData}=sidebar
38+
const{ curCommunity, pin, communitiesData, forceRerender}=sidebar
4739
// onMouseLeave={logic.leaveSidebar}
4840
// onMouseLeave is not unreliable in chrome: https://github.com/facebook/react/issues/4492
4941
constactiveRaw=curCommunity.raw
50-
// console.log('foreceReload: ', this.state.foreceReload)
42+
/*
43+
const { forceRerender } = this.state
44+
console.log('forceRerender: ', forceRerender)
45+
*/
46+
console.log('forceRerender: ',forceRerender)
5147

5248
// debug('communitiesData ', communitiesData)
5349

@@ -57,6 +53,7 @@ class SidebarContainer extends React.Component {
5753
<MenuList
5854
items={communitiesData}
5955
pin={pin}
56+
forceRerender={forceRerender}
6057
activeRaw={activeRaw}
6158
onSortEnd={logic.onSortMenuEnd}
6259
distance={5}

‎containers/Sidebar/logic.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ const refreshSubedCommunitiesIfNeed = () => {
108108
}
109109
}
110110

111+
exportconsttoggleForeceRerender=(forceRerender=true)=>
112+
store.markState({ forceRerender})
113+
111114
constDataSolver=[
112115
{
113116
match:asyncRes('subscribedCommunities'),

‎containers/Sidebar/store.js‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ const SidebarStore = t
1515
.model('SidebarStore',{
1616
// open: t.optional(t.boolean, false),
1717
pin:t.optional(t.boolean,false),
18-
// theme: t.string, // view staff
19-
// curSelectItem: t.string, // view staff
20-
// searchBox: t.string, // complex data
21-
// loading: t.optional(t.boolean, false),
18+
19+
/*
20+
this is a fix for wired svg icon in sidebar
21+
when community icon is svg format, the svg loader only do it:s work
22+
on client-side, which will case MenuBar UI choas
23+
24+
manulay force mobx rerender will tmp fix this, heck later
25+
*/
26+
forceRerender:t.optional(t.boolean,false),
2227
})
2328
.views(self=>({
2429
getroot(){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp