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/sidebar.rb

30 lines
435 B
Ruby
Raw Normal View History

2017-07-21 11:00:11 -04:00
# frozen_string_literal: true
module Widgets
class Sidebar < Container
2017-07-25 10:29:01 -04:00
def initialize(_parent)
super
2017-07-22 09:44:43 -04:00
2017-07-25 10:29:01 -04:00
@logo = Logo.new self
@menu = Menu.new self
2017-07-24 18:34:50 -04:00
end
def focus
case props[:focus]
when :menu
@menu
end
end
2017-07-22 13:13:57 -04:00
2017-07-24 18:34:50 -04:00
def props=(_value)
super
2017-07-25 10:29:01 -04:00
@logo.props = props[:logo]
2017-07-24 18:34:50 -04:00
@menu.props = props[:menu]
2017-07-22 08:51:01 -04:00
end
2017-07-22 11:37:22 -04:00
def children
[@logo, @menu]
2017-07-21 11:00:11 -04:00
end
end
end