From ad10a80a9925c247ef14837d3a14ff7e7375f001 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Fri, 5 Jan 2018 20:04:13 -0800 Subject: Styling and autosuggest fixes for #293 --- .../flavours/glitch/components/account.js | 20 ++++++++-- .../flavours/glitch/components/display_name.js | 44 +++++++++++----------- .../flavours/glitch/components/permalink.js | 8 +++- 3 files changed, 46 insertions(+), 26 deletions(-) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/components/account.js b/app/javascript/flavours/glitch/components/account.js index ced18b348..bb1979cc7 100644 --- a/app/javascript/flavours/glitch/components/account.js +++ b/app/javascript/flavours/glitch/components/account.js @@ -105,10 +105,22 @@ export default class Account extends ImmutablePureComponent { } return small ? ( -
-
- -
+ +
+ +
+ +
) : (
diff --git a/app/javascript/flavours/glitch/components/display_name.js b/app/javascript/flavours/glitch/components/display_name.js index ad1c3a534..4c65aaefa 100644 --- a/app/javascript/flavours/glitch/components/display_name.js +++ b/app/javascript/flavours/glitch/components/display_name.js @@ -1,28 +1,30 @@ +// Package imports. import classNames from 'classnames'; import PropTypes from 'prop-types'; import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; -export default class DisplayName extends React.PureComponent { - - static propTypes = { - account: ImmutablePropTypes.map.isRequired, - className: PropTypes.string, - }; - - render () { - const { - account, - className, - } = this.props; - const computedClass = classNames('display-name', className); - const displayNameHtml = { __html: account.get('display_name_html') }; - - return ( - - @{this.props.account.get('acct')} - - ); - } +// The component. +export default function DisplayName ({ + account, + className, + inline, +}) { + const computedClass = classNames('display-name', { inline }, className); + // The result. + return account ? ( + + + {inline ? ' ' : null} + @{account.get('acct')} + + ) : null; } + +// Props. +DisplayName.propTypes = { + account: ImmutablePropTypes.map, + className: PropTypes.string, + inline: PropTypes.bool, +}; diff --git a/app/javascript/flavours/glitch/components/permalink.js b/app/javascript/flavours/glitch/components/permalink.js index d726d37a2..d6556b584 100644 --- a/app/javascript/flavours/glitch/components/permalink.js +++ b/app/javascript/flavours/glitch/components/permalink.js @@ -22,7 +22,13 @@ export default class Permalink extends React.PureComponent { } render () { - const { href, children, className, ...other } = this.props; + const { + children, + className, + href, + to, + ...other + } = this.props; return ( -- cgit