about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/composer
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-09-25 14:46:14 +0200
committerThibG <thib@sitedethib.com>2018-11-19 15:56:38 +0100
commitb3ff35a75cf04e4aba2712a9d0897257cf79af82 (patch)
tree51f5b0b0c61c6b58ad0f866179c900bc40c2a0e8 /app/javascript/flavours/glitch/features/composer
parenta77ee0bb6dcafffebc55db145ef4bac8038ae2a1 (diff)
Move URLs to backend in their own file
Diffstat (limited to 'app/javascript/flavours/glitch/features/composer')
-rw-r--r--app/javascript/flavours/glitch/features/composer/direct_warning/index.js4
-rw-r--r--app/javascript/flavours/glitch/features/composer/warning/index.js7
2 files changed, 9 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/composer/direct_warning/index.js b/app/javascript/flavours/glitch/features/composer/direct_warning/index.js
index d1febdd1b..3b1369acd 100644
--- a/app/javascript/flavours/glitch/features/composer/direct_warning/index.js
+++ b/app/javascript/flavours/glitch/features/composer/direct_warning/index.js
@@ -2,6 +2,7 @@ import React from 'react';
 import Motion from 'flavours/glitch/util/optional_motion';
 import spring from 'react-motion/lib/spring';
 import { defineMessages, FormattedMessage } from 'react-intl';
+import { termsLink} from 'flavours/glitch/util/backend_links';
 
 //  This is the spring used with our motion.
 const motionSpring = spring(1, { damping: 35, stiffness: 400 });
@@ -42,7 +43,8 @@ export default function ComposerDirectWarning () {
           }}
         >
           <span>
-            <FormattedMessage {...messages.disclaimer} /> <a href='/terms' target='_blank'><FormattedMessage {...messages.learn_more} /></a>
+            <FormattedMessage {...messages.disclaimer} />
+            { termsLink !== undefined && <a href={termsLink} target='_blank'><FormattedMessage {...messages.learn_more} /></a> }
           </span>
         </div>
       )}
diff --git a/app/javascript/flavours/glitch/features/composer/warning/index.js b/app/javascript/flavours/glitch/features/composer/warning/index.js
index c225b50e8..8be8acbce 100644
--- a/app/javascript/flavours/glitch/features/composer/warning/index.js
+++ b/app/javascript/flavours/glitch/features/composer/warning/index.js
@@ -2,6 +2,7 @@ import React from 'react';
 import Motion from 'flavours/glitch/util/optional_motion';
 import spring from 'react-motion/lib/spring';
 import { defineMessages, FormattedMessage } from 'react-intl';
+import { profileLink } from 'flavours/glitch/util/backend_links';
 
 //  This is the spring used with our motion.
 const motionSpring = spring(1, { damping: 35, stiffness: 400 });
@@ -20,6 +21,10 @@ const messages = defineMessages({
 
 //  The component.
 export default function ComposerWarning () {
+  let lockedLink = <FormattedMessage {...messages.locked} />;
+  if (profileLink !== undefined) {
+    lockedLink = <a href={profileLink}>{lockedLink}</a>;
+  }
   return (
     <Motion
       defaultStyle={{
@@ -43,7 +48,7 @@ export default function ComposerWarning () {
         >
           <FormattedMessage
             {...messages.disclaimer}
-            values={{ locked: <a href='/settings/profile'><FormattedMessage {...messages.locked} /></a> }}
+            values={{ locked: lockedLink }}
           />
         </div>
       )}