1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Implemented new dark theme

This commit is contained in:
Zhiyuan Zheng
2022-02-12 14:51:01 +01:00
parent 50141b2963
commit 6f0c318d06
108 changed files with 863 additions and 571 deletions

View File

@ -11,13 +11,13 @@ export interface Props {
// Used for Android mostly
const HeaderCenter = React.memo(
({ content, inverted = false }: Props) => {
const { theme } = useTheme()
const { colors } = useTheme()
return (
<Text
style={[
styles.text,
{ color: inverted ? theme.primaryOverlay : theme.primaryDefault }
{ color: inverted ? colors.primaryOverlay : colors.primaryDefault }
]}
children={content}
/>

View File

@ -20,14 +20,14 @@ const HeaderLeft: React.FC<Props> = ({
background = false,
onPress
}) => {
const { theme } = useTheme()
const { colors, theme } = useTheme()
const children = useMemo(() => {
switch (type) {
case 'icon':
return (
<Icon
color={theme.primaryDefault}
color={colors.primaryDefault}
name={content || 'ChevronLeft'}
size={StyleConstants.Spacing.M * 1.25}
/>
@ -35,7 +35,7 @@ const HeaderLeft: React.FC<Props> = ({
case 'text':
return (
<Text
style={[styles.text, { color: theme.primaryDefault }]}
style={[styles.text, { color: colors.primaryDefault }]}
children={content}
/>
)
@ -50,7 +50,7 @@ const HeaderLeft: React.FC<Props> = ({
styles.base,
{
backgroundColor: background
? theme.backgroundOverlayDefault
? colors.backgroundOverlayDefault
: undefined,
minHeight: 44,
minWidth: 44,

View File

@ -41,14 +41,14 @@ const HeaderRight: React.FC<Props> = ({
disabled,
onPress
}) => {
const { theme } = useTheme()
const { colors, theme } = useTheme()
const loadingSpinkit = useMemo(
() => (
<View style={{ position: 'absolute' }}>
<Flow
size={StyleConstants.Font.Size.M * 1.25}
color={theme.secondary}
color={colors.secondary}
/>
</View>
),
@ -64,7 +64,7 @@ const HeaderRight: React.FC<Props> = ({
name={content}
style={{ opacity: loading ? 0 : 1 }}
size={StyleConstants.Spacing.M * 1.25}
color={disabled ? theme.secondary : theme.primaryDefault}
color={disabled ? colors.secondary : colors.primaryDefault}
/>
{loading && loadingSpinkit}
</>
@ -76,7 +76,7 @@ const HeaderRight: React.FC<Props> = ({
style={[
styles.text,
{
color: disabled ? theme.secondary : theme.primaryDefault,
color: disabled ? colors.secondary : colors.primaryDefault,
opacity: loading ? 0 : 1
}
]}
@ -101,7 +101,7 @@ const HeaderRight: React.FC<Props> = ({
styles.base,
{
backgroundColor: background
? theme.backgroundOverlayDefault
? colors.backgroundOverlayDefault
: undefined,
minHeight: 44,
minWidth: 44,