From 51ead907c02dadaf716a70263354918d250a664a Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Sun, 24 Jan 2021 17:23:05 +0100 Subject: [PATCH] add mobile check for front page project link. --- svelte-ui/src/components/ProjectEntry.svelte | 7 +++++-- svelte-ui/src/utils/phone-check.ts | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 svelte-ui/src/utils/phone-check.ts diff --git a/svelte-ui/src/components/ProjectEntry.svelte b/svelte-ui/src/components/ProjectEntry.svelte index ae5c348..21c1f87 100644 --- a/svelte-ui/src/components/ProjectEntry.svelte +++ b/svelte-ui/src/components/ProjectEntry.svelte @@ -2,6 +2,7 @@ import type { ProjectResult } from "../models/project"; import type { TaskResult } from "../models/task"; import type { ModalData } from "../stores/modal"; +import IS_MOBILE from "../utils/phone-check"; import Option from "./Option.svelte"; import OptionRow from "./OptionRow.svelte"; import ParentEntry from "./ParentEntry.svelte"; @@ -19,7 +20,7 @@ let mdAddTask: ModalData; let mdProjectEdit: ModalData; let mdProjectDelete: ModalData; - + let linkTarget: string = ""; let activeTasks: TaskResult[] = []; let inactiveTasks: TaskResult[] = []; let todoTasks: TaskResult[] = []; @@ -43,13 +44,15 @@ nonHiddenTasks = [...activeTasks, ...todoTasks, ...onholdTasks]; } + + $: linkTarget = IS_MOBILE ? `/questlog#${project.id}` : `/projects#${project.id}`