commit
fca2dff2e2
869 changed files with 6855 additions and 4431 deletions
@ -1,18 +0,0 @@ |
||||
export const MODAL_OPEN = 'MODAL_OPEN'; |
||||
export const MODAL_CLOSE = 'MODAL_CLOSE'; |
||||
|
||||
export function openModal(type, props) { |
||||
return { |
||||
type: MODAL_OPEN, |
||||
modalType: type, |
||||
modalProps: props, |
||||
}; |
||||
} |
||||
|
||||
export function closeModal(type, options = { ignoreFocus: false }) { |
||||
return { |
||||
type: MODAL_CLOSE, |
||||
modalType: type, |
||||
ignoreFocus: options.ignoreFocus, |
||||
}; |
||||
} |
@ -0,0 +1,17 @@ |
||||
import { createAction } from '@reduxjs/toolkit'; |
||||
|
||||
import type { MODAL_COMPONENTS } from '../features/ui/components/modal_root'; |
||||
|
||||
export type ModalType = keyof typeof MODAL_COMPONENTS; |
||||
|
||||
interface OpenModalPayload { |
||||
modalType: ModalType; |
||||
modalProps: unknown; |
||||
} |
||||
export const openModal = createAction<OpenModalPayload>('MODAL_OPEN'); |
||||
|
||||
interface CloseModalPayload { |
||||
modalType: ModalType | undefined; |
||||
ignoreFocus: boolean; |
||||
} |
||||
export const closeModal = createAction<CloseModalPayload>('MODAL_CLOSE'); |
@ -1,35 +0,0 @@ |
||||
import React from 'react'; |
||||
import PropTypes from 'prop-types'; |
||||
import { injectIntl, defineMessages } from 'react-intl'; |
||||
import { Icon } from 'flavours/glitch/components/icon'; |
||||
|
||||
const messages = defineMessages({ |
||||
load_more: { id: 'status.load_more', defaultMessage: 'Load more' }, |
||||
}); |
||||
|
||||
class LoadGap extends React.PureComponent { |
||||
|
||||
static propTypes = { |
||||
disabled: PropTypes.bool, |
||||
maxId: PropTypes.string, |
||||
onClick: PropTypes.func.isRequired, |
||||
intl: PropTypes.object.isRequired, |
||||
}; |
||||
|
||||
handleClick = () => { |
||||
this.props.onClick(this.props.maxId); |
||||
}; |
||||
|
||||
render () { |
||||
const { disabled, intl } = this.props; |
||||
|
||||
return ( |
||||
<button className='load-more load-gap' disabled={disabled} onClick={this.handleClick} aria-label={intl.formatMessage(messages.load_more)}> |
||||
<Icon id='ellipsis-h' /> |
||||
</button> |
||||
); |
||||
} |
||||
|
||||
} |
||||
|
||||
export default injectIntl(LoadGap); |
@ -0,0 +1,36 @@ |
||||
import { useCallback } from 'react'; |
||||
|
||||
import type { InjectedIntl } from 'react-intl'; |
||||
import { injectIntl, defineMessages } from 'react-intl'; |
||||
|
||||
import { Icon } from 'flavours/glitch/components/icon'; |
||||
|
||||
const messages = defineMessages({ |
||||
load_more: { id: 'status.load_more', defaultMessage: 'Load more' }, |
||||
}); |
||||
|
||||
interface Props { |
||||
disabled: boolean; |
||||
maxId: string; |
||||
onClick: (maxId: string) => void; |
||||
intl: InjectedIntl; |
||||
} |
||||
|
||||
const _LoadGap: React.FC<Props> = ({ disabled, maxId, onClick, intl }) => { |
||||
const handleClick = useCallback(() => { |
||||
onClick(maxId); |
||||
}, [maxId, onClick]); |
||||
|
||||
return ( |
||||
<button |
||||
className='load-more load-gap' |
||||
disabled={disabled} |
||||
onClick={handleClick} |
||||
aria-label={intl.formatMessage(messages.load_more)} |
||||
> |
||||
<Icon id='ellipsis-h' /> |
||||
</button> |
||||
); |
||||
}; |
||||
|
||||
export const LoadGap = injectIntl(_LoadGap); |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue