-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Homepage left side bar tags followed (#5918) [deploy]
* SASS formatting in action. * Unnested .sidebar-nav-element in SASS * Created the <TagsFollowed /> component. * Mini refactor. * Left side bar uses <TagsFollowed /> component now. * Accomodating InstantClick * Small refactor and added some comments. * The homepage webpacker pack only needs to be loaded once. * Added tests for the <TagsFollowed /> component. * Modified the receive InstantClick callback as per their docs. * Reverted the data-no-instant on he homepage bundle. It seems to cause issues in certain scenarios. * Just some tweaks to <TagsFollowed /> component. * Removed CSS for general img tag in context of sidebar as it does not appear to be used. * Fixed copy paste error from JSX to HTML. * Fixed <img /> styles for arbitrary sponsorship widget. * Fixed a regression that a Capybara test caught. * Fixed user followed tags on home page tests. * Fixed logic for loading user data on homepage.
- Loading branch information
1 parent
bc87646
commit 0119918
Showing
10 changed files
with
534 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { h } from 'preact'; | ||
import PropTypes from 'prop-types'; | ||
import { tagPropTypes } from '../src/components/common-prop-types'; | ||
|
||
export const TagsFollowed = ({ tags = [] }) => { | ||
// TODO: Once we're using Preact X >, we can replace the containing <div /> with a Fragment, <></> | ||
return ( | ||
<div> | ||
{tags.map(tag => ( | ||
<div | ||
key={tag.id} | ||
className="sidebar-nav-element" | ||
id={`sidebar-element-${tag.name}`} | ||
> | ||
<a className="sidebar-nav-link" href={`/t/${tag.name}`}> | ||
<span className="sidebar-nav-tag-text">{`#${tag.name}`}</span> | ||
</a> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
TagsFollowed.displayName = 'TagsFollowed'; | ||
TagsFollowed.propTypes = { | ||
tags: PropTypes.arrayOf(tagPropTypes).isRequired, | ||
}; |
Oops, something went wrong.