Skip to content

Commit

Permalink
Update toolbar styles to align with feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator committed Dec 10, 2024
1 parent 279a8a6 commit 1576ca0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
25 changes: 4 additions & 21 deletions packages/app-mobile/components/EditorToolbar/ButtonGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as React from 'react';
import { ToolbarButtonInfo } from '@joplin/lib/services/commands/ToolbarButtonUtils';
import { useMemo } from 'react';
import { StyleSheet, View } from 'react-native';
import { themeStyle } from '../global-style';
import { View, ViewStyle } from 'react-native';
import ToolbarButton from './ToolbarButton';
import isSelected from './utils/isSelected';
import { EditorState } from './types';
Expand All @@ -13,26 +11,11 @@ interface Props {
editorState: EditorState;
}

const useStyles = (themeId: number) => {
return useMemo(() => {
const theme = themeStyle(themeId);
return StyleSheet.create({
container: {
backgroundColor: theme.backgroundColor,
borderRadius: 10,
borderWidth: 1,
borderColor: theme.color3,
overflow: 'hidden',
flexDirection: 'row',
marginHorizontal: 4,
},
});
}, [themeId]);
const containerStyle: ViewStyle = {
flexDirection: 'row',
};

const ButtonGroup: React.FC<Props> = props => {
const styles = useStyles(props.themeId);

const renderButton = (info: ToolbarButtonInfo) => {
return <ToolbarButton
key={`command-${info.name}`}
Expand All @@ -42,7 +25,7 @@ const ButtonGroup: React.FC<Props> = props => {
/>;
};

return <View style={styles.container}>
return <View style={containerStyle}>
{props.buttonInfos.map(renderButton)}
</View>;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const useStyles = (themeId: number) => {
backgroundColor: theme.backgroundColor3,
},
contentContainer: {
paddingVertical: 4,
paddingVertical: 0,
flexDirection: 'row',
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const useStyles = (themeId: number, selected: boolean, enabled: boolean) => {
fontSize: 22,
},
button: {
backgroundColor: selected ? theme.backgroundColorHover3 : theme.backgroundColor,
backgroundColor: selected ? theme.backgroundColorHover3 : theme.backgroundColor3,
width: 48,
height: 48,
justifyContent: 'center',
Expand Down

0 comments on commit 1576ca0

Please sign in to comment.