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

Commit cbe43ba

Browse files
committed
chore: Merge branch 'dev'
2 parents d022140 + 6e08a03 commit cbe43ba

File tree

8 files changed

+41
-33
lines changed

8 files changed

+41
-33
lines changed

components/AvatarsRow/index.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ const validUser = R.compose(
2929
R.isNil
3030
)
3131

32+
const getUniqueArray = (arr, comp) => {
33+
const unique = arr
34+
.map(e => e[comp])
35+
36+
// store the keys of the unique objects
37+
.map((e, i, final) => final.indexOf(e) === i && i)
38+
39+
// eliminate the dead keys & store unique objects
40+
.filter(e => arr[e])
41+
.map(e => arr[e])
42+
43+
return unique
44+
}
45+
3246
const AvatarsRow = ({
3347
users,
3448
total,
@@ -42,7 +56,7 @@ const AvatarsRow = ({
4256
return <span />
4357
}
4458

45-
users = R.filter(validUser, users)
59+
users = R.filter(validUser, getUniqueArray(users, 'id'))
4660
const sortedUsers = reverse ? users : R.reverse(users)
4761

4862
return (

containers/Comments/logic.js

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const defaultArgs = {
3434

3535
export const loadComents = (args = {}) => {
3636
// log('loadComents passed in: ', args)
37+
if (store.loading || store.loadingFresh) return false
3738
args = R.mergeDeepRight(defaultArgs, args)
3839
args.id = store.viewingData.id
3940
args.userHasLogin = store.isLogin
@@ -123,7 +124,10 @@ export const createReplyComment = () => {
123124
})
124125
}
125126

126-
sr71$.mutate(S.replyComment, {
127+
if (store.replying) return false
128+
129+
store.markState({ replying: true })
130+
return sr71$.mutate(S.replyComment, {
127131
id: store.replyToComment.id,
128132
body: store.replyContent,
129133
community: store.curCommunity.raw,
@@ -308,6 +312,7 @@ const DataSolver = [
308312
action: () => {
309313
store.markState({
310314
showReplyBox: false,
315+
replying: false,
311316
replyToComment: null,
312317
})
313318
scrollIntoEle('lists-info')
@@ -402,9 +407,10 @@ export const useInit = (_store, ssr) => {
402407
useEffect(() => {
403408
// log('effect init')
404409
store = _store
405-
sub$ = sr71$.data().subscribe($solver(DataSolver, ErrSolver))
406-
407-
if (!ssr) loadComents({ filter: { sort: TYPE.DESC_INSERTED } })
410+
if (!sub$) {
411+
sub$ = sr71$.data().subscribe($solver(DataSolver, ErrSolver))
412+
if (!ssr) loadComents({ filter: { sort: TYPE.DESC_INSERTED } })
413+
}
408414

409415
return () => {
410416
// log('effect uninit')
@@ -417,22 +423,3 @@ export const useInit = (_store, ssr) => {
417423
}
418424
}, [_store, ssr])
419425
}
420-
421-
/*
422-
export const init = (_store, ssr = false) => {
423-
store = _store
424-
425-
if (sub$) return false
426-
sub$ = sr71$.data().subscribe($solver(DataSolver, ErrSolver))
427-
428-
if (!ssr) return loadComents({ filter: { sort: TYPE.DESC_INSERTED } })
429-
}
430-
431-
export const uninit = () => {
432-
if (store.loading || store.loadingFresh || !sub$) return false
433-
stopDraftTimmer()
434-
sr71$.stop()
435-
sub$.unsubscribe()
436-
sub$ = null
437-
}
438-
*/

containers/Comments/schema.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const pagedComments = gql`
3434
}
3535
`
3636
const createComment = gql`
37-
mutation(
37+
mutation createComment(
3838
$community: String!
3939
$thread: CmsThread
4040
$id: ID!
@@ -64,7 +64,7 @@ const updateComment = gql`
6464
`
6565

6666
const replyComment = gql`
67-
mutation(
67+
mutation replyComment(
6868
$community: String!
6969
$thread: CmsThread
7070
$id: ID!

containers/Footer/styles/bottom_info.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const Wrapper = styled.div`
1212
`
1313
export const InnerWrapper = styled.div`
1414
${cs.flex('justify-between')};
15+
align-items: center;
1516
width: 100%;
1617
max-width: ${cs.MAX_CONTENT_WIDTH};
1718
padding: 0 5vw;

containers/JobContent/styles/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from 'styled-components'
33
import { theme, cs } from '@utils'
44

55
export const Wrapper = styled.article`
6-
${cs.flex('justify-center')};
6+
${cs.flexGrow('justify-center')};
77
padding: 20px;
88
min-height: 300px;
99
${cs.media.tablet`
@@ -20,6 +20,7 @@ export const InnerWrapper = styled.div`
2020
`};
2121
`
2222
export const MainWrapper = styled.div`
23+
flex-grow: 1;
2324
${cs.media.tablet`
2425
width: 100%;
2526
`};
@@ -34,7 +35,7 @@ export const ArticleWrapper = styled.div`
3435
background: ${theme('preview.articleBg')};
3536
border-radius: 5px;
3637
padding: 35px 40px;
37-
min-height: 60vh;
38+
min-height: 200px;
3839
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
3940
4041
${cs.media.tablet`
@@ -60,7 +61,7 @@ export const MobileWrapper = styled.div`
6061
${cs.flexColumn('align-center')};
6162
display: none;
6263
${cs.media.tablet`
63-
${cs.flex()};
64+
${cs.flex()};
6465
`};
6566
`
6667
export const MobileContentCard = styled.div`

containers/PostContent/styles/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from 'styled-components'
33
import { theme, cs } from '@utils'
44

55
export const Wrapper = styled.article`
6-
${cs.flex('justify-center')};
6+
${cs.flexGrow('justify-center')};
77
padding-top: 20px;
88
min-height: 300px;
99
@@ -21,6 +21,8 @@ export const InnerWrapper = styled.div`
2121
`};
2222
`
2323
export const MainWrapper = styled.div`
24+
flex-grow: 1;
25+
2426
${cs.media.tablet`
2527
width: 100%;
2628
`};
@@ -36,6 +38,7 @@ export const ArticleWrapper = styled.div`
3638
border-radius: 5px;
3739
padding: 35px 40px;
3840
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
41+
min-height: 200px;
3942
${cs.media.mobile`
4043
padding: 30px 20px;
4144
min-height: 20vh;

containers/RepoContent/styles/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from 'styled-components'
33
import { theme, cs } from '@utils'
44

55
export const Wrapper = styled.article`
6-
${cs.flex('justify-center')};
6+
${cs.flexGrow('justify-center')};
77
padding: 20px;
88
min-height: 300px;
99
${cs.media.tablet`
@@ -20,6 +20,7 @@ export const InnerWrapper = styled.div`
2020
`};
2121
`
2222
export const MainWrapper = styled.div`
23+
flex-grow: 1;
2324
${cs.media.tablet`
2425
width: 100%;
2526
`};
@@ -34,7 +35,7 @@ export const ArticleWrapper = styled.div`
3435
background: ${theme('preview.articleBg')};
3536
border-radius: 5px;
3637
padding: 35px 40px;
37-
min-height: 60vh;
38+
min-height: 200px;
3839
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
3940
${cs.media.tablet`
4041
padding: 30px 20px;

containers/VideoContent/styles/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from 'styled-components'
33
import { theme, cs } from '@utils'
44

55
export const Wrapper = styled.article`
6-
${cs.flex('justify-center')};
6+
${cs.flexGrow('justify-center')};
77
padding: 20px;
88
min-height: 300px;
99
${cs.media.tablet`
@@ -20,6 +20,7 @@ export const InnerWrapper = styled.div`
2020
`};
2121
`
2222
export const MainWrapper = styled.div`
23+
flex-grow: 1;
2324
${cs.media.tablet`
2425
width: 100%;
2526
`};

0 commit comments

Comments
 (0)