Skip to content

Commit

Permalink
fix: font options alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoGottardi committed Jul 24, 2024
1 parent 169f762 commit 7eab2fa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
16 changes: 7 additions & 9 deletions src/views/app/detail-panel/edit/parts/text-editor-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,17 @@ export const TextEditorContainer: FC<TextEditorContainerProps> = ({
);

const { prefs } = useUserSettings();

// TODO: DEFINE WHAT TO DO WITHT THOSE VALUES FALLBACKS
const fontSizesOptions = getFontSizesOptions();
const fontFamilyOptions = getFonts();
const defaultFontFamily: string =
prefs?.zimbraPrefHtmlEditorDefaultFontFamily ?? fontFamilyOptions[0];
const defaultFontSize: string = prefs?.zimbraPrefHtmlEditorDefaultFontSize ?? fontSizesOptions[0];
const defaultColor: string = prefs?.zimbraPrefHtmlEditorDefaultFontColor ?? 'black';

const defaultFontFamily = prefs?.zimbraPrefHtmlEditorDefaultFontFamily;
const defaultFontSize = prefs?.zimbraPrefHtmlEditorDefaultFontSize;
const defaultColor = prefs?.zimbraPrefHtmlEditorDefaultFontColor;

const fontSizesOptionsToString = fontSizesOptions.map((fontSize: string) => fontSize).join(' ');
const fontsOptionsToString = fontFamilyOptions
.map((font: { value: string }) => font.value)
.join('; ');
const fontsOptionsToString = fontFamilyOptions.map(
(font: { label: string; value: string }) => `${font.label}=${font.value};`
);

const composerCustomOptions = {
toolbar_sticky: true,
Expand Down
34 changes: 17 additions & 17 deletions src/views/settings/components/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,71 +259,71 @@ export const getFontSizesOptions = () => [
export const getFonts = () => [
{
label: 'Andale Mono',
value: 'andale mono,times;'
value: 'andale mono, times'
},
{
label: 'Arial',
value: 'arial,helvetica,sans-serif;'
value: 'arial, helvetica, sans-serif'
},
{
label: 'Arial Black',
value: 'arial black,avant garde;'
value: 'arial black, avant garde'
},
{
label: 'Book Antiqua',
value: 'book antiqua,palatino;'
value: 'book antiqua, palatino'
},
{
label: 'Comic Sans MS',
value: 'comic sans ms,sans-serif;'
value: 'comic sans ms, sans-serif'
},
{
label: 'Courier New',
value: 'courier new,courier;'
value: 'courier new, courier'
},
{
label: 'Georgia',
value: 'georgia,palatino;'
value: 'georgia, palatino'
},
{
label: 'Helvetica',
value: 'helvetica;'
value: 'helvetica'
},
{
label: 'Impact',
value: 'impact,chicago;'
value: 'impact, chicago'
},
{
label: 'Symbol',
value: 'symbol;'
value: 'symbol'
},
{
label: 'Tahoma',
value: 'tahoma,arial,helvetica,sans-serif;'
value: 'tahoma, arial, helvetica, sans-serif'
},
{
label: 'Terminal',
value: 'terminal,monaco;'
value: 'terminal, monaco'
},
{
label: 'Times New Roman',
value: 'times new roman,times;'
value: 'times new roman, times'
},
{
label: 'Trebuchet MS',
value: 'trebuchet ms,geneva;'
value: 'trebuchet ms, geneva'
},
{
label: 'Verdana',
value: 'verdana,geneva;'
value: 'verdana, geneva'
},
{
label: 'Webdings',
value: 'webdings;'
value: 'webdings'
},
{
label: 'Wingdings',
value: 'wingdings,zapf dingbats;'
value: 'wingdings, zapf dingbats'
}
];

Expand Down
2 changes: 0 additions & 2 deletions src/views/settings/compose-msg-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ const ComposeMessage: FC<ComposeMessagesProps> = ({ settingsObj, updateSettings
value
}));

console.log('fontSizesOptionsArray: ', fontSizesOptionsArray);

const onColorChange = useCallback(
(value) => {
setColor(value);
Expand Down

0 comments on commit 7eab2fa

Please sign in to comment.