hotfix: mobile create button
This commit is contained in:
@@ -3,6 +3,7 @@ import Task from "@/components/task";
|
||||
import ModalCalendar from "@/components/ModalCalendar";
|
||||
import ModalTags, { ITags } from "@/components/ModalTags";
|
||||
import Button from "@/components/ui/Button";
|
||||
import Dialog from "@/components/ui/Dialog";
|
||||
import ModalWindow from "@/components/ui/Modal";
|
||||
import { withTitle } from "@/constructors/Component";
|
||||
import { UrlsTitle } from "@/enums/urls";
|
||||
@@ -26,7 +27,6 @@ import { SubmitHandler, useForm } from "react-hook-form";
|
||||
import { v4 as uuid } from "uuid";
|
||||
import { ITask, ITaskForm } from "./profile_tasks.dto";
|
||||
import classes from "./profile_tasks.module.scss";
|
||||
import Dialog from "@/components/ui/Dialog";
|
||||
|
||||
const example_tags: { first: string[]; second: string[] } = {
|
||||
first: ["Программирование", "Информатика", "Физика", "Математика"],
|
||||
@@ -117,29 +117,27 @@ const ProfileTasks: FunctionComponent = () => {
|
||||
const groupTasksByDate = useMemo(() => {
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
|
||||
|
||||
const tomorrow = new Date(today);
|
||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||
|
||||
|
||||
const groupedTasks = {
|
||||
today: [] as ITask[],
|
||||
tomorrow: [] as ITask[],
|
||||
future: [] as { date: Date; tasks: ITask[] }[],
|
||||
};
|
||||
|
||||
tasks.forEach(task => {
|
||||
tasks.forEach((task) => {
|
||||
const taskDate = new Date(task.date);
|
||||
taskDate.setHours(0, 0, 0, 0);
|
||||
|
||||
|
||||
if (taskDate.getTime() === today.getTime()) {
|
||||
groupedTasks.today.push(task);
|
||||
} else if (taskDate.getTime() === tomorrow.getTime()) {
|
||||
groupedTasks.tomorrow.push(task);
|
||||
} else if (taskDate > tomorrow) {
|
||||
const existingGroup = groupedTasks.future.find(group =>
|
||||
group.date.getTime() === taskDate.getTime()
|
||||
);
|
||||
|
||||
const existingGroup = groupedTasks.future.find((group) => group.date.getTime() === taskDate.getTime());
|
||||
|
||||
if (existingGroup) {
|
||||
existingGroup.tasks.push(task);
|
||||
} else {
|
||||
@@ -152,7 +150,7 @@ const ProfileTasks: FunctionComponent = () => {
|
||||
groupedTasks.today.sort((a, b) => a.date.getTime() - b.date.getTime());
|
||||
groupedTasks.tomorrow.sort((a, b) => a.date.getTime() - b.date.getTime());
|
||||
groupedTasks.future.sort((a, b) => a.date.getTime() - b.date.getTime());
|
||||
groupedTasks.future.forEach(group => {
|
||||
groupedTasks.future.forEach((group) => {
|
||||
group.tasks.sort((a, b) => a.date.getTime() - b.date.getTime());
|
||||
});
|
||||
|
||||
@@ -163,7 +161,7 @@ const ProfileTasks: FunctionComponent = () => {
|
||||
return new Intl.DateTimeFormat("ru-RU", {
|
||||
day: "numeric",
|
||||
month: "long",
|
||||
year: "numeric"
|
||||
year: "numeric",
|
||||
}).format(date);
|
||||
};
|
||||
|
||||
@@ -483,7 +481,7 @@ const ProfileTasks: FunctionComponent = () => {
|
||||
) : (
|
||||
<>
|
||||
<div class="flex w-full flex-1 flex-col items-center justify-center text-2xl">Начни уже сегодня!</div>
|
||||
<div class="fixed right-[22rem] bottom-4 hidden flex-row items-center justify-start overflow-x-hidden py-2 md:flex">
|
||||
<div class="group fixed right-1 bottom-16 flex flex-row items-center justify-start space-x-3 overflow-x-hidden py-2 md:right-[22rem] md:bottom-4">
|
||||
<div
|
||||
class="flex aspect-square h-20 cursor-pointer items-center justify-center rounded-full bg-[rgb(251,194,199,0.53)] text-9xl text-white shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25)] transition-all duration-300 ease-out hover:bg-[rgb(251,194,199,0.7)]"
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user