-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(website): implement group topic page #113
Merged
Merged
Changes from all commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
0e3a8b5
feat: new folder
cokemine 9da3b46
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine 909002e
wip
cokemine 5c444b1
fix: fix style import
cokemine f22e6d4
update api
cokemine 657a9cb
refactor: replyinfo
cokemine 540fa34
wip: add comments
cokemine 75c95c9
add comment reply
cokemine 45ce877
revert ci changes
cokemine 15ce6ca
fix some styles
cokemine 1d1d401
fix reply floor
cokemine cd06def
add reply collapse
cokemine de31299
update styles
cokemine 1028ff9
add button group
cokemine ec9b9f6
fix
cokemine 3a0ea4f
add reply editor
cokemine 783b35f
fix bbcode editor style
cokemine e3c1b62
add reply editor
cokemine 5d44f1f
add deleted state
cokemine 9bf3939
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine 822b8b1
add special comment state
cokemine c17ce25
refactor
cokemine 7155beb
wip: right col
cokemine bb7d72b
group info
cokemine 592a50f
wip
cokemine 1e5b3b4
wip
cokemine bf2c9d3
add reopen state
cokemine 974e4de
fix button style
cokemine ade0492
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine 84a1833
wip
cokemine 88c1ac1
wip
cokemine 9c27ff4
fix build
cokemine a403251
fix: reply should not show sign
cokemine 77d7599
fix
cokemine a7af1e1
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine 05cd4ef
fix: remove layout
cokemine 9d79ed6
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine 56de47b
update
cokemine d721963
refactor
cokemine 163254c
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine 25bd8dc
Update packages/website/src/pages/index/group/topic/[id]/index.tsx
cokemine 61c02a8
Merge branch 'master' into feat/group-topic
cokemine 37def0c
Merge remote-tracking branch 'upstream/master' into feat/group-topic
trim21 8967f0f
prettier
trim21 888ac07
prettier
trim21 693b933
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine 4f05ce7
Merge branch 'master' into feat/group-topic
cokemine 5bb75f1
Merge branch 'master' into feat/group-topic
cokemine ef67c33
wip
cokemine 5c90032
fix build
cokemine ba9b244
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine c90decc
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine f5f79cf
wip
cokemine 3c1f845
update styles
cokemine 85d8b8d
update story
cokemine 50d963b
refactor: move pages utils to @bangumi/utils
cokemine b30f76c
update story
cokemine 03d6efa
update
cokemine 06b9981
update
cokemine 233653e
fix and add tests
cokemine a58c1a4
wip: add tests
cokemine 8affaf1
update tests
cokemine 9916249
add tests
cokemine 1c0cdd1
update
cokemine fbd95a8
update
cokemine c227a64
links
cokemine 697a2a9
update snapshots
cokemine c7a2c39
update
cokemine d3d522a
add layout component
cokemine 59ce2ce
add error boundary
cokemine 02be365
add layout story
cokemine b9ee86b
fix styles
cokemine d77f0a2
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine 9b1cbff
fix
cokemine a9b770e
fix: add missing id
cokemine 123d1e6
update
cokemine b44cc7c
update snapshot
cokemine 4521a25
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine e862555
update
cokemine c2261be
fix test
cokemine 7864ef8
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine d9b7d9b
Merge branch 'master' into feat/group-topic
trim21 ab670f1
update
cokemine 2f3c8b9
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine 053ab01
update
cokemine 7d4f7e1
update enum
cokemine b38c505
Merge branch 'master' of https://github.com/bangumi/frontend into fea…
cokemine 4b156b8
update story
cokemine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { components } from './types'; | ||
|
||
export * from './common'; | ||
|
||
export type Comment = components['schemas']['Comment']; | ||
export type Reply = components['schemas']['Comment']['replies'][0]; | ||
|
||
// https://github.com/drwpow/openapi-typescript/issues/941 | ||
export enum State { | ||
Normal = 0, | ||
Closed = 1, | ||
Reopen = 2, | ||
Silent = 5, | ||
DeletedByUser = 6, | ||
DeletedByAdmin = 7, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,8 @@ | |
} | ||
|
||
&--medium img { | ||
height: 48px; | ||
width: 48px; | ||
height: 60px; | ||
width: 60px; | ||
} | ||
|
||
&--large img { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import React from 'react'; | ||
|
||
import Layout from '.'; | ||
|
||
const componentMeta: ComponentMeta<typeof Layout> = { | ||
title: 'Grid/Layout', | ||
component: Layout, | ||
}; | ||
|
||
export default componentMeta; | ||
|
||
const Template: ComponentStory<typeof Layout> = (args) => <Layout {...args} />; | ||
|
||
const leftChildren = <div style={{ width: '100%', height: '100vh', background: '#B5E6B5' }} />; | ||
const rightChildren = <div style={{ width: '100%', height: '100vh', background: '#FFF2E2' }} />; | ||
|
||
export const Usage = Template.bind({}); | ||
|
||
Usage.args = { | ||
type: 'alpha', | ||
leftChildren, | ||
rightChildren, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import classnames from 'classnames'; | ||
import type { FC } from 'react'; | ||
import React from 'react'; | ||
|
||
export interface LayoutProps { | ||
type: 'alpha' | 'beta'; | ||
className?: string; | ||
leftChildren?: React.ReactNode; | ||
rightChildren?: React.ReactNode; | ||
} | ||
|
||
const Index: FC<LayoutProps> = ({ leftChildren, rightChildren, type, className }) => { | ||
const containerClassNames = classnames('bgm-layout', `bgm-layout--${type}`, className); | ||
return ( | ||
<div className={containerClassNames}> | ||
<div className='bgm-layout__left'>{leftChildren}</div> | ||
<div className='bgm-layout__right'>{rightChildren}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.bgm-layout { | ||
display: flex; | ||
|
||
&--alpha { | ||
.bgm-layout__left { | ||
width: 913px; | ||
flex: 1; | ||
margin-right: 40px; | ||
} | ||
|
||
.bgm-layout__right { | ||
width: 427px; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import './index.less'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,8 @@ | |
color: @blue-100; | ||
text-decoration: none; | ||
} | ||
|
||
img { | ||
max-width: 99%; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import type { ComponentStory } from '@storybook/react'; | ||
import React from 'react'; | ||
|
||
import { State } from '@bangumi/client/topic'; | ||
|
||
import repliesComment from './__test__/fixtures/repliesComment.json'; | ||
import singleComment from './__test__/fixtures/singleComment.json'; | ||
import specialComment from './__test__/fixtures/specialComment.json'; | ||
import mockedCurrentUser from './__test__/fixtures/user.json'; | ||
import type { CommentProps } from './Comment'; | ||
import Comment from './Comment'; | ||
|
||
export default { | ||
title: 'Topic/Comment', | ||
component: Comment, | ||
}; | ||
|
||
const Template: ComponentStory<typeof Comment> = (args: CommentProps & { states?: State[] }) => { | ||
// 0 正常评论 6 被用户删除 7 违反社区指导原则,已被删除 | ||
cokemine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// 1 关闭 2 重开 5 下沉 | ||
return ( | ||
<div style={{ width: 913 }}> | ||
{(args.states ?? [0]).map((state, idx) => ( | ||
<div key={idx} style={{ marginBottom: 20 }}> | ||
<h1>State: {state}</h1> | ||
<Comment {...args} state={state} /> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export const SingleComment = Template.bind({}); | ||
|
||
SingleComment.args = { | ||
...singleComment, | ||
isReply: false, | ||
is_friend: true, | ||
originalPosterId: 1, | ||
created_at: String(new Date()), | ||
floor: 2, | ||
states: [State.Normal, State.DeletedByUser, State.DeletedByAdmin], | ||
} as any; | ||
|
||
export const CommentWithReplies = Template.bind({}); | ||
CommentWithReplies.args = { | ||
...repliesComment, | ||
isReply: false, | ||
is_friend: false, | ||
created_at: String(new Date()), | ||
floor: 2, | ||
} as any; | ||
|
||
export const SelfComment = Template.bind({}); | ||
|
||
const selfUser = { ...mockedCurrentUser, id: 1 }; | ||
|
||
SelfComment.args = { | ||
...singleComment, | ||
isReply: false, | ||
is_friend: false, | ||
created_at: String(new Date()), | ||
user: selfUser, | ||
floor: 2, | ||
} as any; | ||
|
||
export const SpecialComment = Template.bind({}); | ||
|
||
SpecialComment.args = { | ||
...specialComment, | ||
isReply: false, | ||
is_friend: false, | ||
created_at: String(new Date()), | ||
floor: 2, | ||
states: [State.Closed, State.Reopen, State.Silent], | ||
} as any; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beta 好像没有用到?话说 alpha 是什么意思?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看了看小组页面、小组主题帖、和搜索页面的布局是一样的。 条目具体信息会用另一套布局。应该不会有太多布局就放着复用了(