Archived
1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
cli-old/lib/widgets/main.rb
2017-07-25 14:48:37 +00:00

31 lines
519 B
Ruby

# frozen_string_literal: true
module Widgets
class Main < Container
def initialize(_parent)
super
@sidebar = Widgets::Sidebar.new self
@chat = Widgets::Chat.new self
end
def props=(_value)
super
@sidebar.props = props[:sidebar]
@chat.props = props[:chat]
end
private
def focus
case props[:focus]
when :sidebar then @sidebar
when :chat then @chat
end
end
def children
[@sidebar, @chat]
end
end
end