-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
505 additions
and
141 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
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,26 @@ | ||
--- | ||
-- @Liquipedia | ||
-- wiki=commons | ||
-- page=Module:Widget/Html/Header | ||
-- | ||
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute | ||
-- | ||
|
||
local Class = require('Module:Class') | ||
local Lua = require('Module:Lua') | ||
|
||
local WidgetHtml = Lua.import('Module:Widget/Html/Base') | ||
|
||
---@class WidgetHeader: WidgetHtmlBase | ||
---@operator call(table): WidgetHeader | ||
local Header = Class.new(WidgetHtml) | ||
|
||
---@return Html | ||
function Header:render() | ||
if not self.props.level then | ||
error('Header level not provided') | ||
end | ||
return self:renderAs('h' .. self.props.level) | ||
end | ||
|
||
return Header |
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,46 @@ | ||
--- | ||
-- @Liquipedia | ||
-- wiki=commons | ||
-- page=Module:Widget/Match/Page/Header | ||
-- | ||
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute | ||
-- | ||
|
||
local Array = require('Module:Array') | ||
local Class = require('Module:Class') | ||
local Lua = require('Module:Lua') | ||
|
||
local Widget = Lua.import('Module:Widget') | ||
local WidgetUtil = Lua.import('Module:Widget/Util') | ||
local HtmlWidgets = Lua.import('Module:Widget/Html/All') | ||
local Div, Fragment, Header = HtmlWidgets.Div, HtmlWidgets.Fragment, HtmlWidgets.Header | ||
local Link = Lua.import('Module:Widget/Basic/Link') | ||
local MatchPageFooterSection = Lua.import('Module:Widget/Match/Page/Footer/Section') | ||
|
||
---@class MatchPageFooter: Widget | ||
---@operator call(table): MatchPageFooter | ||
local MatchPageFooter = Class.new(Widget) | ||
MatchPageFooter.defaultProps = { | ||
flipped = false, | ||
} | ||
|
||
---@return Widget[]? | ||
function MatchPageFooter:render() | ||
return Fragment{children = { | ||
Header{level = 3, children = 'Additional Information'}, | ||
Div{ | ||
classes = {'match-bm-match-additional'}, | ||
children = WidgetUtil.collect( | ||
self.props.vods and MatchPageFooterSection{header = 'VODs', children = self.props.vods} or nil, | ||
self.props.links and MatchPageFooterSection{header = 'Socials', children = Array.map(self.props.links, function(link) | ||
return '[['.. link.icon .. '|link='.. link.link .. '|15px|'.. link.text .. ']]' | ||
end)} or nil, | ||
self.props.patch and MatchPageFooterSection{header = 'Patch', children = | ||
Link{link = 'Version ' .. self.props.patch, children = 'Version ' .. self.props.patch} | ||
} or nil | ||
) | ||
} | ||
}} | ||
end | ||
|
||
return MatchPageFooter |
Oops, something went wrong.