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.

feat(abuse report): redesign#1069

Merged
mydearxym merged 21 commits intodevfromabuse-report
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
21 commits
Select commitHold shift + click to select a range
160d1e9
chore(abuse-report): basic setup && fix generator typo
mydearxymApr 25, 2021
bc7db91
chore(abuse-report): wip
mydearxymApr 25, 2021
ba1b4ea
chore(abuse-report): wip
mydearxymApr 25, 2021
f378e63
chore(abuse-report): wip
mydearxymApr 25, 2021
1980ef4
chore(abuse-report): wip
mydearxymApr 25, 2021
8c9584d
chore(abuse-report): wip
mydearxymApr 25, 2021
add3391
chore(abuse-report): wip
mydearxymApr 25, 2021
2b4f54d
chore(abuse-report): wip
mydearxymApr 25, 2021
95f83af
chore(abuse-report): wip
mydearxymApr 25, 2021
495d4b8
chore(abuse-report): wip
mydearxymApr 25, 2021
dd5650c
chore(abuse-report): wip
mydearxymApr 25, 2021
b0ad3f5
chore(abuse-report): wip
mydearxymApr 25, 2021
2f1fa08
chore(abuse-report): wip
mydearxymApr 26, 2021
04a3acb
refactor(reporter): update docs
mydearxymApr 26, 2021
f8067ad
chore(abuse-report): wip
mydearxymApr 26, 2021
ae7d3e2
chore(abuse-report): wip
mydearxymApr 26, 2021
d1ee672
chore(abuse-report): wip
mydearxymApr 26, 2021
241f3ef
chore(abuse-report): remove old informer system
mydearxymApr 26, 2021
1b064e5
chore(abuse-report): ignore error
mydearxymApr 26, 2021
d996f82
chore(abuse-report): build error
mydearxymApr 26, 2021
b42b55d
chore(abuse-report): build error
mydearxymApr 26, 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
1 change: 0 additions & 1 deletion.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,5 +12,4 @@ cypress//integration/examples
cypress/videos/
.vscode/
.DS_Store
report.*
.eslintcache
1 change: 1 addition & 0 deletionspublic/icons/static/article/report-solid.svg
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletionspublic/icons/static/article/report.svg
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 1 addition & 13 deletionssrc/components/ArticleActionsPanel/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,18 +8,16 @@ import React from 'react'
import T from 'prop-types'
import { values } from 'ramda'

import { ICON_CMD } from '@/config'
import { THREAD } from '@/constant'
import { buildLog } from '@/utils'

import Informer from '@/containers/tool/Informer'
import PinOption from './PinOption'
import RefineOption from './RefineOption'
import EditOption from './EditOption'
import CommunitySetterOption from './CommunitySetterOption'
import DeleteOption from './DeleteOption'

import { Wrapper, Option, OptionIcon, OptionTitle } from './styles'
import { Wrapper } from './styles'

/* eslint-disable-next-line */
const log = buildLog('c:ArticleActionsPanel:index')
Expand All@@ -33,7 +31,6 @@ const ArticleActionsPanel = ({
onSetRefined,
onUnsetRefined,
onEdit,
onInform,
onDelete,
onCommunitySet,
}) => {
Expand DownExpand Up@@ -66,13 +63,6 @@ const ArticleActionsPanel = ({
onCommunitySet={onCommunitySet}
/>

<Informer>
<Option onClick={onInform}>
<OptionIcon src={`${ICON_CMD}/flag.svg`} />
<OptionTitle>举报该内容</OptionTitle>
</Option>
</Informer>

<DeleteOption
passport="owner"
ownerId={data.author?.id}
Expand DownExpand Up@@ -100,7 +90,6 @@ ArticleActionsPanel.propTypes = {
}).isRequired,
communityRaw: T.string.isRequired,
thread: T.oneOf(values(THREAD)),
onInform: T.func,
onDelete: T.func,
onEdit: T.func,
onPin: T.func,
Expand All@@ -112,7 +101,6 @@ ArticleActionsPanel.propTypes = {

ArticleActionsPanel.defaultProps = {
thread: THREAD.POST,
onInform: log,
onDelete: log,
onEdit: log,
onPin: log,
Expand Down
2 changes: 1 addition & 1 deletionsrc/components/Buttons/ArrowButton.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ type TProps = {
direction?: 'left' | 'right'
dimWhenIdle?: boolean
disabled?: boolean
arrowStyle?:string
arrowStyle?:'default' | 'simple'
}

const ArrowButton: React.FC<TProps> = ({
Expand Down
34 changes: 34 additions & 0 deletionssrc/components/Buttons/YesOrNoButtons.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
import React from 'react'

import { Space } from '@/components/Common'
import Button from './Button'

import { Wrapper, CancelBtn } from './styles/yes_or_no_buttons'

type TProps = {
align?: 'center' | 'right'
cancelText?: string
confirmText?: string
onCancel?: () => void
onConfirm?: () => void
}

const YesOrNoButton: React.FC<TProps> = ({
align = 'center',
cancelText = '取消',
confirmText = '确定',
onCancel = console.log,
onConfirm = console.log,
}) => {
return (
<Wrapper align={align}>
<CancelBtn onClick={() => onCancel?.()}>{cancelText}</CancelBtn>
<Space left={5} right={10} />
<Button size="small" type="primary" onClick={() => onConfirm?.()}>
{confirmText}
</Button>
</Wrapper>
)
}

export default YesOrNoButton
1 change: 1 addition & 0 deletionssrc/components/Buttons/index.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,3 +6,4 @@ export { default as OrButton } from './OrButton'
export { default as DropdownButton } from './DropdownButton'
export { default as NotifyButton } from './NotifyButton'
export { default as FollowButton } from './FollowButton'
export { default as YesOrNoButtons } from './YesOrNoButtons'
15 changes: 15 additions & 0 deletionssrc/components/Buttons/styles/yes_or_no_buttons.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
import styled from 'styled-components'

import { css, theme } from '@/utils'

type TWrapper = { align: 'center' | 'right' }
export const Wrapper = styled.div<TWrapper>`
${css.flex('align-center')};
width: 100%;
justify-content: ${({ align }) =>
align === 'center' ? 'center' : 'flex-end'};
`
export const CancelBtn = styled.div`
color: ${theme('button.primary')};
font-size: 14px;
`
8 changes: 4 additions & 4 deletionssrc/components/Checker/index.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,19 +17,19 @@ import { Wrapper, IconWrapper, Icon, ChildWrapper } from './styles'
const log = buildLog('c:Checker:index')

type TProps = {
children: React.ReactNode
children?: React.ReactNode | null
checked?: boolean
hiddenMode: boolean
hiddenMode?: boolean
size?: TSIZE_SM
onChange: (checked: boolean) => void
onChange?: (checked: boolean) => void
}

const Checker: React.FC<TProps> = ({
checked = false,
onChange = log,
hiddenMode = false,
size = SIZE.MEDIUM,
children,
children = null,
}) => {
const show = checked || !hiddenMode

Expand Down
5 changes: 2 additions & 3 deletionssrc/components/Checker/styles/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,13 +14,12 @@ export const Wrapper = styled.div<TActive>`
`
export const IconWrapper = styled.div<TItem>`
position: relative;
background: ${({ checked }) => (checked ? '#114759' : '#00262F')};
background: ${({ checked }) => (checked ? '#0d3d4e' : '#012f3a')};
width: ${({ size }) => getIconSize(size)};
height: ${({ size }) => getIconSize(size)};
${css.flex('align-both')};
border: 1px solid;
border-color: ${({ checked }) => (checked ? 'transparent' : '#114759')};

border-color: ${({ checked }) => (checked ? '#246b8c' : '#1c5975')};
border-radius: ${({ size }) => getBorderRadius(size)};

transition: all 0.2s;
Expand Down
1 change: 1 addition & 0 deletionssrc/components/FormItem/styles/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,6 +26,7 @@ export const TextAreaInput = styled(Input)<{ error: string }>`
error === 'true' ? theme('baseColor.red') : ''};
border-right-color: ${({ error }) =>
error === 'true' ? theme('baseColor.red') : ''};
border: 1px solid tomato;
`

export const FormItemWrapper = styled.div<TSpace>`
Expand Down
51 changes: 0 additions & 51 deletionssrc/components/Input/Textarea.js
View file
Open in desktop

This file was deleted.

43 changes: 43 additions & 0 deletionssrc/components/Input/Textarea.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
/*
*
* Input
*
*/

import React, { useCallback } from 'react'
import { pickBy } from 'ramda'

import { buildLog } from '@/utils'

import { Wrapper } from './styles/textarea'

/* eslint-disable-next-line */
const log = buildLog('c:Input:index')

type TProps = {
testid?: string
placeholder?: string
value?: string | null
onChange?: (e) => void | null
}

const Textarea: React.FC<TProps> = ({
onChange = null,
testid = 'textarea',
...restProps
}) => {
const handleOnChange = useCallback((e) => onChange?.(e), [onChange])
const validProps = pickBy((v) => v !== null, restProps)

return (
<Wrapper
testid={testid}
onChange={handleOnChange}
minRows={1}
spellcheck="false"
{...validProps}
/>
)
}

export default React.memo(Textarea)
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,6 @@
*/

import React, { useCallback } from 'react'
import T from 'prop-types'
import { pickBy } from 'ramda'

import { buildLog, nilOrEmpty } from '@/utils'
Expand All@@ -22,14 +21,29 @@ import {
/* eslint-disable-next-line */
const log = buildLog('c:Input:index')

const Input = ({
behavior,
onChange,
prefixIcon,
prefixActive,
suffixIcon,
suffixActive,
testid,
type TProps = {
testid?: string
behavior?: 'default' | 'textarea'
placeholder?: string
value?: string | null
prefixIcon?: string | null
prefixActive?: boolean
suffixIcon?: string | null
suffixActive?: boolean
disabled?: boolean
autoFocus?: boolean

onChange?: (e) => void | null
}

const Input: React.FC<TProps> = ({
behavior = 'default',
onChange = null,
prefixIcon = null,
prefixActive = false,
suffixIcon = null,
suffixActive = false,
testid = 'input',
...restProps
}) => {
const handleOnChange = useCallback((e) => onChange && onChange(e), [onChange])
Expand All@@ -53,36 +67,8 @@ const Input = ({
</SuffixWrapper>
</Wrapper>
) : (
<Textarea testid={testid} onChange={onChange}minRows={1}{...restProps} />
<Textarea testid={testid} onChange={onChange} {...restProps} />
)
}

Input.propTypes = {
behavior: T.oneOf(['default', 'textarea']),
placeholder: T.string,
value: T.oneOfType([T.string, T.instanceOf(null)]),
onChange: T.oneOfType([T.func, T.instanceOf(null)]),
prefixIcon: T.oneOfType([T.string, T.instanceOf(null)]),
prefixActive: T.bool,
suffixIcon: T.oneOfType([T.string, T.instanceOf(null)]),
suffixActive: T.bool,
disabled: T.bool,
autoFocus: T.bool,
testid: T.string,
}

Input.defaultProps = {
behavior: 'default',
placeholder: '',
value: null,
onChange: null,
prefixIcon: null,
prefixActive: false,
suffixIcon: null,
suffixActive: false,
disabled: false,
autoFocus: false,
testid: 'input',
}

export default React.memo(Input)
1 change: 1 addition & 0 deletionssrc/components/Input/styles/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ import { css, theme } from '@/utils'
type IInput = {
hasPrefix: boolean
hasSuffix: boolean
spellcheck: string
}

export const Wrapper = styled.div.attrs(({ testid }: TTestable) => ({
Expand Down
9 changes: 7 additions & 2 deletionssrc/components/Input/styles/textarea.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,13 +6,18 @@ import { theme } from '@/utils'

import { baseInput } from './index'

type TWrapper = TTestable | { spellcheck: string }

export const Wrapper = styled(TextareaAutosize).attrs(
({ testid }: TTestable) => ({
'data-test-id': testid,
}),
)<TTestable>`
)<TWrapper>`
${baseInput};
background-color: #0b2631;
color: ${theme('form.text')};
min-height: 56px;
padding: 6px 10px;
background-color: #06303b;
border: 1px solid;
border-color: ${theme('editor.border')};
resize: none;
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp