This repository was archived by the owner on Nov 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 10 files changed +184
-6
lines changed
Expand file tree Collapse file tree 10 files changed +184
-6
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import { Button } from 'antd'
3+
4+ import { ICON_CMD } from '../../config'
5+
6+ import SectionLabel from '../SectionLabel'
7+ import { Wrapper , Divider } from './styles/content'
8+
9+ const Content = ( ) => (
10+ < Wrapper >
11+ < Divider />
12+ < SectionLabel
13+ title = "侵权举报"
14+ iconSrc = { `${ ICON_CMD } /police1.svg` }
15+ desc = "该内容侵犯了我的版权, 或包含盗版 / 违规转载等。"
16+ addonNode = {
17+ < Button size = "small" type = "primary" ghost >
18+ 是的, 去举报
19+ </ Button >
20+ }
21+ />
22+ < Divider />
23+ < SectionLabel
24+ title = "违法信息举报"
25+ iconSrc = { `${ ICON_CMD } /police2.svg` }
26+ desc = "该内容涉及政治,色情,暴力,民族宗教, 地域攻击等违法信息。"
27+ addonNode = {
28+ < Button size = "small" type = "primary" ghost >
29+ 是的, 去举报
30+ </ Button >
31+ }
32+ />
33+ </ Wrapper >
34+ )
35+
36+ export default Content
Original file line number Diff line number Diff line change 1+ /*
2+ *
3+ * BadContentRepot
4+ *
5+ */
6+
7+ import React from 'react'
8+ import PropTypes from 'prop-types'
9+
10+ import { ICON_CMD } from '../../config'
11+
12+ import Modal from '../Modal'
13+ import { Wrapper , Title , Icon } from './styles'
14+ import Content from './Content'
15+
16+ import { makeDebugger } from '../../utils'
17+
18+ /* eslint-disable no-unused-vars */
19+ const debug = makeDebugger ( 'c:BadContentRepot:index' )
20+ /* eslint-enable no-unused-vars */
21+
22+ class BadContentRepot extends React . Component {
23+ state = {
24+ show : false ,
25+ }
26+
27+ componentDidMount ( ) { }
28+
29+ componentWillUnmount ( ) { }
30+
31+ toggleModal ( ) {
32+ const { show } = this . state
33+ this . setState ( { show : ! show } )
34+ }
35+
36+ render ( ) {
37+ const { title } = this . props
38+ const { show } = this . state
39+
40+ return (
41+ < React . Fragment >
42+ < Modal
43+ width = "500px"
44+ show = { show }
45+ showCloseBtn
46+ onClose = { this . toggleModal . bind ( this ) }
47+ >
48+ < Content />
49+ </ Modal >
50+ < Wrapper onClick = { this . toggleModal . bind ( this ) } >
51+ < Icon src = { `${ ICON_CMD } /flag.svg` } />
52+ < Title > { title } </ Title >
53+ </ Wrapper >
54+ </ React . Fragment >
55+ )
56+ }
57+ }
58+
59+ BadContentRepot . propTypes = {
60+ // https://www.npmjs.com/package/prop-types
61+ title : PropTypes . string ,
62+ }
63+
64+ BadContentRepot . defaultProps = {
65+ title : '举报内容' ,
66+ }
67+
68+ export default BadContentRepot
Original file line number Diff line number Diff line change 1+ import styled from 'styled-components'
2+
3+ // import { Img } from '../../../components'
4+ // import { theme } from '../../../utils'
5+
6+ export const Wrapper = styled . div `
7+ display: flex;
8+ flex-direction: column;
9+ padding: 20px;
10+ `
11+ export const Divider = styled . div `
12+ margin-top: 30px;
13+ `
Original file line number Diff line number Diff line change 1+ import styled from 'styled-components'
2+
3+ import Img from '../../Img'
4+ import { theme } from '../../../utils'
5+
6+ export const Wrapper = styled . div `
7+ display: flex;
8+ align-items: center;
9+ `
10+ export const Title = styled . div `
11+ color: ${ theme ( 'thread.articleDigest' ) } ;
12+ ${ Wrapper } :hover & {
13+ color: ${ theme ( 'thread.articleTitle' ) } ;
14+ }
15+ &:hover {
16+ cursor: pointer;
17+ }
18+ `
19+ export const Icon = styled ( Img ) `
20+ fill: ${ theme ( 'thread.articleDigest' ) } ;
21+ width: 16px;
22+ height: 16px;
23+ display: block;
24+ margin-right: 3px;
25+ ${ Wrapper } :hover & {
26+ color: ${ theme ( 'thread.articleTitle' ) } ;
27+ }
28+ &:hover {
29+ cursor: pointer;
30+ }
31+ `
Original file line number Diff line number Diff line change 1+ // import React from 'react'
2+ // import { shallow } from 'enzyme'
3+
4+ // import BadContentRepot from '../index'
5+
6+ describe ( 'TODO <BadContentRepot />' , ( ) => {
7+ it ( 'Expect to have unit tests specified' , ( ) => {
8+ expect ( true ) . toEqual ( true )
9+ } )
10+ } )
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ export { default as ThreadSelector } from './ThreadSelector'
5656export { default as CommunityList } from './CommunityList'
5757export { default as AuthorCard } from './AuthorCard'
5858export { default as ContentSourceCard } from './ContentSourceCard'
59+ export { default as BadContentRepot } from './BadContentRepot'
5960
6061// loading component
6162export {
Original file line number Diff line number Diff line change 11import React from 'react'
22
3- import { AuthorCard , ContentSourceCard } from '../../components'
4- import { Wrapper } from './styles/side_cards'
3+ import {
4+ AuthorCard ,
5+ ContentSourceCard ,
6+ BadContentRepot ,
7+ } from '../../components'
8+
9+ import { Wrapper , ReportWrapper } from './styles/side_cards'
510
611const SideCards = ( { data } ) => (
712 < Wrapper >
813 < AuthorCard user = { data . author } />
914 < ContentSourceCard data = { data } />
15+ < ReportWrapper >
16+ < BadContentRepot />
17+ </ ReportWrapper >
1018 </ Wrapper >
1119)
1220
Original file line number Diff line number Diff line change @@ -7,4 +7,6 @@ export const Wrapper = styled.div`
77 flex-direction: column;
88 width: 22%;
99`
10- export const holder = 1
10+ export const ReportWrapper = styled . div `
11+ padding: 0 10px;
12+ `
Original file line number Diff line number Diff line change 11import React from 'react'
22
3- import { AuthorCard , ContentSourceCard } from '../../components'
4- import { Wrapper } from './styles/side_cards'
3+ import {
4+ AuthorCard ,
5+ ContentSourceCard ,
6+ BadContentRepot ,
7+ } from '../../components'
8+ import { Wrapper , ReportWrapper } from './styles/side_cards'
59
610const SideCards = ( { data } ) => (
711 < Wrapper >
812 < AuthorCard user = { data . author } />
913 < ContentSourceCard data = { data } />
14+ < ReportWrapper >
15+ < BadContentRepot />
16+ </ ReportWrapper >
1017 </ Wrapper >
1118)
1219
Original file line number Diff line number Diff line change @@ -7,4 +7,6 @@ export const Wrapper = styled.div`
77 flex-direction: column;
88 width: 22%;
99`
10- export const holder = 1
10+ export const ReportWrapper = styled . div `
11+ padding: 0 10px;
12+ `
You can’t perform that action at this time.
0 commit comments