-- Compiled with roblox-ts v1.2.7 local TS = _G[script] local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src) local connect = TS.import(script, TS.getModule(script, "@rbxts", "roact-rodux").src).connect local ThemeContext = TS.import(script, script.Parent.Parent.Parent, "UIKit", "ThemeContext").default local DEFAULT_FILTER = TS.import(script, script.Parent.Parent, "Store", "_reducers", "ConsoleReducer").DEFAULT_FILTER local ZirconTopbarMenuComponent do ZirconTopbarMenuComponent = Roact.Component:extend("ZirconTopbarMenuComponent") function ZirconTopbarMenuComponent:init(props) self.state = { isVisible = props.isVisible, levelFilter = props.levelFilter, } end function ZirconTopbarMenuComponent:didUpdate(prevProps) if prevProps.isVisible ~= self.props.isVisible then self:setState({ isVisible = self.props.isVisible, }) elseif prevProps.levelFilter ~= self.props.levelFilter then self:setState({ levelFilter = self.props.levelFilter, }) end end function ZirconTopbarMenuComponent:render() return Roact.createElement(ThemeContext.Consumer, { render = function(theme) return Roact.createElement("ScreenGui", { DisplayOrder = 10001, ResetOnSpawn = false, IgnoreGuiInset = true, }, { Roact.createElement("Frame", { Visible = self.state.isVisible, Size = UDim2.new(1, 0, 0, 40), BackgroundColor3 = theme.PrimaryBackgroundColor3, BorderSizePixel = 0, Position = self.state.isVisible and UDim2.new(0, 0, 0, 0) or UDim2.new(0, 0, 0, -40), }, { Roact.createElement("UIPadding", { PaddingLeft = UDim.new(0, 60), }), Roact.createElement("UIListLayout", { VerticalAlignment = "Center", FillDirection = "Horizontal", Padding = UDim.new(0, 10), }), Roact.createElement("Frame", { Size = UDim2.new(0, 32, 0, 32), BackgroundTransparency = 1, }, { Roact.createElement("UIListLayout", { VerticalAlignment = "Center", HorizontalAlignment = "Center", }), }), }), }) end, }) end end local mapStateToProps = function(state) local _object = { isVisible = state.visible, } local _left = "levelFilter" local _condition = state.filter.Levels if _condition == nil then _condition = DEFAULT_FILTER end _object[_left] = _condition return _object end local mapPropsToDispatch = function(dispatch) return { updateContextFilter = function(Context) if Context ~= nil then dispatch({ type = "UpdateFilter", Context = Context, }) else dispatch({ type = "RemoveFilter", filter = "Context", }) end end, updateLevelFilter = function(Levels) if Levels ~= nil then dispatch({ type = "UpdateFilter", Levels = Levels, }) else dispatch({ type = "RemoveFilter", filter = "Levels", }) end end, } end --[[ * * A docked console ]] local ZirconTopBar = connect(mapStateToProps, mapPropsToDispatch)(ZirconTopbarMenuComponent) local default = ZirconTopBar return { default = default, }