mirror of
https://github.com/DigiLive/mushroom-strategy.git
synced 2025-08-01 02:44:27 +02:00
Refactor column count of person cards in Home view
Having many persons, the cards would take up a lot of space in the Home view. Now, a horizontal stack allows up to 8 cards.
This commit is contained in:
@@ -265,7 +265,7 @@ class Registry {
|
||||
* Each horizontal stack contains a specified number of cards.
|
||||
*
|
||||
* @param {LovelaceCardConfig[]} cardConfigurations - Array of card configurations to be stacked.
|
||||
* @param {number} columnCount - Number of cards per horizontal stack.
|
||||
* @param {number} columnCount - Maximal number of cards per horizontal stack.
|
||||
*/
|
||||
static stackHorizontal(cardConfigurations: LovelaceCardConfig[], columnCount: number): StackCardConfig[] {
|
||||
const stackedCardConfigurations: StackCardConfig[] = [];
|
||||
|
@@ -207,10 +207,9 @@ class HomeView extends AbstractView {
|
||||
.map((person) => new PersonCard(person).getCard()),
|
||||
);
|
||||
|
||||
// FIXME: The columns are too narrow when having many persons.
|
||||
return {
|
||||
type: 'vertical-stack',
|
||||
cards: Registry.stackHorizontal(cardConfigurations, 2),
|
||||
cards: Registry.stackHorizontal(cardConfigurations, 8),
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user