Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

try to improve rendering

ammarahm-eda665fe1fc030
diff --git a/apps/mobile/src/components/ui/iconbutton/index.tsx b/apps/mobile/src/components/ui/iconbutton/index.tsx
index e66d2836a..022d8fb4f 100644
--- a/apps/mobile/src/components/ui/iconbutton/index.tsx
+++ b/apps/mobile/src/components/ui/iconbutton/index.tsx
@@ -71,7 +71,12 @@ export const IconButton = ({
<Icon
name={name}
style={iconStyle}
- color={restProps.disabled ? RGB_Linear_Shade(-0.05, hexToRGBA(colors.nav)) : color}
+ color={
+ restProps.disabled
+ ? RGB_Linear_Shade(-0.05, hexToRGBA(colors.nav))
+ : //@ts-ignore
+ colors[color] || color
+ }
size={size}
/>
</PressableButton>
diff --git a/apps/mobile/src/screens/editor/tiny/toolbar/group.js b/apps/mobile/src/screens/editor/tiny/toolbar/group.js
index 2f8735aff..89254c83d 100644
--- a/apps/mobile/src/screens/editor/tiny/toolbar/group.js
+++ b/apps/mobile/src/screens/editor/tiny/toolbar/group.js
@@ -1,11 +1,8 @@
import React from 'react';
import { View } from 'react-native';
-import { useThemeStore } from '../../../../stores/theme';
import ToolbarItem from './item';
const ToolbarGroup = ({ group }) => {
- const colors = useThemeStore(state => state.colors);
-
return (
<View
style={{
diff --git a/apps/mobile/src/screens/editor/tiny/toolbar/index.js b/apps/mobile/src/screens/editor/tiny/toolbar/index.js
index a121a87b7..57504cb06 100644
--- a/apps/mobile/src/screens/editor/tiny/toolbar/index.js
+++ b/apps/mobile/src/screens/editor/tiny/toolbar/index.js
@@ -1,8 +1,8 @@
import React, { useEffect } from 'react';
-import { Platform, View, ScrollView } from 'react-native';
+import { ScrollView, View } from 'react-native';
import { IconButton } from '../../../../components/ui/icon-button';
-import { useThemeStore } from '../../../../stores/theme';
import { useEditorStore } from '../../../../stores/stores';
+import { useThemeStore } from '../../../../stores/theme';
import { getElevation } from '../../../../utils';
import { db } from '../../../../utils/database';
import { normalize } from '../../../../utils/size';
@@ -17,7 +17,6 @@ import Tooltip from './tooltip';
const EditorToolbar = React.memo(
() => {
- const colors = useThemeStore(state => state.colors);
const config = TOOLBAR_CONFIG;
const searchReplace = useEditorStore(state => state.searchReplace);
const readonly = useEditorStore(state => state.readonly);
@@ -52,7 +51,7 @@ const EditorToolbar = React.memo(
name="pencil-lock"
type="grayBg"
onPress={onPress}
- color={colors.accent}
+ color="accent"
customStyle={{
position: 'absolute',
bottom: 20,
@@ -75,7 +74,6 @@ const EditorToolbar = React.memo(
width: '100%',
maxWidth: '100%',
minHeight: normalize(50),
- backgroundColor: colors.bg,
paddingLeft: 6,
zIndex: 11
}}
@@ -94,14 +92,7 @@ const EditorToolbar = React.memo(
typeof item !== 'string' ? (
<ToolbarGroup key={item[0].format} group={item} />
) : (
- <View
- style={{
- height: 30,
- width: 2,
- marginHorizontal: 2,
- backgroundColor: colors.nav
- }}
- />
+ <Seperator key={index + '-seperator'} />
)
)}
</ScrollView>
@@ -116,4 +107,18 @@ const EditorToolbar = React.memo(
() => true
);
+const Seperator = () => {
+ const colors = useThemeStore(state => state.colors);
+ return (
+ <View
+ style={{
+ height: 30,
+ width: 2,
+ marginHorizontal: 2,
+ backgroundColor: colors.nav
+ }}
+ />
+ );
+};
+
export default EditorToolbar;