You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.4 KiB

  1. import React from 'react';
  2. import Motion from 'flavours/glitch/util/optional_motion';
  3. import spring from 'react-motion/lib/spring';
  4. import { defineMessages, FormattedMessage } from 'react-intl';
  5. // This is the spring used with our motion.
  6. const motionSpring = spring(1, { damping: 35, stiffness: 400 });
  7. // Messages.
  8. const messages = defineMessages({
  9. disclaimer: {
  10. defaultMessage: 'Your account is not {locked}. Anyone can follow you to view your follower-only posts.',
  11. id: 'compose_form.lock_disclaimer',
  12. },
  13. locked: {
  14. defaultMessage: 'locked',
  15. id: 'compose_form.lock_disclaimer.lock',
  16. },
  17. });
  18. // The component.
  19. export default function ComposerWarning () {
  20. return (
  21. <Motion
  22. defaultStyle={{
  23. opacity: 0,
  24. scaleX: 0.85,
  25. scaleY: 0.75,
  26. }}
  27. style={{
  28. opacity: motionSpring,
  29. scaleX: motionSpring,
  30. scaleY: motionSpring,
  31. }}
  32. >
  33. {({ opacity, scaleX, scaleY }) => (
  34. <div
  35. className='composer--warning'
  36. style={{
  37. opacity: opacity,
  38. transform: `scale(${scaleX}, ${scaleY})`,
  39. }}
  40. >
  41. <FormattedMessage
  42. {...messages.disclaimer}
  43. values={{ locked: <a href='/settings/profile'><FormattedMessage {...messages.locked} /></a> }}
  44. />
  45. </div>
  46. )}
  47. </Motion>
  48. );
  49. }
  50. ComposerWarning.propTypes = {};