fix: list view time grid on mobile + legacy FA icon prefix
- Mobile quick settings view switcher now correctly toggles showTimeGrid when switching views (list → off, simple/calendar → on), matching the desktop switcher behaviour. This removes the unwanted time column in list view on mobile. - ProjectIcon: normalise legacy icon names stored as "faHeart" / "faHouse" (camelCase with "fa" prefix) to "heart" / "house" so the FA icon lookup succeeds instead of falling through to the text fallback. v1.81.3
This commit is contained in:
parent
bb34e083d5
commit
2586e3ce34
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "my-weekly-todo-list",
|
||||
"version": "1.81.2",
|
||||
"version": "1.81.3",
|
||||
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@ -5410,7 +5410,7 @@ export default function WeeklyView() {
|
||||
{ key: "list", icon: <ListTodo size={13} /> },
|
||||
{ key: "kanban", icon: <Kanban size={13} /> },
|
||||
].map((v) => (
|
||||
<button key={v.key} onClick={() => { setViewStyle(v.key as any); saveSetting("viewStyle", v.key); }}
|
||||
<button key={v.key} onClick={() => { setViewStyle(v.key as any); saveSetting("viewStyle", v.key); if (v.key === "list") { setShowTimeGrid(false); saveSetting("showTimeGrid", false); } if (v.key === "simple" || v.key === "calendar") { setShowTimeGrid(true); saveSetting("showTimeGrid", true); } }}
|
||||
style={{ flex: 1, padding: "5px 0", borderRadius: "6px", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", fontWeight: profile.viewStyle ===v.key ? 700 : 400, background: profile.viewStyle ===v.key ? "#0ea5e9" : (darkMode ? "#1f2937" : "#e5e7eb"), color: profile.viewStyle ===v.key ? "#fff" : (darkMode ? "#9ca3af" : "#6b7280") }}>
|
||||
{v.icon}
|
||||
</button>
|
||||
@ -10077,8 +10077,12 @@ const projectIconsGlobal: { name: string; icon: IconDefinition }[] = [
|
||||
// Helper to render a project icon (FA name, MDI name, or legacy emoji)
|
||||
function ProjectIcon({ icon, size = 18, color }: { icon?: string | null; size?: number; color?: string }) {
|
||||
if (!icon) return <FontAwesomeIcon icon={faFolder} style={{ fontSize: size, color }} />;
|
||||
// Normalise legacy "faHeart" → "heart" prefix style
|
||||
const normalised = icon.startsWith("fa") && icon.length > 2 && icon[2] === icon[2].toUpperCase()
|
||||
? icon.slice(2, 3).toLowerCase() + icon.slice(3)
|
||||
: icon;
|
||||
// Check unified icon registry (FA + MDI)
|
||||
const found = allIcons.find((i) => i.name === icon);
|
||||
const found = allIcons.find((i) => i.name === normalised || i.name === icon);
|
||||
if (found) {
|
||||
if (found.type === "fa") {
|
||||
return <FontAwesomeIcon icon={found.icon as import("@fortawesome/free-solid-svg-icons").IconDefinition} style={{ fontSize: size, color }} />;
|
||||
@ -10086,7 +10090,7 @@ function ProjectIcon({ icon, size = 18, color }: { icon?: string | null; size?:
|
||||
return <MdiIcon path={found.icon as string} size={size / 24} color={color} />;
|
||||
}
|
||||
// Legacy: check old projectIconsGlobal for backwards compat
|
||||
const legacy = projectIconsGlobal.find((i) => i.name === icon);
|
||||
const legacy = projectIconsGlobal.find((i) => i.name === normalised || i.name === icon);
|
||||
if (legacy) return <FontAwesomeIcon icon={legacy.icon} style={{ fontSize: size, color }} />;
|
||||
// Legacy emoji fallback
|
||||
return <span style={{ fontSize: size, lineHeight: 1 }}>{icon}</span>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user