投稿時間:2022-06-30 00:29:35 RSSフィード2022-06-30 00:00 分まとめ(31件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS AWS Compute Blog Introducing the new AWS Step Functions Workflows Collection https://aws.amazon.com/blogs/compute/introducing-the-new-aws-step-functions-workflows-collection/ Introducing the new AWS Step Functions Workflows CollectionToday the AWS Serverless Developer Advocate team introduces the Step Functions Workflows Collection a fresh experience that makes it easier to discover deploy and share Step Functions workflows Builders create Step Functions workflows to orchestrate multiple services into business critical applications with minimal code Customers were looking for opinionated templates that implement best practices for building … 2022-06-29 14:42:17
Google Official Google Blog Kickstart your monetization with the AdSense onboarding video series https://blog.google/products/adsense/kickstart-your-monetization-with-the-adsense-onboarding-video-series/ Kickstart your monetization with the AdSense onboarding video seriesWe re introducing the Google AdSense Onboarding video series to help publishers who are new to the program This five part video series will cover a range of topics from how to use the AdSense dashboard to creating ad units It s designed to bring new publishers like you one step closer to turning passion into a successful business model The short informative videos will help you to improve your earning potential by learning how to optimize your ads and sites All episodes are fully available to watch on our AdSense YouTube channel Here s what the series has in store You will follow Finn a publisher new to AdSense like you as he learns how to manage his account and how to optimize his ads and sites Through the episodes you ll build on your practical knowledge of the AdSense platform The videos will show you how to set up the right ads format and how to create a reporting structure that works for you and your business You will also find recommendations on how to grow your business and ways to optimize your ads by exploring new opportunities and conducting experiments on your AdSense dashboard Onboarding video series on YouTubeEpisode Your AdSense account set upIn this video you ll get to know your AdSense dashboard and navigate through the account You ll also learn more about the Ads Reports Payments and Policy Center sections of the dashboard Episode Managing your ads and sitesIn this video you ll learn about the two different ad types Auto ads and manually placed ad units You ll discover how to customize the ad types to suit your site how to control where the ads are placed and the different ad formats You ll also learn about the optimal number of ads to show on your pages and how to set up page exclusions to ensure ads only appear where you want Episode Use AdSense blocking controls to review your adsIn this video you ll discover how to protect your brand and prevent certain ads from appearing on your site The Ad review center offers several options to review and manage ads and ad categories in an easy and efficient way Episode Understanding your performance traffic and revenueThe only way to measure a site s growth over time is to track its performance In this video you ll learn how to use pre made and custom reports to measure account performance You ll discover the important metrics to monitor and which reports to use Episode Optimize your ads and boost your revenueThe final video in the series recaps the key optimization tips to improve your earning potential and help set you up for success The video focuses on four key tips using the Ad review center to manage ads setting up Auto ads to easily find new opportunities conducting experiments on AdSense and to see if your account is eligible for AdSense Labs to test new features 2022-06-29 15:00:00
js JavaScriptタグが付けられた新着投稿 - Qiita 自作のChrome拡張機能をManifest V3へ移行した際の修正内容まとめ https://qiita.com/ashcolor/items/ea9b6cc05041afb02760 stversionmanifestversion 2022-06-29 23:11:31
AWS AWSタグが付けられた新着投稿 - Qiita 【初心者】AWS Wavelengthを使ってみる #7 (Wavelength Zone間のSRT通信) https://qiita.com/mksamba/items/1bdf6c09d5c853b404e4 awswavelength 2022-06-29 23:57:02
Git Gitタグが付けられた新着投稿 - Qiita Microsoft Access をGITでソース管理している内容を共有します。他にもいい方法があれば取り入れたいです。 https://qiita.com/odataiki/items/1782236dd4e29521b474 access 2022-06-29 23:39:05
技術ブログ Developers.IO SupabaseのCLIでローカル環境を構築する(Local Development) https://dev.classmethod.jp/articles/supabase-graphql/ firebase 2022-06-29 14:10:28
海外TECH MakeUseOf 7 Mobile Apps for Men Looking to Lose Weight, Gain Muscle, and Stay Healthy https://www.makeuseof.com/mobile-apps-lose-weight-gain-muscle-stay-healthy/ Mobile Apps for Men Looking to Lose Weight Gain Muscle and Stay HealthyWhether you want to eat better burn fat or build muscle these fitness apps are designed to help men meet their fitness goals 2022-06-29 14:45:14
海外TECH MakeUseOf The Best Free Alexa Skills for Amazon Echo Owners https://www.makeuseof.com/tag/amazon-echo-essential-alexa-skills/ skills 2022-06-29 14:30:14
海外TECH MakeUseOf What Is Virtualization and What Is the Technology Used For? https://www.makeuseof.com/what-is-virtualization-and-what-is-it-for/ consumer 2022-06-29 14:30:13
海外TECH MakeUseOf 6 Ways to Fix the “Could Not Find This Item” Deletion Error in Windows https://www.makeuseof.com/windows-could-not-find-this-item-error/ windows 2022-06-29 14:15:14
海外TECH MakeUseOf How to Check Your Windows Experience Score on Windows 10 https://www.makeuseof.com/tag/check-windows-experience-score-windows-10/ windows 2022-06-29 14:05:14
海外TECH DEV Community Twitter Clone Part 3: Adding Tweet Reactions and Showing Notifications https://dev.to/dillionmegida/twitter-clone-part-3-adding-tweet-reactions-and-showing-notifications-3e1p Twitter Clone Part Adding Tweet Reactions and Showing NotificationsIn this article the third part of the Build a Twitter Clone series you will add support for tweet reactions likes and comments threads and a notifications page Part focuses on creating the Twitter layout authenticating users with Stream adding the create tweet feature and displaying the home page activity feeds Part focuses on creating a profile page for users and adding the follow users feature Please check out these parts if you haven t before continuing with this part Add Tweet ReactionsFrom the previous steps I have walked you through building the Twitter layout and the TweetBlock component This component shows four actions comment retweet like and share For the scope of this tutorial we will only focus on the comment and like actions which are currently not functional So let s make them functional Add a Like ReactionYou will create a custom hook for the like reaction functionality to easily manage it In Part we concluded with src components Tweet TweetBlock js having an onToggleLike function in the TweetBlock component which currently does nothing const onToggleLike gt toggle like reaction To make this function work firstly let s create the hook Create a new file src hooks useLike js with the following code import useFeedContext from react activity feed export default function useLike const feed useFeedContext const toggleLike async activity hasLikedTweet gt await feed onToggleReaction like activity return toggleLike Thefeed object from the useFeedContext hook has different methods that can be applied to the activities in the feed the TweetBlock is used This feed can be the timeline feed for the homepage or the user feed for the profile page The toggleLike function from the hook receives two arguments the activity to be liked unliked and a hasLikedTweet boolean which is true if the logged in user has liked the tweet already You will use the hasLikedTweet argument later when you add notifications The onToggleReaction method on the feed object takes a type of reaction in this case like and the activity it should be applied to the current activity the TweetBlock component is used for and it toggles between liking and unliking for a logged in user To add the like reaction functionality import this hook to the TweetBlock component other importsimport useLike from hooks useLike Then update the onToggleLike function to this const onToggleLike async gt await toggleLike activity hasLikedTweet To test this go to a tweet in your application either made by the logged in user or a different user and click on the heart icon You should have this when you click The toggle happens when you click it again In Part we applied styles for the heart icon to be red when clicked just in case you re wondering You can also test this by logging in with a different user and liking the same tweet You will see the like count incremented Add a Comment ReactionThe current state of the comment functionality is that when a user clicks the comment icon on a tweet block the comment dialog shows and the user can type a comment but on submitting nothing happens In previous parts we concluded with src components Tweet TweetBlock js having the CommentDialog component attached to an onPostComment function that does nothing const onPostComment async text gt create comment To add the comment reaction we will make this a custom hook This functionality will be used in the TweetBlock component and the Thread component for when a tweet is expanded to show comments Create a new file src hooks useComment js with the following code import useFeedContext from react activity feed export default function useComment const feed useFeedContext const createComment async text activity gt await feed onAddReaction comment activity text return createComment With the onAddReaction method of the feed object you can add the comment reaction to an activity and pass the comment text To use this hook in src components Tweet TweetBlock js first import it other importsimport useComment from hooks useComment Then get the createComment function in the TweetBlock component const createComment useComment And finally update the onPostComment function to this const onPostComment async text gt await createComment text activity With this addition when you enter a comment you will see the comment reactions incremented So far we have added the like and comment reactions but we haven t added threads yet A thread view will show a tweet expanded showing the comments in a tweet So let s add that next Add a Tweet Thread pageThe thread page shows a single tweet the tweet action buttons a comment form and the comments made on the tweet This thread view is broken into sections so we ll build it section by section Create the ThreadHeader ComponentThe ThreadHeader component shows the back button and the tweet text Create a new file src components Thread ThreadHeader js and paste the following import useNavigate from react router dom import styled from styled components import ArrowLeft from Icons ArrowLeft const Header styled header display flex align items center padding px button width px height px margin right px span font size px color white font weight bold export default function ThreadHeader const navigate useNavigate const navigateBack gt navigate return lt Header gt lt button onClick navigateBack gt lt ArrowLeft size color white gt lt button gt lt span gt Tweet lt span gt lt Header gt Using useNavigate from react router dom you can navigate the user to the previous page they were on in the history session Create the TweetContent ComponentThis component shows the tweet information the tweet action buttons a tweet form to add a comment and tweet blocks for comments The tweet blocks in this component are a little different from the normal tweet blocks we created in Part As you will notice this block does not have reactions To avoid so much conditional rendering going on in the TweetBlock component you will create another tweet block component TweetCommentBlock Create a TweetCommentBlock ComponentCreate a new file src components Thread TweetCommentBlock js Start with imports and styles import styled from styled components import formatStringWithLink from utils string import More from Icons More import TweetActorName from Tweet TweetActorName const Block styled div display flex border bottom px solid padding px user image width px height px border radius overflow hidden margin right px img width height object fit cover comment tweet flex link display block padding bottom px text decoration none amp text color white font size px line height px margin top px amp link color var theme color text decoration none more width px height px display flex opacity And for the component export default function TweetCommentBlock comment const user data tweetComment comment return lt Block to gt lt div className user image gt lt img src user data image alt gt lt div gt lt div className comment tweet gt lt div gt lt TweetActorName name user data name id user id time comment created at gt lt div className tweet details gt lt p className comment tweet text dangerouslySetInnerHTML html formatStringWithLink tweetComment text tweet text link replace n g lt br gt gt lt div gt lt div gt lt div gt lt button className more gt lt More size color white gt lt button gt lt Block gt The TweetCommentBlock receives the comment prop a comment activity object From the comment object you can get the user and the data object which you have assigned to the tweetComment variable Composing the TweetContent ComponentCreate a new file src components Thread TweetContent js Add the imports for the component import format from date fns import useFeedContext useStreamContext from react activity feed import Link from react router dom import styled from styled components import useState from react import formatStringWithLink from utils string import BarChart from Icons BarChart import Comment from Icons Comment import Retweet from Icons Retweet import Heart from Icons Heart import Upload from Icons Upload import TweetForm from Tweet TweetForm import TweetCommentBlock from TweetCommentBlock import CommentDialog from Tweet CommentDialog import More from Icons More import useComment from hooks useComment import useLike from hooks useLike There are many icons here for the actions for the tweet Also you will use the useComment hook here for the comment form Next the styles const Container styled div padding px px user display flex text decoration none amp image width px height px border radius overflow hidden margin right px img width height amp name amp name color white font weight bold amp id color b font size px amp option margin left auto tweet margin top px a text decoration none color var theme color amp text color white font size px amp time amp analytics amp reactions amp reactors height px display flex align items center border bottom px solid font size px color amp time amp date margin left px position relative amp after position absolute content width px height px background color border radius top bottom left px margin auto amp analytics amp text margin left px amp reactions amp likes display flex reaction count color white font weight bold reaction label margin left px amp reactors justify content space between padding px write reply align items center padding px border bottom px solid Next the component export default function TweetContent activity const feed useFeedContext const client useStreamContext const createComment useComment const toggleLike useLike const time format new Date activity time p const date format new Date activity time PP const tweet activity object data const tweetActor activity actor data const commentDialogOpened setCommentDialogOpened useState false let hasLikedTweet false if activity own reactions like const myReaction activity own reactions like find l gt l user id client userId hasLikedTweet Boolean myReaction const onToggleLike async gt await toggleLike activity hasLikedTweet feed refresh const reactors id comment Icon Comment onClick gt setCommentDialogOpened true id retweet Icon Retweet id heart Icon Heart onClick onToggleLike id upload Icon Upload const onPostComment async text gt await createComment text activity feed refresh Just like I showed you in Part the hasLikedTweet variable is initialized and updated to hold a boolean value if the logged in user has liked this tweet or not Similar to the like reaction functionality you created earlier the onToggleLike function here uses the onToggleReaction method on the feed object Also the refresh method on the feed object is used to refresh the feed This part is relevant because unlike the FlatFeed component which automatically refreshes upon reactions the Feed component which you will soon use does not Also the onPostComment function uses the createComment function from the useComment hook and refreshes the feed after a successful comment Next the UI export default function TweetContent return lt gt commentDialogOpened amp amp lt CommentDialog activity activity onPostComment onPostComment onClickOutside gt setCommentDialogOpened false gt lt Container gt lt Link to tweetActor id className user gt lt div className user image gt lt img src tweetActor image alt gt lt div gt lt div className user name gt lt span className user name name gt tweetActor name lt span gt lt span className user name id gt tweetActor id lt span gt lt div gt lt div className user option gt lt More color size gt lt div gt lt Link gt lt div className tweet gt lt p className tweet text dangerouslySetInnerHTML html formatStringWithLink tweet text tweet text link replace n g lt br gt gt lt div className tweet time gt lt span className tweet time time gt time lt span gt lt span className tweet time date gt date lt span gt lt div gt lt div className tweet analytics gt lt BarChart color gt lt span className tweet analytics text gt View Tweet Analytics lt span gt lt div gt lt div className tweet reactions gt lt div className tweet reactions likes gt lt span className reaction count gt activity reaction counts like lt span gt lt span className reaction label gt Likes lt span gt lt div gt lt div gt lt div className tweet reactors gt reactors map action i gt lt button onClick action onClick key reactor i gt lt action Icon color action id heart amp amp hasLikedTweet var theme color fill action id heart amp amp hasLikedTweet amp amp true size gt lt button gt lt div gt lt div gt lt div className write reply gt lt TweetForm onSubmit onPostComment submitText Reply collapsedOnMount true placeholder Tweet your reply replyingTo tweetActor id gt lt div gt activity latest reactions comment map comment gt lt TweetCommentBlock key comment id comment comment gt lt Container gt lt gt There are two ways to make comments in the UI First there s the comment form where users can type a comment and submit The second way is by clicking the comment icon which opens the CommentDialog component for typing a comment On the activity object you loop through the latest reactions comment array to display the comments with the TweetCommentBlock component Create the ThreadContent ComponentThis component is made up of the ThreadHeader and TweetContent components Create a new file called src components Thread ThreadContent js Start with the imports import useEffect useState from react import useFeedContext useStreamContext from react activity feed import useParams from react router dom import LoadingIndicator from LoadingIndicator import TweetContent from TweetContent import ThreadHeader from ThreadHeader With useParams you will get the id of the tweet from the URL Tweet links exist in this format actorId status tweetActivityId Next the component export default function ThreadContent const client useStreamContext const id useParams const feed useFeedContext const activity setActivity useState null useEffect gt if feed refreshing feed hasDoneRequest return const activityPaths feed feedManager getActivityPaths id if activityPaths length const targetActivity feed feedManager state activities getIn activityPaths toJS setActivity targetActivity feed refreshing if client activity return lt LoadingIndicator gt return lt div gt lt ThreadHeader gt lt TweetContent activity activity gt lt div gt feedManager getActivityPaths of the feed object returns an array with an id for the current tweet link This line is essential to ensure that the activity exists If it returns an empty array then the tweet link does not exist feed feedManager state activities is an immutable Map created with Immutabe js so you get the activity object using getIn and toJS methods With the activity obtained you pass it to the TweetContent component Create the Thread PageCreate a new file called src pages Thread js and paste the following import Feed useStreamContext from react activity feed import useParams from react router dom import Layout from components Layout import ThreadContent from components Thread ThreadContent const FEED ENRICH OPTIONS withRecentReactions true withOwnReactions true withReactionCounts true withOwnChildren true export default function Thread const user useStreamContext const user id useParams return lt Layout gt lt Feed feedGroup user id user id user timeline options FEED ENRICH OPTIONS notify gt lt ThreadContent gt lt Feed gt lt Layout gt For the feedGroup you check if the currently logged in user made the tweet of which you use user and if it s a different user you use timeline This is because a tweet exists in one of these feeds not on both The FEED ENRICH OPTIONS is relevant so you can get the reactions with each activity Without this you will have to make a separate API request to get the comments in the TweetContent component Lastly you need to create a route for this component Go to src components App js Import the thread page other importsimport Thread from pages Thread And add a route for this component lt Route element lt Thread gt path user id status id gt With all these plugged in correctly when you click a tweet block you will find the thread view This view also shows the comment reactions made to a tweet You can make more comments using the comment dialog or the comment form Add the Notifications PageThe notifications page will show new follows likes and comment notifications The idea with the notifications implementation is to create activities in the notification feed created in Part when creating feed groups when actions occur This implies that when you trigger a like action you create an activity in the notification feed with the like verb and a reference to the tweet you liked Similarly you ll do the same for comments and follow actions Before creating a Notifications page let s start by creating these activities upon these actions we want notifications for Create a useNotification hookSince notifications will be used for different things making the functionality a hook would be easier to manage Create a new file src hooks useNotification js with the following code import useStreamContext from react activity feed export default function useNotification const client useStreamContext const createNotification async userId verb data reference gt const userNotificationFeed client feed notification userId const newActivity verb object reference data await userNotificationFeed addActivity newActivity return createNotification The returned createNotification function from the hook receives four arguments userId id of the user you want to add the notification forverb the label for the activitydata for other properties to add to the activity for example the text of a commentreference this is optional but it can be used for referencing a collection like a tweet for example Create Notifications on Reactions and FollowsIn this section you will use this hook on reactions and follow actions Create Notifications on Like ReactionsGo to src hooks useLike js to add the hook First import the hook other importsimport useNotification from useNotification import useStreamContext from react activity feed You will need the user object from the useStreamContext hook as you will see soon Import the createNotification function and the user object const createNotification useNotification const user useStreamContext Then update the toggleLike function to create a notification on liking a tweet const toggleLike async activity hasLikedTweet gt const actor activity actor await feed onToggleReaction like activity if hasLikedTweet amp amp actor id user id then it is not the logged in user liking their own tweet createNotification actor id like SO tweet activity object id The toggleLike function first checks if the tweet has not been liked and the actor of the tweet is not the same as the logged in user This check is necessary to ensure that the user does not get a notification upon liking their tweet In the last argument the reference passed to the createNotification function refers to the tweet collection When you like a tweet a new activity is added to the notification feed You can try this by going to a different user s account and liking one of getstream io s tweets On the Feeds Explorer on your dashboard you will see the notification getstream io created And when you browse the activities in this feed you will find the new like activity you created Because you created a notification feed group in Part you can see the is read and is seen property Also the activities are grouped if they are similar Create Notifications on Comment ReactionsSimilar to what you did in the previous step go to src hooks useComment js and import the required hooks import useStreamContext from react activity feed import useNotification from useNotification Next get the createNotification function and user object in the useComment hook const createNotification useNotification const user useStreamContext And finally update the createComment function const createComment async text activity gt const actor activity actor await feed onAddReaction comment activity text if actor id user id then it is not the logged in user commenting on their own tweet createNotification actor id comment text SO tweet activity object id The createComment function also ensures that there are no notifications sent if the same actor of tweet comments on the tweet You can test this notification by commenting on a tweet and checking your Feed s explorer Create Notifications on Follow ActionsOne more notification you want to add is for follow actions In the useFollow hook in src hooks useFollow js import the notification hook other importsimport useNotification from useNotification Then update the toggleFollow function to this const createNotification useNotification const toggleFollow async gt const action isFollowing unfollow follow if action follow await createNotification userId follow const timelineFeed client feed timeline client userId await timelineFeed action user userId setIsFollowing isFollowing gt isFollowing In this function you check if the action is follow and create a follow activity in the notification feed You can also test this by following a user and checking your Feeds dashboard With these notifications created now you want to display them Create a NotificationContent ComponentThis component houses the notification header and the notifications for different actions To display the different activities in the notifications feed you will use the NotificationFeed This component displays the notifications in groups But you will provide a custom component to handle this grouping Creating Grouping Components for NotificationsThere are three forms of notifications like comment and follow notifications The structure of the group is like this activities activities created on like action activity count NUMBER OF ACTIVITIES actor count NUMBER OF ACTORS IN THE ACTIVITIES created at group GROUP ID BASED ON VERB AND DATE id is read is seen verb VERB OF GROUPED ACTIVITIES Let s create grouping components for them Create a LikeNotification Group ComponentCreate a new file src components Notification LikeNotification js Add the imports and styles import useStreamContext from react activity feed import Link useNavigate from react router dom import styled from styled components import Heart from Icons Heart const Block styled button padding px border bottom px solid display flex a color white span display inline block right margin left px flex liked actors images display flex amp image width px height px border radius overflow hidden margin right px img width height object fit cover liked actors text margin top px color white font size px liked actor name font weight bold amp hover text decoration underline tweet text display block color margin top px With the useNavigate hook you will navigate to the tweet that was liked when a user clicks on the notification Next for the component export default function LikeNotification likedActivities const likedGroup const navigate useNavigate const user useStreamContext likedActivities forEach act gt if act object id in likedGroup likedGroup act object id push act else likedGroup act object id act This component receives the activities array from the like group You create a likedGroup object that groups activities by the tweet they were made on The grouping from the notification feeds contains different like activities on tweets The next step is to loop over the likedGroup to display the like notifications export default function LikeNotification likedActivities return lt gt Object keys likedGroup map groupKey gt const activities likedGroup groupKey const lastActivity activities const tweetLink user id status lastActivity object id return lt Block className active onClick gt navigate tweetLink key groupKey gt lt Heart color var theme color size fill true gt lt div className right gt lt div className liked actors images gt activities map act gt lt Link to act actor id key act id className liked actors images image gt lt img src act actor data image alt gt lt Link gt lt div gt lt span className liked actors text gt lt Link className liked actor name to lastActivity actor id gt lastActivity actor data name lt Link gt lt span to tweetLink gt activities length gt amp amp and activities length others liked your Tweet lt span gt lt span gt lt p className tweet text gt lastActivity object data text lt p gt lt div gt lt Block gt lt gt You loop over each tweet in the likedGroup and also loop over the like activities in the tweet to display the author s information Create a CommentNotification Group ComponentCreate a new file src components Notification CommentNotification js Add the imports and styles import Link useNavigate from react router dom import useStreamContext from react activity feed import styled from styled components import generateTweetLink from utils links import TweetActorName from Tweet TweetActorName const Block styled button padding px border bottom px solid display flex a color white user image width px height px overflow hidden border radius img width height object fit cover user details margin left px flex user reply to color font size px margin top px a color var theme color amp hover text decoration underline user text display block color white margin top px Next the component export default function CommentNotification commentActivities const navigate useNavigate const user useStreamContext return lt gt commentActivities map cAct gt const actor cAct actor const tweetLink generateTweetLink cAct replyTo cAct object id return lt Block key cAct id onClick gt navigate tweetLink gt lt Link to actor id className user image gt lt img src actor data image alt gt lt Link gt lt div className user details gt lt TweetActorName id actor id name actor data name time cAct time gt lt span className user reply to gt Replying to lt Link to user id gt user id lt Link gt lt p className user text gt cAct text lt p gt lt span gt lt div gt lt Block gt lt gt This component receives the commentActivities prop which is the activities array from the comment group In this component you loop through the comments and display the user information and the comment text Create a FollowNotification Group ComponentCreate a new file src components Notification FollowNotification js Add the imports and styles import Link from react router dom import styled from styled components import User from Icons User const Block styled div padding px border bottom px solid display flex a color white right margin left px flex actors images display flex amp image width px height px border radius overflow hidden margin right px img width height object fit cover actors text margin top px color white font size px span display inline block actors name font weight bold amp hover text decoration underline Next the component export default function FollowNotification followActivities const firstActivity followActivities return lt Block gt lt User color cbef size gt lt div className right gt lt div className actors images gt followActivities map follow gt return lt Link to follow actor id className actors images image key follow id gt lt img src follow actor data image alt gt lt Link gt lt div gt lt p className actors text gt lt Link className actors name to firstActivity actor id gt firstActivity actor data name lt Link gt lt span gt followActivities length gt amp amp and followActivities length others followed you lt span gt lt p gt lt div gt lt Block gt This component receives the followActivities prop which is the activities array of the follow group In this component you get the first activity from the array so that you can display Person A and others followed you With these group components created you can put them together to form a NotificationGroup component Create a NotificationGroup ComponentCreate a new file src components Notification NotificationGroup js file Add imports and styles import useEffect useRef from react import useFeedContext useStreamContext from react activity feed import styled from styled components import CommentNotification from CommentNotification import FollowNotification from FollowNotification import LikeNotification from LikeNotification const Container styled div button width Next the component export default function NotificationGroup activityGroup const feed useFeedContext const notificationContainerRef useRef const activities activityGroup activities const user client useStreamContext useEffect gt stop event propagation on links if notificationContainerRef current return const anchorTags notificationContainerRef current querySelectorAll a anchorTags forEach element gt element addEventListener click e gt e stopPropagation return gt anchorTags forEach element gt element addEventListener click e gt e stopPropagation useEffect gt const notifFeed client feed notification user id notifFeed subscribe data gt if data new length feed refresh return gt notifFeed unsubscribe In the first useEffect expression you stop event propagation on all links in the container ref The relevance of this is that when you click on a user s name in a like notification block you don t want the notification block to also navigate to the tweet that was liked In the second useEffect expression you subscribe to the notification feed of the logged in user On new notifications you call the refresh method on the feed object so that the new notifications are displayed Finally for this component the UI export default function NotificationGroup return lt Container ref notificationContainerRef gt activityGroup verb like amp amp lt LikeNotification likedActivities activities gt activityGroup verb follow amp amp lt FollowNotification followActivities activities gt activityGroup verb comment amp amp lt CommentNotification commentActivities activities gt lt Container gt In the UI you check the verb of the group and render the group notification accordingly Composing the NotificationContent ComponentCreate a new file src components Notification NotificationContent js Add the imports and styles import classNames from classnames import useState from react import NotificationFeed from react activity feed import styled from styled components import NotificationGroup from NotificationGroup const Container styled div h padding px font size px color white tab list margin top px border bottom px solid display grid grid template columns fr fr tab color padding px width display flex align items center justify content center font weight bold font size px amp hover background color amp label position relative padding px px amp active color white amp after content height px width background color var theme color border radius px position absolute bottom left Next the component const tabList id all label All id mentions label Mentions export default function NotificationContent const activeTab setActiveTab useState tabList id return lt Container gt lt h gt Notifications lt h gt lt div className tab list gt tabList map tab gt lt button onClick gt setActiveTab tab id className tab key tab id gt lt span className classNames tab label activeTab tab id amp amp active gt tab label lt span gt lt button gt lt div gt lt NotificationFeed Group NotificationGroup gt lt Container gt Although the tab list is not functional it s nice to have In this component you use the NotificationFeed and pass the NotificationGroup component to the Group prop Creating the Notifications PageCreate a new file src pages Notifications js with the following code import Layout from components Layout import NotificationContent from components Notification NotificationContent export default function Notifications return lt Layout gt lt NotificationContent gt lt Layout gt And also add a route in App js for this page other importsimport Notifications from pages Notifications lt Route element lt Notifications gt path notifications gt Show a Notification CounterWhen a user has unread notifications you will show the count of those notifications in a badge on the Notifications link This notification link exists in the LeftSide component Go to src components LeftSide js and import useEffect other importsimport useEffect from react When this component mounts you will query the notification feed of the logged in user get the notifications that haven t been seen the is seen property will be false and display the count In the LeftSide component add the following export default function LeftSide onClickTweet other things const client userData useStreamContext useEffect gt if userData location pathname notifications return let notifFeed async function init notifFeed client feed notification userData id const notifications await notifFeed get const unread notifications results filter notification gt notification is seen setNewNotifications unread length notifFeed subscribe data gt setNewNotifications newNotifications data new length init return gt notifFeed unsubscribe userData other things When the component mounts you create an init function and evoke it In this function you get all the activities in the notification feed then you filter out the notifications that have been seen to find the unread ones Next you update the newNotifications state with the length of the unread array Also you subscribe to the notification feed so that when a new activity is added to the notification feed you update the newNotifications state Remember earlier you triggered some notifications on getstream io s account by liking commenting on their tweet and following them Now when you log into getstream io s account and click the notifications link on the left sidebar you will see the notification activities made on their feed like this And there you have it your Twitter clone ConclusionThere are more features that can be added to this clone project but we have focused on some functionalities that allow you to understand activity feeds and how Stream feeds provides solutions for feed based applications Find the complete source code of the clone in this repository Please give the react activity feed repository a star if you enjoyed this tutorial As a recap in Part we built most of the layout and shared components and also added the create tweet featurein Part we added a profile page for users and also created the follow user functionalityin this part we added support for like and comment reactions and created notifications for each action Overall in this Twitter clone you should now understand the concept of activity feeds tweets or notification activities subscribing to a feed following a user There are many more ways you apply feeds You can use them in forums where a user can subscribe to a topic or discussion e commerce platforms where users can follow a product feed and get updated when new related products are added and social media platforms We have other feeds SDKs to allow you to integrate feeds in different languages and platforms Do check it out 2022-06-29 14:41:55
海外TECH DEV Community Phone Authentication with Appwrite and Twilio https://dev.to/appwrite/phone-authentication-with-appwrite-and-twilio-26ek Phone Authentication with Appwrite and TwilioAppwrite was just announced and brings with it one of the most anticipated Appwrite features Yes you guessed that right We re introducing phone authentication in Appwrite With this release you ll now be able to authenticate users using their phone numbers This release also introduces new phone providers including Twilio TextMagic amp TeleSign In this tutorial we ll learn how to set up a Twilio account and configure it for use with Appwrite and build a Svelte app to put it all together The app will demonstrate the usage of all the new phone authentication endpoints introduced in Appwrite Here s what we will learn To create sessions using a phone number and verify them To update a user s phone number send verification codes and update the verification status Without further ado let s get started New to Appwrite Appwrite is an open source back end as a service that abstracts all the complexity of building a modern application by providing you with a set of REST and Realtime APIs for your core back end needs Appwrite takes the heavy lifting for developers and handles user authentication and authorization databases file storage cloud functions webhooks and much more ‍Setting up TwilioThe first step is to create a Twilio account Head over to the Sign Up page fill in your details verify your email and phone number On the Twilio Dashboard click on the Get a Twilio phone number button This generates a phone number that we can use to send messages from Under the Account Info section you ll find the Account SID Auth Token and the newly generated phone number Keep these handy as you ll need them in the next step There s one last thing that we need to do in the Dashboard before we move to the next step Since we re using Twilio s free trial we can only send an SMS to verified phone numbers Head over to the Verified Callers IDs page and enter the numbers that you d like to send messages to ️Install AppwriteNext we need to get an Appwrite server up and running You can either choose to install it locally on your system or deploy it on the cloud with one of our one click setups TLDR It only takes a single magic command docker run it rm volume var run docker sock var run docker sock volume pwd appwrite usr src code appwrite rw entrypoint install appwrite appwrite This command installs Appwrite and creates an appwrite folder with docker compose yml and env files Once the installation is complete head over to the appwrite folder We need to update two variables in the env file namely APP PHONE PROVIDER and APP PHONE FROM APP PHONE FROM is the phone number you just obtained from Twilio and APP PHONE PROVIDER is a DSN string that helps Appwrite connect to the Twilio API APP PHONE PROVIDER takes the following format APP PHONE PROVIDER phone lt Account SID gt lt Auth Token gt twilio APP PHONE FROM takes the following format APP PHONE FROM You can obtain the Account SID Auth Token and the phone number from the Account Info section of the Twilio Dashboard Once that is done we need to restart the Appwrite server for the environment variables to take effect Please note that this command needs to be executed from the appwrite folder that was created during installation docker compose up d force recreateNext head over to localhost or your public IP address and create a new user account followed by a project with a name of your choosing Copy the projectId and the endpoint from the Settings page as we ll need it for the web app we build in the next step Setting up Our SvelteKit ProjectFor the sake of this example we ll be using SvelteKit but the concepts and code examples remain true for all frameworks out there First we ll need to create a new SvelteKit project and set up Tailwind CSS I ve found the official Tailwind installation guide to be extremely helpful here Instead of re inventing the wheel here I d recommend you to complete the setup and return back to this tutorial Alright It s time to install some of our dependencies We ll be using two dependencies for our project Head over to the project folder and install them with the following commandsnpm i D zerodevx svelte toastnpm i appwriteNext add the following entries into your env file You might need to create this file if it does not exist already VITE APPWRITE ENDPOINT http localhost vVITE APPWRITE PROJECT ID lt YOUR PROJECT ID Don t forget to replace the values with your own Appwrite projectId and endpoint that you obtained from the Dashboard earlier Setting up the Appwrite SDKNext let s create our Appwrite service that will help abstract all the SDK calls to a single place Create a new file src lib appwrite ts and fill in the following contentsimport Client Account from appwrite const client new Client client setEndpoint import meta env VITE APPWRITE ENDPOINT setProject import meta env VITE APPWRITE PROJECT ID const account new Account client export class AppwriteService public static async getAccount Promise lt any gt return account get public static async createAccount email string password string name string Promise lt any gt return account create unique email password name public static async createEmailSession email string password string Promise lt any gt return account createEmailSession email password public static async deleteSession Promise lt any gt return account deleteSession current Phone Authentication endpoints public static async createPhoneSession number string Promise lt any gt return account createPhoneSession unique number public static async updatePhoneSession userId string secret string Promise lt any gt return account updatePhoneSession userId secret public static async updatePhone number string password string Promise lt any gt return account updatePhone number password public static async createPhoneVerification Promise lt any gt return account createPhoneVerification public static async updatePhoneVerification userId string secret string Promise lt any gt return account updatePhoneVerification userId secret Here we import the appwrite SDK and initialize the Client and Account services We also export an AppwriteService class with a lot of static methods that we can use across our app The appwrite ts file is all it takes to integrate Appwrite into the project All the other files deal with the UI of the project and should be fairly straightforward to read and understand In order to keep this tutorial concise we ll just copy over the contents for all the other files from the completed GitHub project Here are a list of files we need to copyToast ts This file contains the theming configuration for our toast messages layout svelte This file defines the base layout for all our screensindex svelte UI for the user profile pagelogin svelte UI for the login with email pageloginPhone svelte UI for the login with phone pagesignup svelte UI for the signup pageOnce complete we re all ready to preview the project Run the following command to run a local development server npm run devThat brings us to the end of this tutorial I hope this guide helped you set up phone authentication in your web app and above all I hope you enjoyed learning something new I had a lot of fun learning Svelte and building a web app for this tutorial and I can t wait to build some more apps ResourcesIf you re stuck at any point during the tutorial feel free to reach out for help in our friendly discord channels run by humans If you like what we do at Appwrite don t forget to drop us a tiny star on GitHub Here are some great resources to help you get started Appwrite Resource ShowcaseSvelte Documentation Appwrite DocumentationAppwrite s GitHub 2022-06-29 14:28:58
海外TECH DEV Community Getting Started With Angular #2 https://dev.to/angular/getting-started-with-angular-2-56dm Getting Started With Angular Hi everyone welcome to the second blog of the beginner series Thank you for the amazing response to the first blog We talked about Components in our last blog today we will be covering basics on Data Binding What Is Data Binding Data Binding is the flow of data between Component Class and Component Template Data binding is used to specify things such as the source of an image the state of a button or data for a particular user There are three categories of data binding that depends on the direction of data flow From source to viewFrom view to sourceIn a two way sequence of view to source to view Data Binding TypesData Binding can be done in three ways Interpolation It is one way binding from data source to view target It goes by the syntax expressionname Using interpolation data is passed from the component class to thetemplate Property binding Angular Property Binding is used to set the property of HTML Elements with the properties of the component class It goes by the syntax propertyname Event binding Event binding helps in capturing events such as keystrokes mouse movements clicks and touches and then provide a response to it It goes by the syntax eventname What Is Two way Binding Two way binding helps in listening to events and update values simultaneously between parent and child components In Angular two way binding can be achieved by combining Property Binding and Event Binding It goes by the syntax derived from the of Property Binding and of Event Binding Two way binding in Angular can be done using ngModel Example of using ngModel for two way binding export class AppComponent eg Hello lt input type text ngModel eg gt lt h gt name lt h gt Ending NotesThat is all about Data Binding thank you for reading till the end Most of my learning credit goes to Angular docsBooks by Dhananjay Kumar and Christoffer NoringWhat do you want me to cover in the next article Let me know in the comments below or drop a DM to HaimantikaM 2022-06-29 14:28:45
海外TECH DEV Community 5 reasons to start staging your code right now https://dev.to/ionos/5-reasons-to-start-staging-your-code-right-now-hkf reasons to start staging your code right nowIn software development staging is the process of testing your code in a live environment before pushing it to production A staging environment is pretty much a replica of a production environment so you can see exactly what users will experience once you release the code Development teams often work with multiple instances within three types of environments Local environment every developer has one Here code is committed to various branches of development streams and previewed locally Staging environment runs code in a live environment for testing purposes Developers might stage release candidates as they approach rollout or much earlier in the development phase to verify git pushes Stages can be connected directly to the main branch or to feature branches which are not yet merged into master Production environment runs the live version of a project Why development teams often skip the stageAs an exact replica of your production environment a staging environment can easily require the same effort that goes into maintaining the production environment And that additional effort can grow exponentially if multiple release candidates are all in staging at the same time What s more staging adds yet another step to a developer s daily Which is something they re not exactly keen on unless it s absolutely necessary Why stage if my project looks fine on localhost right But we shouldn t be too hasty Staging has a lot of benefits And with the right tools at hand staging requires no extra cost or effort at all The benefits of staging Your designers are happierWorking with a designer on a project with frontend Give them a chance to check whether the look and feel of the latest release meets their expectations Speaking from experience unpleasant surprises can put a dampener on the team spirit Clients know what s comingMisunderstandings during concept creation are common Even if a deployment goes exactly as planned your client might have had something different in mind Send them a preview link to align expectations before going live No more awkward “it looked different on my machine momentsWho hasn t been there An issue flares up with a live project but the person responsible claims they didn t have this issue on their local machine These scenarios are completely avoidable if you rigorously test for multiple scenarios during the staging phase Responsibility is sharedSure you can ask teammates to review your pull request That way you weren t the only person who saw the code before release But PRs don t replace fully fledged stages With stages you can delegate essential quality checks to QA or test engineers Everyone stays in the loopThere s no crystal ball showing project managers how far you are with the code on your local machine Using staging environments to let them see the progress from time to time will make them happy and probably save you from replying to anxious emails Changing the staging gameDeploy Now is a build tool created by developers for developers for building and hosting static site generators PHP apps and single page applications on custom engineered IONOS infrastructure Create a feature branch locally push it to staging view your code live merge to production and automatically shut down the staging environment That s how easy staging with Deploy Now is Every Deploy Now package offers staging branches as SSL secured preview URLs Share these URLs with clients and team members or use them to check your code on different devices and browsers With no extra cost and effort required for managing additional infrastructure should you still skip the stage Absolutely not If you work with multiple branches already your daily workflow won t even change Your code is built and deployed automatically so it s super quick and simple to run your code in a live environment early and often What about you Why do you think every dev team should use staging environments 2022-06-29 14:25:44
Apple AppleInsider - Frontpage News Apple's loaded 16-inch MacBook Pro with M1 Max, 64GB RAM is $300 off, back in stock https://appleinsider.com/articles/22/06/29/apples-loaded-16-inch-macbook-pro-with-m1-max-64gb-ram-is-300-off-back-in-stock?utm_medium=rss Apple x s loaded inch MacBook Pro with M Max GB RAM is off back in stockNot only is this M Max MacBook Pro inch eligible for a promo code discount but AppleCare is also off Apple s inch MacBook Pro M Max laptop with GB RAM is back in stock and on sale In stock and off Read more 2022-06-29 14:55:10
Apple AppleInsider - Frontpage News Apple highlights smaller European developers in new App Store editorial series https://appleinsider.com/articles/22/06/29/apple-highlights-smaller-european-developers-in-new-app-store-editorial-series?utm_medium=rss Apple highlights smaller European developers in new App Store editorial seriesApple has launched a new App Store editorial series called Meet The Founders which highlights smaller app developers throughout Europe App StoreThe new App Store series first spotted by TechRadar curates several smaller apps and spotlights their founders or developers Apple already collects and lists apps in its editorial content but the Founders post appears to be the first of an ongoing series Read more 2022-06-29 14:37:37
Apple AppleInsider - Frontpage News Apple plans to expand its R&D hub in Rawabi https://appleinsider.com/articles/22/06/29/apple-plans-to-expand-its-rd-hub-in-rawabi?utm_medium=rss Apple plans to expand its R amp D hub in RawabiApple s engineering research and development site in the Palestinian city Rawabi is reportedly to be expanded although few details have been revealed Johny Srouji during Apple s Unleashed eventAccording to reports in local Palestinian and Israeli press Apple has announced a significant expansion of its R amp D efforts in the region However it hasn t given any numbers and the expansion is said to be specifically of its Rawabi site Read more 2022-06-29 14:17:36
海外TECH CodeProject Latest Articles Img2Cpp: Create C++ Headers for Embedding Images https://www.codeproject.com/Articles/5336116/Img2Cpp-Create-Cplusplus-Headers-for-Embedding-Ima image 2022-06-29 14:04:00
金融 RSS FILE - 日本証券業協会 株主コミュニティの統計情報・取扱状況 https://www.jsda.or.jp/shiryoshitsu/toukei/kabucommunity/index.html 株主コミュニティ 2022-06-29 15:30:00
ニュース BBC News - Home Court told to reconsider Archie life support ruling https://www.bbc.co.uk/news/uk-england-essex-61980761?at_medium=RSS&at_campaign=KARANGA treatment 2022-06-29 14:50:38
ニュース BBC News - Home Dame Deborah James: Tributes paid to 'unfalteringly brave' cancer campaigner https://www.bbc.co.uk/news/uk-61980343?at_medium=RSS&at_campaign=KARANGA mother 2022-06-29 14:47:35
ニュース BBC News - Home Election win should trigger Scottish independence, says Sturgeon https://www.bbc.co.uk/news/uk-scotland-scotland-politics-61980405?at_medium=RSS&at_campaign=KARANGA october 2022-06-29 14:18:44
北海道 北海道新聞 NY円、一時137円台 24年ぶり円安ドル高水準 https://www.hokkaido-np.co.jp/article/699724/ 円安ドル高 2022-06-29 23:36:18
北海道 北海道新聞 NY株、反発 https://www.hokkaido-np.co.jp/article/699746/ 工業 2022-06-29 23:51:00
北海道 北海道新聞 日米韓首脳、安保協力強化で一致 対北朝鮮、5年ぶり会談 https://www.hokkaido-np.co.jp/article/699712/ 岸田文雄 2022-06-29 23:33:03
北海道 北海道新聞 NATO「ロシアは直接の脅威」 12年ぶり戦略文書、対中国懸念 https://www.hokkaido-np.co.jp/article/699705/ 北大西洋条約機構 2022-06-29 23:19:28
北海道 北海道新聞 十勝大福、タイの心つかむ 幕別の会社、大手コンビニで販売 あんこ浸透「おいしさ知った」 https://www.hokkaido-np.co.jp/article/699734/ 十勝管内 2022-06-29 23:33:00
北海道 北海道新聞 英、ロシア第2の富豪に制裁 プーチン氏「親戚」も https://www.hokkaido-np.co.jp/article/699718/ 親戚 2022-06-29 23:08:00
北海道 北海道新聞 米GDP確定値1・6%減 1~3月期、下方修正 https://www.hokkaido-np.co.jp/article/699717/ 下方修正 2022-06-29 23:05:00
海外TECH reddit T1 vs. Kwangdong Freecs / LCK 2022 Summer - Week 3 / Post-Match Discussion https://www.reddit.com/r/leagueoflegends/comments/vngw68/t1_vs_kwangdong_freecs_lck_2022_summer_week_3/ T vs Kwangdong Freecs LCK Summer Week Post Match DiscussionLCK SUMMER Official page Leaguepedia Liquipedia Eventvods com New to LoL T Kwangdong Freecs T Leaguepedia Liquipedia Website Twitter Facebook YouTube KDF Leaguepedia Liquipedia Website Twitter Facebook YouTube MATCH T vs KDF Winner T in m POG Oner Damage Graph Runes Bans Bans G K T D B T ahri twisted fate nautilus akali gangplank k C H M B HT KDF corki zeri wukong lee sin trundle k H T vs KDF Zeus gwen TOP kayle Kiin Oner xin zhao JNG viego Ellim Faker azir MID ornn FATE Gumayusi lucian BOT senna Teddy Keria nami SUP tahmkench Hoit MATCH T vs KDF Winner Kwangdong Freecs in m POG Teddy Damage Graph Runes Bans Bans G K T D B T ahri twisted fate yuumi ornn akali k H C KDF corki lucian zeri amumu renata glasc k M H O C B T vs KDF Zeus gwen TOP gangplank Kiin Oner wukong JNG viego Ellim Faker azir MID swain FATE Gumayusi kalista BOT senna Teddy Keria tahmkench SUP seraphine Hoit MATCH T vs KDF Winner Kwangdong Freecs in m POG Kiin Damage Graph Runes Bans Bans G K T D B T ahri senna kalista ezreal swain k O M KDF corki zeri lucian viego sylas k H H C C C B C T vs KDF Zeus gangplank TOP gnar Kiin Oner lee sin JNG wukong Ellim Faker lissandra MID ornn FATE Gumayusi jinx BOT ashe Teddy Keria tahmkench SUP seraphine Hoit Patch This thread was created by the Post Match Team submitted by u adzr to r leagueoflegends link comments 2022-06-29 14:17:55

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)