forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance transparent theme & hashtag & cw button (#238)
- Loading branch information
Showing
6 changed files
with
566 additions
and
489 deletions.
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
55 changes: 55 additions & 0 deletions
55
app/javascript/mastodon/features/compose/components/cw_mark_button.js
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,55 @@ | ||
/** | ||
* This file substitude `text_icon_button.js` | ||
* @ mashiro | ||
*/ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import IconButton from '../../../components/icon_button'; | ||
import { defineMessages, injectIntl } from 'react-intl'; | ||
|
||
const messages = defineMessages({ | ||
marked: { id: 'compose_form.spoiler.marked', defaultMessage: 'Text is hidden behind warning' }, | ||
unmarked: { id: 'compose_form.spoiler.unmarked', defaultMessage: 'Text is not hidden' }, | ||
}); | ||
|
||
const iconStyle = { | ||
height: null, | ||
lineHeight: '27px', | ||
}; | ||
|
||
export default | ||
@injectIntl | ||
class CwMarkIconButton extends React.PureComponent { | ||
|
||
static propTypes = { | ||
active: PropTypes.bool, | ||
onClick: PropTypes.func.isRequired, | ||
intl: PropTypes.object.isRequired, | ||
disabled: PropTypes.bool, | ||
}; | ||
|
||
handleClick = (e) => { | ||
e.preventDefault(); | ||
this.props.onClick(); | ||
} | ||
|
||
render () { | ||
const { intl, disabled, active } = this.props; | ||
|
||
return ( | ||
<div className='compose-form__poll-button'> | ||
<IconButton | ||
icon='theater-masks' | ||
title={intl.formatMessage(active ? messages.marked : messages.unmarked)} | ||
disabled={disabled} | ||
onClick={this.handleClick} | ||
className={`compose-form__poll-button-icon ${active ? 'active' : ''}`} | ||
size={18} | ||
inverted | ||
style={iconStyle} | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
} |
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
Oops, something went wrong.