@ -4,15 +4,20 @@ import IconButton from '../../../components/icon_button';
const messages = defineMessages ( {
const messages = defineMessages ( {
public _short : { id : 'privacy.public.short' , defaultMessage : 'Public' } ,
public _short : { id : 'privacy.public.short' , defaultMessage : 'Public' } ,
public _long : { id : 'privacy.public.long' , defaultMessage : 'Post to Public T imelines' } ,
public _long : { id : 'privacy.public.long' , defaultMessage : 'Post to public t imelines' } ,
unlisted _short : { id : 'privacy.unlisted.short' , defaultMessage : 'Unlisted' } ,
unlisted _short : { id : 'privacy.unlisted.short' , defaultMessage : 'Unlisted' } ,
unlisted _long : { id : 'privacy.unlisted.long' , defaultMessage : 'Do not show in public timelines' } ,
unlisted _long : { id : 'privacy.unlisted.long' , defaultMessage : 'Do not show in public timelines' } ,
private _short : { id : 'privacy.private.short' , defaultMessage : 'Private' } ,
private _short : { id : 'privacy.private.short' , defaultMessage : 'Private' } ,
private _long : { id : 'privacy.private.long' , defaultMessage : 'Post to followers only , cannot be boosted ' } ,
private _long : { id : 'privacy.private.long' , defaultMessage : 'Post to followers only ' } ,
direct _short : { id : 'privacy.direct.short' , defaultMessage : 'Direct' } ,
direct _short : { id : 'privacy.direct.short' , defaultMessage : 'Direct' } ,
direct _long : { id : 'privacy.direct.long' , defaultMessage : 'Post to mentioned users only' }
direct _long : { id : 'privacy.direct.long' , defaultMessage : 'Post to mentioned users only' }
} ) ;
} ) ;
const iconStyle = {
lineHeight : '27px' ,
height : null
} ;
const PrivacyDropdown = React . createClass ( {
const PrivacyDropdown = React . createClass ( {
propTypes : {
propTypes : {
@ -67,14 +72,14 @@ const PrivacyDropdown = React.createClass({
{ icon : 'globe' , value : 'public' , shortText : intl . formatMessage ( messages . public _short ) , longText : intl . formatMessage ( messages . public _long ) } ,
{ icon : 'globe' , value : 'public' , shortText : intl . formatMessage ( messages . public _short ) , longText : intl . formatMessage ( messages . public _long ) } ,
{ icon : 'unlock-alt' , value : 'unlisted' , shortText : intl . formatMessage ( messages . unlisted _short ) , longText : intl . formatMessage ( messages . unlisted _long ) } ,
{ icon : 'unlock-alt' , value : 'unlisted' , shortText : intl . formatMessage ( messages . unlisted _short ) , longText : intl . formatMessage ( messages . unlisted _long ) } ,
{ icon : 'lock' , value : 'private' , shortText : intl . formatMessage ( messages . private _short ) , longText : intl . formatMessage ( messages . private _long ) } ,
{ icon : 'lock' , value : 'private' , shortText : intl . formatMessage ( messages . private _short ) , longText : intl . formatMessage ( messages . private _long ) } ,
{ icon : ' paper-plan e', value : 'direct' , shortText : intl . formatMessage ( messages . direct _short ) , longText : intl . formatMessage ( messages . direct _long ) }
{ icon : ' envelop e', value : 'direct' , shortText : intl . formatMessage ( messages . direct _short ) , longText : intl . formatMessage ( messages . direct _long ) }
] ;
] ;
const valueOption = options . find ( item => item . value === value ) ;
const valueOption = options . find ( item => item . value === value ) ;
return (
return (
< div ref = { this . setRef } className = { ` privacy-dropdown ${ open ? 'active' : '' } ` } >
< div ref = { this . setRef } className = { ` privacy-dropdown ${ open ? 'active' : '' } ` } >
< div className = 'privacy-dropdown__value' > < IconButton icon = { valueOption . icon } size = { 22 } active = { open } inverted onClick = { this . handleTogg le} / > < / div >
< div className = 'privacy-dropdown__value' > < IconButton icon = { valueOption . icon } size = { 18 } active = { open } inverted onClick = { this . handleTogg le} style = { iconSty le} / > < / div >
< div className = 'privacy-dropdown__dropdown' >
< div className = 'privacy-dropdown__dropdown' >
{ options . map ( item =>
{ options . map ( item =>
< div key = { item . value } onClick = { this . handleClick . bind ( this , item . value ) } className = { ` privacy-dropdown__option ${ item . value === value ? 'active' : '' } ` } >
< div key = { item . value } onClick = { this . handleClick . bind ( this , item . value ) } className = { ` privacy-dropdown__option ${ item . value === value ? 'active' : '' } ` } >