Class: Solrengine::Ui::NftGridComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/solrengine/ui/nft_grid_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nfts:, empty_message: "No NFTs in this wallet yet") ⇒ NftGridComponent

nfts: array of { id:, name:, image:, collection:, compressed: } (the shape returned by Solrengine::Tokens::Portfolio#nfts)



10
11
12
13
# File 'app/components/solrengine/ui/nft_grid_component.rb', line 10

def initialize(nfts:, empty_message: "No NFTs in this wallet yet")
  @nfts = nfts || []
  @empty_message = empty_message
end

Instance Attribute Details

#empty_messageObject (readonly)

Returns the value of attribute empty_message.



6
7
8
# File 'app/components/solrengine/ui/nft_grid_component.rb', line 6

def empty_message
  @empty_message
end

#nftsObject (readonly)

Returns the value of attribute nfts.



6
7
8
# File 'app/components/solrengine/ui/nft_grid_component.rb', line 6

def nfts
  @nfts
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'app/components/solrengine/ui/nft_grid_component.rb', line 15

def empty?
  nfts.empty?
end