Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bb37037
refactor(comment-editor): wip
mydearxym Oct 18, 2021
3893214
refactor(comment-editor): re-org wip
mydearxym Oct 18, 2021
744c224
refactor(comment-editor): re-org wip
mydearxym Oct 18, 2021
26a9d77
refactor(comment-editor): re-org & ssr cookie logic
mydearxym Oct 19, 2021
0d0ca60
refactor(comment-editor): publish workflow done & style dajust
mydearxym Oct 19, 2021
194f37d
refactor(update): put isAuthorUptoved into workflow
mydearxym Oct 19, 2021
b882220
refactor(comment-editor): update logic wip
mydearxym Oct 19, 2021
c00811e
refactor(comment-editor): update logic done
mydearxym Oct 20, 2021
2f02622
refactor(comment-editor): show action when hover
mydearxym Oct 20, 2021
051d415
refactor(comment-editor): reply, update, create workflow done
mydearxym Oct 20, 2021
501533f
refactor(comment-editor): re-org update method
mydearxym Oct 20, 2021
b4a2df2
refactor: re-org all editor to Editor
mydearxym Oct 20, 2021
3e08ccc
refactor(comment-list): replies states debug
mydearxym Oct 20, 2021
1832229
refactor(comment-list): replies logic & upvote style
mydearxym Oct 20, 2021
f10fb9f
refactor(comment-list): replies pagi logic
mydearxym Oct 20, 2021
9272298
refactor(comment-list): remove tobeDelete concept
mydearxym Oct 21, 2021
9dc6a5b
refactor(comment-list): pagi logic & adjust style
mydearxym Oct 21, 2021
9555b12
refactor(comment-list): wip
mydearxym Oct 21, 2021
72831ca
refactor(comment-list): adjust upvote & indent-line size/margin
mydearxym Oct 21, 2021
9c6bedb
refactor(comments): new comment state api
mydearxym Oct 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 44 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"dependencies": {
"@babel/core": "^7.13.14",
"@groupher/react-editor": "^1.1.28",
"@groupher/react-editor": "^1.1.29",
"@next/bundle-analyzer": "^9.4.4",
"@sentry/browser": "5.17.0",
"@sentry/node": "5.17.0",
Expand All @@ -56,14 +56,14 @@
"chalk": "^2.4.1",
"compatible-debug": "^1.0.0",
"cookie-parser": "^1.4.4",
"cookies-next": "^2.0.3",
"core-js": "3.6.5",
"cross-env": "^7.0.2",
"express": "^4.16.4",
"glob": "^7.1.2",
"graphql": "^15.5.1",
"graphql-request": "3.5.0",
"graphql-voyager": "^1.0.0-rc.31",
"js-cookie": "^2.2.0",
"mastani-codehighlight": "0.0.7",
"mobx": "6.3.2",
"mobx-react": "7.2.0",
Expand Down
1 change: 0 additions & 1 deletion server/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const renderAndCache = ({ req, res, path }) => {
// do not cache in dev mode
if (dev) {
const pagePath = path || req.path
console.log('# pagePath: ', pagePath)
return app.render(req, res, pagePath, {
...req.query,
...req.params,
Expand Down
2 changes: 1 addition & 1 deletion src/components/AnimatedCount/AnimatedCount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const AnimatedCount: FC<TProps> = ({
active = false,
}) => {
return (
<Wrapper size={size} $active={active}>
<Wrapper size={size} $active={active} count={count}>
<AnimateOnChange
animationIn="fadeInUp"
animationOut="bounceOut"
Expand Down
2 changes: 1 addition & 1 deletion src/components/AnimatedCount/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const AnimatedCount = dynamic(() => import('./AnimatedCount'), {
active: boolean
}
return (
<Wrapper size={size} $active={active}>
<Wrapper size={size} $active={active} count={count}>
{count}
</Wrapper>
)
Expand Down
8 changes: 3 additions & 5 deletions src/components/AnimatedCount/styles/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import styled from 'styled-components'

import type { TSIZE, TActive } from '@/spec'
import { theme } from '@/utils/themes'

import { getFontSize } from './metric'
import { getFontSize, getCountColor } from './metric'

type TWrapper = { size: TSIZE } & TActive
type TWrapper = { size: TSIZE; count: number } & TActive

export const Wrapper = styled.div<TWrapper>`
color: ${({ $active }) =>
$active ? '#139C9E' : theme('thread.articleTitle')};
color: ${({ $active, count }) => getCountColor($active, count)};
font-size: ${({ size }) => getFontSize(size)};
font-weight: ${({ $active }) => ($active ? 'bold' : 'normal')};
overflow-y: hidden;
Expand Down
10 changes: 9 additions & 1 deletion src/components/AnimatedCount/styles/metric.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { TSIZE } from '@/spec'
import { SIZE } from '@/constant'

import { theme } from '@/utils/themes'

export const getFontSize = (size: TSIZE): string => {
switch (size) {
case SIZE.TINY: {
Expand All @@ -15,4 +17,10 @@ export const getFontSize = (size: TSIZE): string => {
}
}

export const holder = 1
export const getCountColor = ($active: boolean, count: number): string => {
if ($active) return '#139C9E'
if (count === 0) return '#4f7478'
if (count >= 5) return theme('thread.articleTitle')

return theme('thread.articleDigest')
}
2 changes: 1 addition & 1 deletion src/components/ArtimentBody/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const ArtimentBody: FC<TProps> = ({

return (
<Wrapper testid={testid}>
<Body ref={bodyRef} lineClampNum={lineClampNum}>
<Body ref={bodyRef} lineClampNum={lineClampNum} mode={mode}>
<HTML
dangerouslySetInnerHTML={{
__html: document.bodyHtml,
Expand Down
5 changes: 3 additions & 2 deletions src/components/ArtimentBody/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ export const Wrapper = styled.div.attrs(({ testid }: TTestable) => ({
'data-test-id': testid,
}))<TTestable>``

export const Body = styled.div<{ lineClampNum: number }>`
font-size: 16px;
type TBody = { lineClampNum: number; mode: 'article' | 'comment' }
export const Body = styled.div<TBody>`
font-size: ${({ mode }) => (mode === 'article' ? '16px' : '15px')};
line-height: 1.85;
position: relative;
display: -webkit-box;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Buttons/SubmitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const SubmitButton: FC<TProps> = ({
{publishDone ? (
<DonwWrapper>
<DoneIcon />
<DoneHint>已完成</DoneHint>
<DoneHint>已提交</DoneHint>
</DonwWrapper>
) : (
<YesOrNoButtons
Expand Down
69 changes: 0 additions & 69 deletions src/components/ContentSourceCard/DesktopView.js

This file was deleted.

Loading