forked from GeekyAnts/NativeBase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request GeekyAnts#3351 from GeekyAnts/fix/v3-appbar-themeing
fix: added themeing and dark mode support
- Loading branch information
Showing
7 changed files
with
60 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
import React from 'react'; | ||
import { Box, IBoxProps } from '../../primitives'; | ||
import { usePropsConfig } from '../../../hooks'; | ||
|
||
export type IAppBarContentProps = IBoxProps; | ||
|
||
const AppBarContent = (props: IAppBarContentProps) => { | ||
return <Box flex={1} alignItems="center" flexDirection="row" {...props} />; | ||
const { color } = usePropsConfig('AppBar', props); | ||
return ( | ||
<Box | ||
flex={1} | ||
alignItems="center" | ||
flexDirection="row" | ||
color={color} | ||
{...props} | ||
/> | ||
); | ||
}; | ||
|
||
export default AppBarContent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import React from 'react'; | ||
import { HStack, IStackProps } from '../../primitives'; | ||
import { usePropsConfig } from '../../../hooks'; | ||
|
||
const AppBarLeft = ({ ...props }: IStackProps) => { | ||
return <HStack alignItems="center" {...props} />; | ||
const { color } = usePropsConfig('AppBar', props); | ||
return <HStack alignItems="center" color={color} {...props} />; | ||
}; | ||
|
||
export default AppBarLeft; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
import React from 'react'; | ||
import { HStack, IStackProps } from '../../primitives'; | ||
import { usePropsConfig } from '../../../hooks'; | ||
|
||
const AppBarRight = ({ ...props }: IStackProps) => { | ||
return <HStack alignItems="center" justifyContent="flex-end" {...props} />; | ||
const { color } = usePropsConfig('AppBar', props); | ||
return ( | ||
<HStack | ||
alignItems="center" | ||
justifyContent="flex-end" | ||
color={color} | ||
{...props} | ||
/> | ||
); | ||
}; | ||
|
||
export default AppBarRight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { mode, getColorScheme } from './../tools'; | ||
|
||
const baseStyle = (props: Record<string, any>) => { | ||
let colorScheme = getColorScheme(props); | ||
return { | ||
bg: mode(`${colorScheme}.500`, `${colorScheme}.300`)(props), | ||
color: mode('gray.800', 'gray.50')(props), | ||
px: 2, | ||
height: '56px', | ||
}; | ||
}; | ||
const defaultProps = {}; | ||
|
||
export default { | ||
baseStyle, | ||
defaultProps, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters