diff --git a/app/javascript/gabsocial/common.js b/app/javascript/gabsocial/common.js index 22146c0e..6397c4ae 100644 --- a/app/javascript/gabsocial/common.js +++ b/app/javascript/gabsocial/common.js @@ -3,7 +3,6 @@ import Rails from 'rails-ujs'; export function start() { - require('font-awesome/css/font-awesome.css'); require.context('../images/', true); try { diff --git a/app/javascript/gabsocial/components/account/account.js b/app/javascript/gabsocial/components/account/account.js index d1b92551..a326fecb 100644 --- a/app/javascript/gabsocial/components/account/account.js +++ b/app/javascript/gabsocial/components/account/account.js @@ -1,14 +1,13 @@ -import { Fragment } from 'react'; -import { Link } from 'react-router-dom'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import { defineMessages, injectIntl } from 'react-intl'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { me } from '../../initial_state'; -import Avatar from '../avatar/avatar'; -import DisplayName from '../display_name'; -import IconButton from '../icon_button'; - -import './account.scss'; +import { Fragment } from 'react' +import { NavLink } from 'react-router-dom' +import ImmutablePropTypes from 'react-immutable-proptypes' +import { defineMessages, injectIntl } from 'react-intl' +import ImmutablePureComponent from 'react-immutable-pure-component' +import { me } from '../../initial_state' +import Avatar from '../avatar/avatar' +import DisplayName from '../display_name' +import IconButton from '../icon_button' +import Icon from '../icon' const messages = defineMessages({ follow: { id: 'account.follow', defaultMessage: 'Follow' }, @@ -18,7 +17,7 @@ const messages = defineMessages({ unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' }, mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' }, unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'Unmute notifications from @{name}' }, -}); +}) export default @injectIntl class Account extends ImmutablePureComponent { @@ -34,37 +33,36 @@ class Account extends ImmutablePureComponent { actionIcon: PropTypes.string, actionTitle: PropTypes.string, onActionClick: PropTypes.func, - displayOnly: PropTypes.bool, - }; + } handleFollow = () => { - this.props.onFollow(this.props.account); + this.props.onFollow(this.props.account) } handleBlock = () => { - this.props.onBlock(this.props.account); + this.props.onBlock(this.props.account) } handleMute = () => { - this.props.onMute(this.props.account); + this.props.onMute(this.props.account) } handleMuteNotifications = () => { - this.props.onMuteNotifications(this.props.account, true); + this.props.onMuteNotifications(this.props.account, true) } handleUnmuteNotifications = () => { - this.props.onMuteNotifications(this.props.account, false); + this.props.onMuteNotifications(this.props.account, false) } handleAction = () => { - this.props.onActionClick(this.props.account); + this.props.onActionClick(this.props.account) } render() { - const { account, intl, hidden, onActionClick, actionIcon, actionTitle, displayOnly } = this.props; + const { account, intl, hidden, onActionClick, actionIcon, actionTitle } = this.props - if (!account) return null; + if (!account) return null if (hidden) { return ( @@ -72,29 +70,29 @@ class Account extends ImmutablePureComponent { {account.get('display_name')} {account.get('username')} - ); + ) } - let buttons; + let buttons if (onActionClick && actionIcon) { - buttons = ; + buttons = } else if (account.get('id') !== me && account.get('relationship', null) !== null) { - const following = account.getIn(['relationship', 'following']); - const requested = account.getIn(['relationship', 'requested']); - const blocking = account.getIn(['relationship', 'blocking']); - const muting = account.getIn(['relationship', 'muting']); + const following = account.getIn(['relationship', 'following']) + const requested = account.getIn(['relationship', 'requested']) + const blocking = account.getIn(['relationship', 'blocking']) + const muting = account.getIn(['relationship', 'muting']) if (requested) { - buttons = ; + buttons = } else if (blocking) { - buttons = ; + buttons = } else if (muting) { - let hidingNotificationsButton; + let hidingNotificationsButton if (account.getIn(['relationship', 'muting_notifications'])) { - hidingNotificationsButton = ; + hidingNotificationsButton = } else { - hidingNotificationsButton = ; + hidingNotificationsButton = } buttons = ( @@ -102,41 +100,44 @@ class Account extends ImmutablePureComponent { {hidingNotificationsButton} - ); + ) } else if (!account.get('moved') || following) { - buttons = ; + buttons = } } - if (displayOnly) { - return ( -
-
-
-
- -
- -
-
-
- ); - } - return ( -
-
- -
- - +
+
-
- {buttons} + + + + +
+ + + +
+ + +
- ); + ) } } diff --git a/app/javascript/gabsocial/components/assets/gab_logo/gab_logo.js b/app/javascript/gabsocial/components/assets/gab_logo.js similarity index 98% rename from app/javascript/gabsocial/components/assets/gab_logo/gab_logo.js rename to app/javascript/gabsocial/components/assets/gab_logo.js index 49274119..f80ab805 100644 --- a/app/javascript/gabsocial/components/assets/gab_logo/gab_logo.js +++ b/app/javascript/gabsocial/components/assets/gab_logo.js @@ -1,5 +1,3 @@ -import './gab_logo.scss' - const GabLogo = ({ width = '50px', height = '30px', diff --git a/app/javascript/gabsocial/components/assets/gab_logo/gab_logo.scss b/app/javascript/gabsocial/components/assets/gab_logo/gab_logo.scss deleted file mode 100644 index 0874d5f1..00000000 --- a/app/javascript/gabsocial/components/assets/gab_logo/gab_logo.scss +++ /dev/null @@ -1,9 +0,0 @@ -.gab-logo { - enable-background: new 0 0 50 30; - - &__path { - fill-rule: evenodd; - clip-rule: evenodd; - fill: $gab-brand-default; - } -} \ No newline at end of file diff --git a/app/javascript/gabsocial/components/assets/gab_logo/index.js b/app/javascript/gabsocial/components/assets/gab_logo/index.js deleted file mode 100644 index e68f094a..00000000 --- a/app/javascript/gabsocial/components/assets/gab_logo/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './gab_logo'; \ No newline at end of file diff --git a/app/javascript/gabsocial/components/autosuggest_account/autosuggest_account.js b/app/javascript/gabsocial/components/autosuggest_account/autosuggest_account.js index 441e02b2..6ff06fcb 100644 --- a/app/javascript/gabsocial/components/autosuggest_account/autosuggest_account.js +++ b/app/javascript/gabsocial/components/autosuggest_account/autosuggest_account.js @@ -4,8 +4,6 @@ import { makeGetAccount } from '../../selectors'; import Avatar from '../avatar'; import DisplayName from '../display_name'; -import './autosuggest_account.scss'; - const makeMapStateToProps = () => { const getAccount = makeGetAccount(); diff --git a/app/javascript/gabsocial/components/autosuggest_emoji/autosuggest_emoji.js b/app/javascript/gabsocial/components/autosuggest_emoji/autosuggest_emoji.js index 57629f4e..6d08233c 100644 --- a/app/javascript/gabsocial/components/autosuggest_emoji/autosuggest_emoji.js +++ b/app/javascript/gabsocial/components/autosuggest_emoji/autosuggest_emoji.js @@ -1,7 +1,5 @@ import unicodeMapping from '../emoji/emoji_unicode_mapping_light'; -import './autosuggest_emoji.scss'; - const assetHost = process.env.CDN_HOST || ''; export default class AutosuggestEmoji extends PureComponent { diff --git a/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js b/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js index fd8ebcac..c26d57e9 100644 --- a/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js +++ b/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js @@ -1,3 +1,4 @@ +import { Fragment } from 'react' import ImmutablePropTypes from 'react-immutable-proptypes'; import classNames from 'classnames'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -7,8 +8,6 @@ import { textAtCursorMatchesToken } from '../../utils/cursor_token_match'; import AutosuggestAccount from '../autosuggest_account'; import AutosuggestEmoji from '../autosuggest_emoji'; -import './autosuggest_textbox.scss'; - export default class AutosuggestTextbox extends ImmutablePureComponent { static propTypes = { @@ -198,15 +197,13 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { } if (textarea) { - return [ -
-
-