mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
minor ui fixes
This commit is contained in:
@@ -406,11 +406,6 @@ export class AddNotebookDialog extends React.Component {
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
<View
|
||||
style={{
|
||||
zIndex:10
|
||||
}}
|
||||
>
|
||||
|
||||
<FlatList
|
||||
data={topics}
|
||||
@@ -435,7 +430,6 @@ export class AddNotebookDialog extends React.Component {
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View style={styles.buttonContainer}>
|
||||
<Button
|
||||
|
||||
@@ -4,11 +4,35 @@ import { useTracked } from '../../provider';
|
||||
import {Actions} from '../../provider/Actions';
|
||||
import {ActionIcon} from '../ActionIcon';
|
||||
import {SIZE, WEIGHT} from "../../utils/SizeUtils";
|
||||
|
||||
const menuRef = createRef();
|
||||
export const HeaderMenu = () => {
|
||||
const [state, dispatch] = useTracked();
|
||||
const {colors, headerVerticalMenu} = state;
|
||||
|
||||
const styles = {
|
||||
text:{
|
||||
fontFamily: WEIGHT.regular,
|
||||
color: colors.pri,
|
||||
fontSize: SIZE.sm,
|
||||
},
|
||||
title:{
|
||||
fontFamily: WEIGHT.regular,
|
||||
color: colors.icon,
|
||||
fontSize: SIZE.sm ,
|
||||
},
|
||||
action:{
|
||||
justifyContent: 'center',
|
||||
alignItems: 'flex-end',
|
||||
height: 40,
|
||||
width: 40,
|
||||
marginLeft: 10,
|
||||
borderRadius: 100,
|
||||
backgroundColor: colors.bg,
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return headerVerticalMenu ? (
|
||||
<Menu
|
||||
ref={menuRef}
|
||||
@@ -16,6 +40,7 @@ export const HeaderMenu = () => {
|
||||
style={{
|
||||
borderRadius: 5,
|
||||
backgroundColor: colors.bg,
|
||||
paddingBottom:10,
|
||||
}}
|
||||
button={
|
||||
<ActionIcon
|
||||
@@ -25,30 +50,16 @@ export const HeaderMenu = () => {
|
||||
name="dots-vertical"
|
||||
size={SIZE.xl}
|
||||
color={colors.pri}
|
||||
customStyle={{
|
||||
justifyContent: 'center',
|
||||
alignItems: 'flex-end',
|
||||
height: 40,
|
||||
width: 40,
|
||||
marginLeft: 10,
|
||||
borderRadius: 100,
|
||||
backgroundColor: colors.bg,
|
||||
}}
|
||||
customStyle={styles.action}
|
||||
/>
|
||||
}>
|
||||
<MenuItem
|
||||
textStyle={{
|
||||
color: colors.icon,
|
||||
fontSize: 12,
|
||||
}}>
|
||||
textStyle={styles.title}>
|
||||
Sort by:
|
||||
</MenuItem>
|
||||
<MenuDivider />
|
||||
<MenuItem
|
||||
textStyle={{
|
||||
fontFamily: WEIGHT.regular,
|
||||
color: colors.pri,
|
||||
}}
|
||||
|
||||
textStyle={styles.text}
|
||||
onPress={() => {
|
||||
dispatch({type: Actions.NOTES, sort: null});
|
||||
menuRef.current?.hide();
|
||||
@@ -56,10 +67,8 @@ export const HeaderMenu = () => {
|
||||
Default
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
textStyle={{
|
||||
fontFamily: WEIGHT.regular,
|
||||
color: colors.pri,
|
||||
}}
|
||||
textStyle={styles.text}
|
||||
|
||||
onPress={() => {
|
||||
dispatch({type: Actions.NOTES, sort: 'abc'});
|
||||
menuRef.current?.hide();
|
||||
@@ -67,10 +76,7 @@ export const HeaderMenu = () => {
|
||||
Alphabetical
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
textStyle={{
|
||||
fontFamily: WEIGHT.regular,
|
||||
color: colors.pri,
|
||||
}}
|
||||
textStyle={styles.text}
|
||||
onPress={() => {
|
||||
dispatch({type: Actions.NOTES, sort: 'year'});
|
||||
menuRef.current?.hide();
|
||||
@@ -78,10 +84,7 @@ export const HeaderMenu = () => {
|
||||
By year
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
textStyle={{
|
||||
fontFamily: WEIGHT.regular,
|
||||
color: colors.pri,
|
||||
}}
|
||||
textStyle={styles.text}
|
||||
onPress={() => {
|
||||
dispatch({type: Actions.NOTES, sort: 'month'});
|
||||
menuRef.current?.hide();
|
||||
@@ -89,10 +92,7 @@ export const HeaderMenu = () => {
|
||||
By month
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
textStyle={{
|
||||
fontFamily: WEIGHT.regular,
|
||||
color: colors.pri,
|
||||
}}
|
||||
textStyle={styles.text}
|
||||
onPress={() => {
|
||||
dispatch({type: Actions.NOTES, sort: 'week'});
|
||||
menuRef.current?.hide();
|
||||
|
||||
@@ -75,7 +75,7 @@ export const NotebookItem = ({
|
||||
paddingVertical: item.description ? 0 : 5,
|
||||
}}>
|
||||
{item && item.topics ? (
|
||||
item.topics.slice(1, 4).map((topic) => (
|
||||
item.topics.slice(1, 3).map((topic) => (
|
||||
<TouchableOpacity
|
||||
onPress={() => {
|
||||
NavigationService.navigate('Notes', {
|
||||
|
||||
@@ -33,7 +33,7 @@ let tapCount = 0;
|
||||
const Editor = ({noMenu}) => {
|
||||
// Global State
|
||||
const [state,] = useTracked();
|
||||
const {colors, premium} = state;
|
||||
const {colors, premiumUser} = state;
|
||||
const [fullscreen, setFullscreen] = useState(false);
|
||||
|
||||
// FUNCTIONS
|
||||
@@ -105,7 +105,7 @@ const Editor = ({noMenu}) => {
|
||||
|
||||
useEffect(() => {
|
||||
EditorWebView.current?.reload();
|
||||
}, [premium]);
|
||||
}, [premiumUser]);
|
||||
|
||||
const _onHardwareBackPress = async () => {
|
||||
if (editing.currentlyEditing) {
|
||||
@@ -287,7 +287,7 @@ const Editor = ({noMenu}) => {
|
||||
testID="editor"
|
||||
ref={EditorWebView}
|
||||
onError={(error) => console.log(error)}
|
||||
onLoad={async () => await onWebViewLoad(noMenu, premium, colors)}
|
||||
onLoad={async () => await onWebViewLoad(noMenu, premiumUser, colors)}
|
||||
javaScriptEnabled={true}
|
||||
injectedJavaScript={Platform.OS === 'ios' ? injectedJS : null}
|
||||
onShouldStartLoadWithRequest={_onShouldStartLoadWithRequest}
|
||||
|
||||
Reference in New Issue
Block a user