Skip to content
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

187 Ten Tap #190

Merged
merged 9 commits into from
Nov 5, 2024
52 changes: 40 additions & 12 deletions lib/screens/EditNoteScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ const EditNoteScreen: React.FC<EditNoteScreenProps> = ({
...Platform.select({
android: {
flex: 1,
backgroundColor: theme.tertiaryColor, // Match the background color of your screen
backgroundColor: theme.primaryColor, // Match the background color of your screen
},
ios: {
flex: 1,
backgroundColor: theme.tertiaryColor, // Match the background color of your screen
backgroundColor: theme.primaryColor, // Match the background color of your screen
},
}),
ademDurakovic marked this conversation as resolved.
Show resolved Hide resolved
},
Expand Down Expand Up @@ -177,8 +177,8 @@ const EditNoteScreen: React.FC<EditNoteScreenProps> = ({

...Platform.select({
android: {
height: 80, // Fixed height for the toolbar at the bottom
backgroundColor: '#333', // Ensure the toolbar has a background color
height: 60, // Fixed height for the toolbar at the bottom
backgroundColor: theme.tertiaryColor, // Ensure the toolbar has a background color
},
ios: {
height: 50, // Fixed height for the toolbar at the bottom
Expand Down Expand Up @@ -429,6 +429,21 @@ const EditNoteScreen: React.FC<EditNoteScreenProps> = ({
editor.injectCSS(textColorCSS, 'text-color-style');
console.log("text color will be: #F7F8F9 from IF state");
ademDurakovic marked this conversation as resolved.
Show resolved Hide resolved
}
const [isKeyboardVisible, setIsKeyboardVisible] = useState(false);
useEffect(() => {
const keyboardDidShowListener = Keyboard.addListener("keyboardDidShow", () => {
setIsKeyboardVisible(true);
});
const keyboardDidHideListener = Keyboard.addListener("keyboardDidHide", () => {
setIsKeyboardVisible(false);
});

return () => {
keyboardDidShowListener.remove();
keyboardDidHideListener.remove();
};
}, []);

ademDurakovic marked this conversation as resolved.
Show resolved Hide resolved

return (
<SafeAreaView style={{ flex: 1 }}>
Expand Down Expand Up @@ -566,20 +581,33 @@ const EditNoteScreen: React.FC<EditNoteScreenProps> = ({
</View>
<SafeAreaView style={exampleStyles.fullScreen}>
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'height' : 'padding'}
behavior={Platform.OS === 'android' ? 'height' : 'padding'}
style={exampleStyles.fullScreen}
>


>
<View style={exampleStyles.richTextContainer}>
<RichText
editor={editor}
style={[exampleStyles.editor, {backgroundColor: Platform.OS == "android" && theme.tertiaryColor}]} // Apply styling here
style={[exampleStyles.editor, {backgroundColor: Platform.OS == "android" && theme.primaryColor}]} // Apply styling here
/>

</View>


</View>

<View
style={{
height: 50, // Set a compact height that’s not too small
backgroundColor: theme.primaryColor, // Match the background color of the screen
justifyContent: 'center',
paddingVertical:0, // Minimal vertical padding for compactness
paddingHorizontal: 0, // Adjust as needed to control horizontal space
overflow: 'hidden', // Ensure no extra space
marginTop: 50

}}
>
<Toolbar editor={editor} items={DEFAULT_TOOLBAR_ITEMS} />
</View>


</KeyboardAvoidingView>

</SafeAreaView>
Expand Down
Loading