react-icons/md#MdAccessTime JavaScript Examples

The following examples show how to use react-icons/md#MdAccessTime. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FreeCodeCampCard.js    From hackertab.dev with Apache License 2.0 6 votes vote down vote up
ArticleItem = ({ item, index, analyticsTag }) => {

  return (
    <CardItemWithActions
      source={'freecodecamp'}
      index={index}
      key={index}
      item={{ ...item, url: item.link }}
      cardItem={
        <>
          <CardLink link={item.link} analyticsSource={analyticsTag}>
            <div className="subTitle">{item.title}</div>
          </CardLink>
            <>
              <p className="rowDescription">
                <span className="rowItem">
                  <MdAccessTime className={'rowTitleIcon'} />
                  {format(new Date(item.isoDate))}
                </span>
              </p>
              <p className="rowDetails">
                <ColoredLanguagesBadge languages={item.categories.slice(0, 4)} />
              </p>
            </>
        </>
      }
    />
  )
}
Example #2
Source File: ConferencesCard.js    From hackertab.dev with Apache License 2.0 5 votes vote down vote up
ConferenceItem = ({ conf, index, analyticsTag }) => {
  
  const { listingMode } = useContext(PreferencesContext)

  const formatConfsDate = (date) => {
    const monthNames = ["January", "February", "March", "April", "May", "June",
      "July", "August", "September", "October", "November", "December"
    ];

    return `${monthNames[date.getMonth()]} ${("0" + date.getDate()).slice(-2)}`

  }

  const ConferenceLocation = () => {
    return (
      conf.online ?
        "? Online" :
        `${flag(conf.country.replace(/[^a-zA-Z ]/g, ""))} ${conf.city}`
    )
  }

  const ConferenceDate = () => {
    let value = ""
    if (conf.startDate) {
      value = `${formatConfsDate(conf.startDate)}`
    }
    if (conf.endDate && conf.endDate > conf.startDate) {
      value = `${value} - ${
        conf.endDate.getMonth() === conf.startDate.getMonth() ?
          ("0" + conf.endDate.getDate()).slice(-2)
          : formatConfsDate(conf.endDate)
        }`
    }
    return value
  }
  return (
    <CardItemWithActions
      source={'conferences'}
      index={index}
      key={index}
      item={{ ...conf, title: conf.name }}
      cardItem={(
        <>
          <CardLink link={conf.url} analyticsSource={analyticsTag}>
            <RiCalendarEventFill className={"rowTitleIcon"} />
            {conf.name}
          </CardLink>
          {
            listingMode === "normal" ?
            <>
              <div className="rowDescription">
                <span className="rowItem"><IoIosPin className="rowItemIcon" /> {ConferenceLocation()}</span>
                <span className="rowItem"><MdAccessTime className="rowItemIcon" /> {ConferenceDate()}</span>
              </div>
              <div className="rowDetails">
                <ColoredLanguagesBadge languages={[conf.tag.value]} />
              </div>
            </> :
            <div className="rowDescription">
              <span className="rowItem"><MdAccessTime className="rowItemIcon" /> {ConferenceDate()}</span>
            </div>
          }
          
        </>
      )}
    />
  )
}
Example #3
Source File: DevToCard.js    From hackertab.dev with Apache License 2.0 5 votes vote down vote up
ArticleItem = ({ item, index, analyticsTag }) => {
  const { listingMode } = useContext(PreferencesContext)

  return (
    <CardItemWithActions
      source={'devto'}
      index={index}
      key={index}
      item={item}
      cardItem={
        <>
          <CardLink link={item.url} analyticsSource={analyticsTag}>
            {listingMode === 'compact' && (
              <div className="counterWrapper">
                <AiOutlineLike />
                <span className="value">{item.public_reactions_count}</span>
              </div>
            )}
            <div className="subTitle">{item.title}</div>
          </CardLink>

          {listingMode === 'normal' && (
            <>
              <p className="rowDescription">
                <span className="rowItem">
                  <MdAccessTime className={'rowTitleIcon'} />
                  {format(new Date(item.published_at))}
                </span>
                <span className="rowItem">
                  <BiCommentDetail className={'rowTitleIcon'} />
                  {item.comments_count} comments
                </span>
                <span className="rowItem">
                  <AiOutlineLike className={'rowTitleIcon'} />
                  {item.public_reactions_count} reactions
                </span>
              </p>
              <p className="rowDetails">
                <ColoredLanguagesBadge languages={item.tag_list} />
              </p>
            </>
          )}
        </>
      }
    />
  )
}
Example #4
Source File: HNCard.js    From hackertab.dev with Apache License 2.0 5 votes vote down vote up
StoryItem = ({ item, index, analyticsTag }) => {

  const { listingMode } = useContext(PreferencesContext)

  return (
    <CardItemWithActions
      source={'hackernews'}
      index={index}
      item={item}
      key={index}
      cardItem={
        <>
          <p className="rowTitle">
            <CardLink link={item.url} analyticsSource={analyticsTag}>
              {listingMode === 'compact' && (
                <span className="counterWrapper">
                  <VscTriangleUp />
                  <span className="value">{item.score}</span>
                </span>
              )}

              <span className="subTitle">{item.title}</span>
            </CardLink>
          </p>
          {listingMode === 'normal' && (
            <div className="rowDetails">
              <span className="rowItem hnRowItem">
                <GoPrimitiveDot className="rowItemIcon" /> {item.score} points
              </span>
              <span className="rowItem" title={new Date(item.time * 1000).toUTCString()}>
                <MdAccessTime className="rowItemIcon" /> {format(new Date(item.time * 1000))}
              </span>
              <ClickableItem
                link={`https://news.ycombinator.com/item?id=${item.id}`}
                className="rowItem rowItemClickable"
                analyticsSource={analyticsTag}>
                <BiCommentDetail className="rowItemIcon" /> {item.descendants} comments
              </ClickableItem>
            </div>
          )}
        </>
      }
    />
  )
}
Example #5
Source File: HashNodeCard.js    From hackertab.dev with Apache License 2.0 5 votes vote down vote up
ArticleItem = ({ item, index, analyticsTag }) => {
  const { listingMode } = useContext(PreferencesContext)

  return (
    <CardItemWithActions
      source={'hashnode'}
      index={index}
      key={index}
      item={{ ...item, url: item.link }}
      cardItem={
        <>
          <CardLink link={item.link} analyticsSource={analyticsTag}>
            {listingMode === 'compact' && (
              <div className="counterWrapper">
                <AiTwotoneHeart />
                <span className="value">{item.totalReactions || 0}</span>
              </div>
            )}
            <div className="subTitle">{item.title}</div>
          </CardLink>

          {listingMode === 'normal' && (
            <>
              <p className="rowDescription">
                <span className="rowItem">
                  <MdAccessTime className={'rowTitleIcon'} />
                  {format(new Date(item.dateAdded))}
                </span>
                <span className="rowItem">
                  <BiCommentDetail className={'rowTitleIcon'} />
                  {item.replyCount || 0} comments
                </span>
                <span className="rowItem">
                  <AiTwotoneHeart className={'rowTitleIcon'} />
                  {item.totalReactions || 0} reactions
                </span>
              </p>
              <p className="rowDetails">
                <ColoredLanguagesBadge languages={item.tag_list} />
              </p>
            </>
          )}
        </>
      }
    />
  )
}
Example #6
Source File: LobstersCard.js    From hackertab.dev with Apache License 2.0 5 votes vote down vote up
StoryItem = ({ item, index, analyticsTag }) => {
  const { listingMode } = useContext(PreferencesContext)
  return (
    <CardItemWithActions
      source={'lobsters'}
      index={index}
      item={item}
      key={index}
      cardItem={
        <>
          <p className="rowTitle">
            <CardLink link={item.url} analyticsSource={analyticsTag}>
              {listingMode === 'compact' && (
                <div className="counterWrapper">
                  <VscTriangleUp />
                  <span className="value">{item.score}</span>
                </div>
              )}

              <div className="subTitle">{item.title}</div>
            </CardLink>
          </p>
          {listingMode === 'normal' && (
            <div className="rowDetails">
              <span className="rowItem lobstersRowItem">
                <GoPrimitiveDot className="rowItemIcon" /> {item.score} points
              </span>
              <span className="rowItem" title={new Date(item.created_at).toUTCString()}>
                <MdAccessTime className="rowItemIcon" /> {format(new Date(item.created_at))}
              </span>
              <ClickableItem
                link={item.comments_url}
                className="rowItem rowItemClickable"
                analyticsSource={analyticsTag}>
                <BiCommentDetail className="rowItemIcon" /> {item.comment_count} comments
              </ClickableItem>
            </div>
          )}
        </>
      }
    />
  )
}
Example #7
Source File: RedditCard.js    From hackertab.dev with Apache License 2.0 5 votes vote down vote up
PostItem = ({ item, index, analyticsTag }) => {
    const fullUrl = `https://www.reddit.com${item.permalink}`
    const { listingMode } = useContext(PreferencesContext)

    return (
      <CardItemWithActions
        source={"reddit"}
        index={index}
        key={index}
        item={{ ...item, url: fullUrl }}
        cardItem={
          <>
            <CardLink link={fullUrl} analyticsSource={analyticsTag}>
                { listingMode === "compact" && 
                    <div className="counterWrapper">
                        <VscTriangleUp/>
                        <span className="value">{item.score}</span>
                    </div>
                }
                
                <div className="subTitle">
                    {item.link_flair_text && <PostFlair {...item} />}
                    {item.title}
                </div>
            </CardLink>

            <div className="rowDetails">
              {listingMode === "normal" && (
                <>
                  <span className="rowItem redditRowItem">
                    <GoPrimitiveDot className="rowItemIcon" /> {item.score}{" "}
                    points
                  </span>
                  <span className="rowItem">
                    <MdAccessTime className="rowItemIcon" />{" "}
                    {format(new Date(item.created_utc * 1000))}
                  </span>
                  <span className="rowItem">
                    <BiCommentDetail className="rowItemIcon" />{" "}
                    {item.num_comments} comments
                  </span>
                  <span className="rowItem">
                    <BsArrowReturnRight className="rowItemIcon" />{" "}
                    {`r/${item.subreddit}`}
                  </span>
                </>
              ) }
            </div>
          </>
        }
      />
    );
}