From 544b1e1d4585b5780b9d9166b4fc6167a4d16b31 Mon Sep 17 00:00:00 2001 From: apple502j <33279053+apple502j@users.noreply.github.com> Date: Fri, 3 Apr 2020 09:15:55 +0900 Subject: [PATCH] Split follow splash into FollowUser and FollowStudio --- .../splash/activity-rows/follow-studio.jsx | 43 +++++++++++++++ .../splash/activity-rows/follow-user.jsx | 42 ++++++++++++++ src/views/splash/activity-rows/follow.jsx | 55 ------------------- src/views/splash/l10n.json | 1 + src/views/splash/presentation.jsx | 7 ++- 5 files changed, 90 insertions(+), 58 deletions(-) create mode 100644 src/views/splash/activity-rows/follow-studio.jsx create mode 100644 src/views/splash/activity-rows/follow-user.jsx delete mode 100644 src/views/splash/activity-rows/follow.jsx diff --git a/src/views/splash/activity-rows/follow-studio.jsx b/src/views/splash/activity-rows/follow-studio.jsx new file mode 100644 index 000000000..7ac605f88 --- /dev/null +++ b/src/views/splash/activity-rows/follow-studio.jsx @@ -0,0 +1,43 @@ +const classNames = require('classnames'); +const FormattedMessage = require('react-intl').FormattedMessage; +const PropTypes = require('prop-types'); +const React = require('react'); + +const SocialMessage = require('../../../components/social-message/social-message.jsx'); + +const FollowStudioMessage = props => ( + + + {props.followerUsername} + + ), + studioLink: ( + + {props.followeeTitle} + + ) + }} + /> + +); + +FollowStudioMessage.propTypes = { + className: PropTypes.string, + followDateTime: PropTypes.string.isRequired, + followeeId: PropTypes.string.isRequired, + followeeTitle: PropTypes.string.isRequired, + followerUsername: PropTypes.string.isRequired +}; + +module.exports = FollowStudioMessage; diff --git a/src/views/splash/activity-rows/follow-user.jsx b/src/views/splash/activity-rows/follow-user.jsx new file mode 100644 index 000000000..3db5bfd60 --- /dev/null +++ b/src/views/splash/activity-rows/follow-user.jsx @@ -0,0 +1,42 @@ +const classNames = require('classnames'); +const FormattedMessage = require('react-intl').FormattedMessage; +const PropTypes = require('prop-types'); +const React = require('react'); + +const SocialMessage = require('../../../components/social-message/social-message.jsx'); + +const FollowUserMessage = props => ( + + + {props.followerUsername} + + ), + followeeLink: ( + + {props.followeeId} + + ) + }} + /> + +); + +FollowUserMessage.propTypes = { + className: PropTypes.string, + followDateTime: PropTypes.string.isRequired, + followeeId: PropTypes.string.isRequired, + followerUsername: PropTypes.string.isRequired +}; + +module.exports = FollowUserMessage; diff --git a/src/views/splash/activity-rows/follow.jsx b/src/views/splash/activity-rows/follow.jsx deleted file mode 100644 index bb1f13baa..000000000 --- a/src/views/splash/activity-rows/follow.jsx +++ /dev/null @@ -1,55 +0,0 @@ -const classNames = require('classnames'); -const FormattedMessage = require('react-intl').FormattedMessage; -const PropTypes = require('prop-types'); -const React = require('react'); - -const SocialMessage = require('../../../components/social-message/social-message.jsx'); - -const FollowMessage = props => { - let followeeLink = ''; - let followeeTitle = ''; - if (typeof props.followeeTitle === 'undefined') { - followeeLink = `/users/${props.followeeId}`; - followeeTitle = props.followeeId; - } else { - followeeLink = `/studios/${props.followeeId}`; - followeeTitle = props.followeeTitle; - } - - return ( - - - {props.followerUsername} - - ), - followeeLink: ( - - {followeeTitle} - - ) - }} - /> - - ); -}; - -FollowMessage.propTypes = { - className: PropTypes.string, - followDateTime: PropTypes.string.isRequired, - followeeId: PropTypes.string.isRequired, - followeeTitle: PropTypes.string, - followerUsername: PropTypes.string.isRequired -}; - -module.exports = FollowMessage; diff --git a/src/views/splash/l10n.json b/src/views/splash/l10n.json index 203bbe276..866b51663 100644 --- a/src/views/splash/l10n.json +++ b/src/views/splash/l10n.json @@ -14,6 +14,7 @@ "messages.becomeManagerText": "{username} was promoted to manager of {studio}", "messages.favoriteText": "{profileLink} favorited {projectLink}", "messages.followText": "{profileLink} is now following {followeeLink}", + "messages.followStudioText": "{profileLink} is now following {studioLink}", "messages.loveText": "{profileLink} loved {projectLink}", "messages.remixText": "{profileLink} remixed {remixedProjectLink} as {projectLink}", "messages.shareText": "{profileLink} shared the project {projectLink}", diff --git a/src/views/splash/presentation.jsx b/src/views/splash/presentation.jsx index 9a973e59b..0a8b54e5a 100644 --- a/src/views/splash/presentation.jsx +++ b/src/views/splash/presentation.jsx @@ -26,7 +26,8 @@ const Welcome = require('../../components/welcome/welcome.jsx'); const BecomeCuratorMessage = require('./activity-rows/become-curator.jsx'); const BecomeManagerMessage = require('./activity-rows/become-manager.jsx'); const FavoriteProjectMessage = require('./activity-rows/favorite-project.jsx'); -const FollowMessage = require('./activity-rows/follow.jsx'); +const FollowUserMessage = require('./activity-rows/follow-user.jsx'); +const FollowStudioMessage = require('./activity-rows/follow-studio.jsx'); const LoveProjectMessage = require('./activity-rows/love-project.jsx'); const RemixProjectMessage = require('./activity-rows/remix-project.jsx'); const ShareProjectMessage = require('./activity-rows/share-project.jsx'); @@ -53,7 +54,7 @@ class ActivityList extends React.Component { switch (message.type) { case 'followuser': return ( -