Skip to content

TabController - move to design tokens #1850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/tabController/TabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {orientations} from '../../commons/Constants';
import {useDidUpdate} from 'hooks';

const DEFAULT_HEIGHT = 48;
const DEFAULT_BACKGROUND_COLOR = Colors.white;
const DEFAULT_BACKGROUND_COLOR = Colors.$backgroundElevated;

const DEFAULT_LABEL_STYLE = {
...Typography.text80M,
Expand Down Expand Up @@ -317,19 +317,19 @@ const styles = StyleSheet.create({
left: 0,
width: 70,
height: 2,
backgroundColor: Colors.primary
backgroundColor: Colors.$backgroundPrimaryHeavy
},
containerShadow: {
...Platform.select({
ios: {
shadowColor: Colors.grey10,
shadowColor: Colors.black,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why black?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Private has this as black, and it removed the need for a new token, WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this way it'll be black in all modes.
Maybe $backgroundNeutralHeavy will do the work here since it's dark in light mode, and light in dark mode..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still don't have a solution for shadows AFAIK, so if we're not handling this in private, why should this be different?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh so you just align the color to the private one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really align everything, but this specifically because otherwise it's a new token for this edge case...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, ok..

shadowOpacity: 0.05,
shadowRadius: 2,
shadowOffset: {height: 6, width: 0}
},
android: {
elevation: 5,
backgroundColor: Colors.white
backgroundColor: Colors.$backgroundElevated
}
})
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/tabController/TabBarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import TabBarContext from './TabBarContext';

const TouchableOpacity = Reanimated.createAnimatedComponent(_TouchableOpacity);

const DEFAULT_LABEL_COLOR = Colors.black;
const DEFAULT_SELECTED_LABEL_COLOR = Colors.primary;
const DEFAULT_LABEL_COLOR = Colors.$textDefault;
const DEFAULT_SELECTED_LABEL_COLOR = Colors.$textPrimary;

export interface TabControllerItemProps {
/**
Expand Down Expand Up @@ -212,7 +212,7 @@ export default function TabBarItem({
</Reanimated.Text>
)}
{badge && (
<Badge backgroundColor={Colors.red30} size={20} {...badge} containerStyle={styles.badge}/>
<Badge backgroundColor={Colors.$backgroundDangerHeavy} size={20} {...badge} containerStyle={styles.badge}/>
)}
{trailingAccessory}
</TouchableOpacity>
Expand Down