chore: tweak calendar styles
This commit is contained in:
parent
ef3b7ac6ae
commit
0334a4845f
2 changed files with 11 additions and 9 deletions
|
|
@ -18,13 +18,15 @@ const getCellAdditionalStyles = (count: number, maxCount: number) => {
|
||||||
if (count === 0) {
|
if (count === 0) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
if (count >= 3) {
|
||||||
const ratio = count / maxCount;
|
const ratio = count / maxCount;
|
||||||
if (ratio > 0.7) {
|
if (ratio > 0.7) {
|
||||||
return "bg-primary-darker text-gray-100 dark:opacity-80";
|
return "bg-primary-darker/80 text-gray-100 dark:opacity-80";
|
||||||
} else if (ratio > 0.4) {
|
} else if (ratio > 0.4) {
|
||||||
return "bg-primary-dark text-gray-100 dark:opacity-80";
|
return "bg-primary/80 text-gray-100 dark:opacity-80";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return "bg-primary text-gray-100 dark:opacity-70";
|
return "bg-primary/70 text-gray-100 dark:opacity-70";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -88,7 +90,7 @@ const ActivityCalendar = (props: Props) => {
|
||||||
<Tooltip className="shrink-0" key={`${date}-${index}`} title={tooltipText} placement="top" arrow>
|
<Tooltip className="shrink-0" key={`${date}-${index}`} title={tooltipText} placement="top" arrow>
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"w-6 h-6 text-xs rounded-xl flex justify-center items-center border cursor-default",
|
"w-6 h-6 text-xs rounded-lg flex justify-center items-center border cursor-default",
|
||||||
"text-gray-400",
|
"text-gray-400",
|
||||||
item.isCurrentMonth ? getCellAdditionalStyles(count, maxCount) : "opacity-60",
|
item.isCurrentMonth ? getCellAdditionalStyles(count, maxCount) : "opacity-60",
|
||||||
item.isCurrentMonth && isToday && "border-zinc-400",
|
item.isCurrentMonth && isToday && "border-zinc-400",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { isEqual } from "lodash-es";
|
import { isEqual } from "lodash-es";
|
||||||
import { CalendarIcon, CheckCircleIcon, CodeIcon, EyeIcon, FilterIcon, LinkIcon, SearchIcon, TagIcon, XIcon } from "lucide-react";
|
import { CalendarIcon, CheckCircleIcon, CodeIcon, EyeIcon, FilterIcon, HashIcon, LinkIcon, SearchIcon, XIcon } from "lucide-react";
|
||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
import { useSearchParams } from "react-router-dom";
|
import { useSearchParams } from "react-router-dom";
|
||||||
import { FilterFactor, getMemoFilterKey, MemoFilter, parseFilterQuery, stringifyFilters, useMemoFilterStore } from "@/store/v1";
|
import { FilterFactor, getMemoFilterKey, MemoFilter, parseFilterQuery, stringifyFilters, useMemoFilterStore } from "@/store/v1";
|
||||||
|
|
@ -100,7 +100,7 @@ const MemoFilters = () => {
|
||||||
|
|
||||||
const FactorIcon = ({ factor, className }: { factor: FilterFactor; className?: string }) => {
|
const FactorIcon = ({ factor, className }: { factor: FilterFactor; className?: string }) => {
|
||||||
const iconMap = {
|
const iconMap = {
|
||||||
tagSearch: <TagIcon className={className} />,
|
tagSearch: <HashIcon className={className} />,
|
||||||
visibility: <EyeIcon className={className} />,
|
visibility: <EyeIcon className={className} />,
|
||||||
contentSearch: <SearchIcon className={className} />,
|
contentSearch: <SearchIcon className={className} />,
|
||||||
displayTime: <CalendarIcon className={className} />,
|
displayTime: <CalendarIcon className={className} />,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue