Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros committed Jun 18, 2024
1 parent 46e2650 commit e17c584
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions res/css/views/settings/_ThemeChoicePanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ limitations under the License.
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 var(--cpd-space-2x);

.mx_ThemeChoicePanel_CustomThemeList_name {
font: var(--cpd-font-body-sm-semibold);
Expand Down
6 changes: 3 additions & 3 deletions src/components/views/settings/ThemeChoicePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,13 @@ function ThemeSelectors({ theme, disabled, onChange }: ThemeSelectorProps): JSX.
* Return all the available themes
*/
function useThemes(): Array<ITheme & { isDark: boolean }> {
const customThemes = useSettingValue<CustomThemeType[] | undefined>("custom_themes") || [];
const customThemes = useSettingValue<CustomThemeType[] | undefined>("custom_themes");
return useMemo(() => {
const themes = getOrderedThemes();
// Put the custom theme into a map
// To easily find the theme by name when going through the themes list
const customThemeMap = customThemes.reduce(
const checkedCustomThemes = customThemes || [];
const customThemeMap = checkedCustomThemes.reduce(
(map, theme) => map.set(theme.name, theme),
new Map<string, CustomThemeType>(),
);
Expand Down Expand Up @@ -262,7 +263,6 @@ function CustomTheme(): JSX.Element {
className="mx_ThemeChoicePanel_CustomTheme_EditInPlace"
label={_t("settings|appearance|custom_theme_add")}
saveButtonLabel={_t("settings|appearance|custom_theme_add")}
// TODO
savingLabel={_t("settings|appearance|custom_theme_downloading")}
helpLabel={_t("settings|appearance|custom_theme_help")}
error={error}
Expand Down

0 comments on commit e17c584

Please sign in to comment.