mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix incorrect header is showing
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
||||
} from '../../assets/images/assets';
|
||||
import {useTracked} from '../../provider';
|
||||
import FastImage from 'react-native-fast-image'
|
||||
export const Placeholder = ({type, w, h, color}) => {
|
||||
export const Placeholder = React.memo(({type, w, h, color}) => {
|
||||
const [state, dispatch] = useTracked();
|
||||
const {colors} = state;
|
||||
const getSVG = () => {
|
||||
@@ -43,6 +43,8 @@ export const Placeholder = ({type, w, h, color}) => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
console.log(type);
|
||||
return (
|
||||
<SvgToPngView
|
||||
color={type === 'notes' ? color || colors.accent : colors.accent}
|
||||
@@ -52,7 +54,7 @@ export const Placeholder = ({type, w, h, color}) => {
|
||||
height={h}
|
||||
/>
|
||||
);
|
||||
};
|
||||
},() => true);
|
||||
|
||||
export const SvgToPngView = ({width, height, src, color, img}) => {
|
||||
const [error, setError] = useState(false);
|
||||
|
||||
@@ -20,6 +20,7 @@ export const Header = ({
|
||||
onPress,
|
||||
shouldShow = false,
|
||||
icon,
|
||||
screen
|
||||
}) => {
|
||||
const [state] = useTracked();
|
||||
const {colors} = state;
|
||||
@@ -70,7 +71,7 @@ export const Header = ({
|
||||
color={COLORS_NOTE[title.toLowerCase()] || colors.accent}
|
||||
w={normalize(150)}
|
||||
h={normalize(150)}
|
||||
type={type}
|
||||
type={screen === "Favorites" ? "favorites" : type}
|
||||
/>
|
||||
</View>
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@ const SimpleList = ({
|
||||
type={dataType}
|
||||
index={index}
|
||||
data={listData}
|
||||
screen={screen}
|
||||
/>
|
||||
);
|
||||
case 'header':
|
||||
|
||||
Reference in New Issue
Block a user