Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

EPIC - Update TabView to have Context #505

Closed
3 tasks done
tuliopereirazup opened this issue Jul 10, 2020 · 4 comments
Closed
3 tasks done

EPIC - Update TabView to have Context #505

tuliopereirazup opened this issue Jul 10, 2020 · 4 comments
Assignees
Labels
epic Global features request
Projects

Comments

@tuliopereirazup
Copy link
Contributor

tuliopereirazup commented Jul 10, 2020

Description

Since we have launched Communication between Components (#54), we can now update TabView to simplify its implementation, and to allow new ways to use it on different use cases.

Ex1: use a TabView that the bar would be at the bottom, and the scroll of "pages" would be at the top

Ex2: when there is some change on current displayed "tab", I wanted to trigger an analytics event

Possible Solution

  • deprecate TabView and TabItem (and others related classes if needed)
  • create a new TabBar component that will be just the view with a list of tabs.
    • current selected tab should be an expression
    • when some tab is selected, trigger an event
    • try to use it with PageView, to see if this new composition can be used instead of the old TabView
  • update documentation accordingly

Maybe problematic points

@tuliopereirazup tuliopereirazup created this issue from a note in 1.1 (To do) Jul 10, 2020
@tuliopereirazup tuliopereirazup added the epic Global features request label Jul 10, 2020
@theffc theffc moved this from To do to Epics in 1.1 Jul 13, 2020
@yandiaszup yandiaszup self-assigned this Jul 20, 2020
@viniciusguardieirozup viniciusguardieirozup self-assigned this Jul 20, 2020
@carolinegoncalveszup carolinegoncalveszup self-assigned this Jul 22, 2020
@yandiaszup
Copy link
Contributor

yandiaszup commented Jul 22, 2020

Models:

struct TabBar {
    public let children: [TabBarItem]
    public let styleId: String?
    public let currentTab: Expression<Int>?
    public let onTabSelection: [RawAction]?
}
public struct TabBarItem {
    public let icon: String?
    public let title: String?
}

@yandiaszup
Copy link
Contributor

The idea its to use this TabBar component with PageView, communicating then with context and expressions to replicate TabView component behavior so we can deprecate it.

@carolinegoncalveszup
Copy link

This change also request pageview contract to be changed.
For the expected behavior on the web we should add showArrow in pageview which is a boolean. This prop will be used to indicate if the pageview arrows that are shown on the web should or not be visible.

@carolinegoncalveszup
Copy link

carolinegoncalveszup commented Jul 22, 2020

For the tabview component we suggest:

struct TabBar {
    public let items: [TabBarItem]
    public let styleId: String?
    public let currentTab: Expression<Int>?
    public let onTabSelection: [RawAction]?
}
public struct TabBarItem {
    public let icon: ImagePath?
    public let title: String?
}

The tabItem array should not be children as it is not a ServerDrivenComponent, so we suggest items instead.
Another suggestion is to change the icon type to ImagePath, in which the _beagleImagePath_ must always be local

@yandiaszup yandiaszup mentioned this issue Jul 23, 2020
6 tasks
@tuliopereirazup tuliopereirazup moved this from Epics ordered by priority to In progress in 1.1 Aug 11, 2020
@tuliopereirazup tuliopereirazup moved this from In progress to Ready to Test in 1.1 Aug 11, 2020
@luisoliveirazup luisoliveirazup moved this from Ready to Test to Test In Progress in 1.1 Sep 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
epic Global features request
Projects
No open projects
1.1
  
Test In Progress
Development

No branches or pull requests

4 participants