Rename IconLink to Link

Now that there is a Link.mustache, I think other components like Button, Link should use the Icon template, and not include icon in the name, as its possible to have a link or button that doesnt use an icon as well.

Change-Id: I6d8a17dd956f09bb3df7a2503f55d255599874f8
This commit is contained in:
bwang 2023-02-17 16:53:02 -06:00 committed by Jdlrobson
parent c72cacec71
commit 0e5ef398b2
5 changed files with 10 additions and 10 deletions

View file

@ -6,9 +6,9 @@ use Linker;
use MessageLocalizer;
/**
* VectorComponentIconLink component
* VectorComponentLink component
*/
class VectorComponentIconLink implements VectorComponent {
class VectorComponentLink implements VectorComponent {
/** @var MessageLocalizer */
private $localizer;
/** @var string */

View file

@ -5,7 +5,7 @@ namespace MediaWiki\Skins\Vector\Components;
* VectorComponentMenuListItem component
*/
class VectorComponentMenuListItem implements VectorComponent {
/** @var VectorComponentIconLink */
/** @var VectorComponentLink */
private $link;
/** @var string */
private $class;
@ -13,11 +13,11 @@ class VectorComponentMenuListItem implements VectorComponent {
private $id;
/**
* @param VectorComponentIconLink $link
* @param VectorComponentLink $link
* @param string $class
* @param string $id
*/
public function __construct( VectorComponentIconLink $link, string $class = '', string $id = '' ) {
public function __construct( VectorComponentLink $link, string $class = '', string $id = '' ) {
$this->link = $link;
$this->class = $class;
$this->id = $id;

View file

@ -1 +1 @@
<li class="{{item-class}}" {{#item-id}}id="{{.}}"{{/item-id}}>{{>IconLink}}</li>
<li class="{{item-class}}" {{#item-id}}id="{{.}}"{{/item-id}}>{{>Link}}</li>

View file

@ -12,8 +12,8 @@ const pinnableElementOpenTemplate = fs.readFileSync( 'includes/templates/Pinnabl
const pinnableElementCloseTemplate = fs.readFileSync( 'includes/templates/PinnableElement/Close.mustache', 'utf8' );
const pinnableHeaderTemplate = fs.readFileSync( 'includes/templates/PinnableHeader.mustache', 'utf8' );
const menuTemplate = fs.readFileSync( 'includes/templates/Menu.mustache', 'utf8' );
const IconLink = fs.readFileSync( 'includes/templates/IconLink.mustache', 'utf8' );
const MenuListItem = fs.readFileSync( 'includes/templates/MenuListItem.mustache', 'utf8' );
const linkTemplate = fs.readFileSync( 'includes/templates/Link.mustache', 'utf8' );
const menuListItemTemplate = fs.readFileSync( 'includes/templates/MenuListItem.mustache', 'utf8' );
const templateData = {
'is-wide': false,
@ -69,8 +69,8 @@ const dropdownPartials = {
PinnableHeader: pinnableHeaderTemplate,
Menu: menuTemplate,
MenuContents: menuContents,
IconLink,
MenuListItem
Link: linkTemplate,
MenuListItem: menuListItemTemplate
};
const renderedHTML = mustache.render( userLinksTemplate, templateData, dropdownPartials );