about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-01-19 18:55:27 +0100
committerThibaut Girka <thib@sitedethib.com>2019-01-20 11:38:09 +0100
commit3e8b6239751673a0672b1a51c6c7f0a7d5e1eab8 (patch)
treec0f01a1bdda22016f659d17eefe90609afc8aab1 /app/javascript/flavours/glitch/components
parent5e0cf92fd145b27053389e5ffcce48da77439713 (diff)
[Glitch] Redesign public hashtag page to use a masonry layout
Port bc642ac24b49c14dca382e7aabbc16130293d2f4 to glitch flavour
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r--app/javascript/flavours/glitch/components/display_name.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/components/display_name.js b/app/javascript/flavours/glitch/components/display_name.js
index d6ac4907d..a26cff049 100644
--- a/app/javascript/flavours/glitch/components/display_name.js
+++ b/app/javascript/flavours/glitch/components/display_name.js
@@ -9,15 +9,23 @@ export default function DisplayName ({
   account,
   className,
   inline,
+  localDomain,
 }) {
   const computedClass = classNames('display-name', { inline }, className);
 
+  if (!account) return null;
+
+  let acct = account.get('acct');
+  if (acct.indexOf('@') === -1 && localDomain) {
+    acct = `${acct}@${localDomain}`;
+  }
+
   //  The result.
   return account ? (
     <span className={computedClass}>
       <bdi><strong className='display-name__html' dangerouslySetInnerHTML={{ __html: account.get('display_name_html') }} /></bdi>
       {inline ? ' ' : null}
-      <span className='display-name__account'>@{account.get('acct')}</span>
+      <span className='display-name__account'>@{acct}</span>
     </span>
   ) : null;
 }
@@ -27,4 +35,5 @@ DisplayName.propTypes = {
   account: ImmutablePropTypes.map,
   className: PropTypes.string,
   inline: PropTypes.bool,
+  localDomain: PropTypes.string,
 };