This commit is contained in:
2025-05-03 00:12:39 +03:00
parent 1a14a5f62c
commit ab1eaeb338
7 changed files with 147 additions and 42 deletions

View File

@@ -414,8 +414,23 @@ export const AppsDesktop = ({
setDesktopViewMode('dev');
}}
>
<IconWrapper label="Dev" disableWidth>
<AppsIcon height={30} />
<IconWrapper
color={
desktopViewMode === 'dev'
? theme.palette.text.primary
: theme.palette.text.secondary
}
label="Dev"
disableWidth
>
<AppsIcon
color={
desktopViewMode === 'dev'
? theme.palette.text.primary
: theme.palette.text.secondary
}
height={30}
/>
</IconWrapper>
</ButtonBase>
)}

View File

@@ -158,6 +158,12 @@ export const QortPayment = ({ balance, show, onSuccess, defaultPaymentTo }) => {
value={paymentPassword}
onChange={(e) => setPaymentPassword(e.target.value)}
autoComplete="off"
onKeyDown={(e) => {
if (e.key === 'Enter') {
if (isLoadingSendCoin) return;
sendCoinFunc();
}
}}
/>
</Box>

View File

@@ -27,15 +27,25 @@ export const ReactionPicker = ({ onReaction }) => {
if (showPicker) {
setShowPicker(false);
} else {
// Get the button's position
const buttonRect = buttonRef.current.getBoundingClientRect();
const pickerWidth = 350;
const pickerHeight = 400; // Match Picker height prop
// Calculate position to align the right edge of the picker with the button's right edge
setPickerPosition({
top: buttonRect.bottom + window.scrollY, // Position below the button
left: buttonRect.right + window.scrollX - pickerWidth, // Align right edges
});
// Initial position (below the button)
let top = buttonRect.bottom + window.scrollY;
let left = buttonRect.right + window.scrollX - pickerWidth;
// If picker would overflow bottom, show it above the button
const overflowBottom =
top + pickerHeight > window.innerHeight + window.scrollY;
if (overflowBottom) {
top = buttonRect.top + window.scrollY - pickerHeight;
}
// Optional: prevent overflow on the left too
if (left < 0) left = 0;
setPickerPosition({ top, left });
setShowPicker(true);
}
};
@@ -92,12 +102,13 @@ export const ReactionPicker = ({ onReaction }) => {
allowExpandReactions={true}
autoFocusSearch={false}
emojiStyle={EmojiStyle.NATIVE}
height="450"
height={400}
onEmojiClick={handlePicker}
onReactionClick={handleReaction}
reactionsDefaultOpen={true}
// reactionsDefaultOpen={true}
// open={true}
theme={Theme.DARK}
width="350"
width={350}
/>
</div>,
document.body

View File

@@ -25,7 +25,7 @@ const ThemeContext = createContext({
toggleTheme: () => {},
userThemes: [defaultTheme],
addUserTheme: (themes) => {},
setUserTheme: (theme) => {},
setUserTheme: (theme, themes) => {},
currentThemeId: 'default',
});
@@ -83,13 +83,13 @@ export const ThemeProvider = ({ children }) => {
saveSettings(themes);
};
const setUserTheme = (theme) => {
const setUserTheme = (theme, themes) => {
if (theme.id === 'default') {
setCurrentThemeId('default');
saveSettings(userThemes, themeMode, 'default');
saveSettings(themes || userThemes, themeMode, 'default');
} else {
setCurrentThemeId(theme.id);
saveSettings(userThemes, themeMode, theme.id);
saveSettings(themes || userThemes, themeMode, theme.id);
}
};

View File

@@ -119,7 +119,7 @@ export default function ThemeManager() {
const newTheme = { ...themeDraft, id: uid.rnd() };
const updatedThemes = [...userThemes, newTheme];
addUserTheme(updatedThemes);
setUserTheme(newTheme);
setUserTheme(newTheme, updatedThemes);
}
setOpenEditor(false);
};
@@ -135,19 +135,22 @@ export default function ThemeManager() {
);
if (defaultTheme) {
setUserTheme(defaultTheme);
setUserTheme(defaultTheme, updatedThemes);
} else {
// Emergency fallback
setUserTheme({
light: lightThemeOptions,
dark: darkThemeOptions,
});
setUserTheme(
{
light: lightThemeOptions,
dark: darkThemeOptions,
},
updatedThemes
);
}
}
};
const handleApplyTheme = (theme) => {
setUserTheme(theme);
setUserTheme(theme, null);
};
const handleColorChange = (mode, fieldPath, color) => {
@@ -210,7 +213,8 @@ export default function ThemeManager() {
const newTheme = { ...importedTheme, id: uid.rnd() };
const updatedThemes = [...userThemes, newTheme];
addUserTheme(updatedThemes);
setUserTheme(newTheme);
setUserTheme(newTheme, updatedThemes);
} catch (error) {
console.error(error);
}