2018-01-10 03:25:38 +01:00
|
|
|
import React from 'react';
|
2018-01-13 00:02:42 +01:00
|
|
|
import PropTypes from 'prop-types';
|
2018-01-10 03:25:38 +01:00
|
|
|
|
2018-01-24 21:02:40 +01:00
|
|
|
function UrlMiddle ({publishInChannel, selectedChannel, loggedInChannelName, loggedInChannelShortId}) {
|
2018-01-10 03:49:26 +01:00
|
|
|
if (publishInChannel) {
|
2018-01-24 21:02:40 +01:00
|
|
|
if (selectedChannel === loggedInChannelName) {
|
2018-03-08 05:18:17 +01:00
|
|
|
return <span id='url-channel' className='url-text--secondary'>{loggedInChannelName}:{loggedInChannelShortId} /</span>;
|
2018-01-10 03:25:38 +01:00
|
|
|
}
|
2018-03-08 05:18:17 +01:00
|
|
|
return <span id='url-channel-placeholder' className='url-text--secondary tooltip'>@channel<span
|
|
|
|
className='tooltip-text'>Select a channel below</span> /</span>;
|
2018-01-10 03:25:38 +01:00
|
|
|
}
|
|
|
|
return (
|
2018-03-08 05:18:17 +01:00
|
|
|
<span id='url-no-channel-placeholder' className='url-text--secondary tooltip'>xyz<span className='tooltip-text'>This will be a random id</span> /</span>
|
2018-01-10 03:25:38 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2018-01-13 00:02:42 +01:00
|
|
|
UrlMiddle.propTypes = {
|
|
|
|
publishInChannel : PropTypes.bool.isRequired,
|
2018-01-18 19:13:51 +01:00
|
|
|
loggedInChannelName : PropTypes.string,
|
|
|
|
loggedInChannelShortId: PropTypes.string,
|
2018-01-13 00:02:42 +01:00
|
|
|
};
|
|
|
|
|
2018-01-10 03:25:38 +01:00
|
|
|
export default UrlMiddle;
|