[WEB-4546] chore: home update #7456

This commit is contained in:
Akshita Goyal
2025-07-23 10:11:18 +05:30
committed by GitHub
parent 763a28ab60
commit 9007ec3709
4 changed files with 18 additions and 12 deletions

View File

@@ -46,7 +46,7 @@ export const WorkspaceDashboardHeader = observer(() => {
className="my-auto mb-0"
>
<Shapes size={16} />
<div className="text-xs font-medium">{t("home.manage_widgets")}</div>
<div className="hidden text-xs font-medium sm:hidden md:block">{t("home.manage_widgets")}</div>
</Button>
<a
onClick={() =>

View File

@@ -60,7 +60,9 @@ export const WorkspaceHomeView = observer(() => {
)}
<>
<HomePeekOverviewsRoot />
<ContentWrapper className={cn("gap-6 bg-custom-background-100 max-w-[750px] mx-auto scrollbar-hide")}>
<ContentWrapper
className={cn("gap-6 bg-custom-background-100 max-w-[800px] mx-auto scrollbar-hide px-page-x lg:px-0")}
>
{currentUser && <UserGreetingsView user={currentUser} />}
<DashboardWidgets />
</ContentWrapper>

View File

@@ -42,15 +42,15 @@ export const UserGreetingsView: FC<IUserGreetingsView> = (props) => {
return (
<div className="flex flex-col items-center my-6">
<h3 className="text-xl font-semibold text-center">
<h2 className="text-xl font-semibold text-center">
{t("good")} {t(greeting)}, {user?.first_name} {user?.last_name}
</h3>
<h6 className="flex items-center gap-2 font-medium text-custom-text-400">
</h2>
<h5 className="flex items-center gap-2 font-medium text-custom-text-400">
<div>{greeting === "morning" ? "🌤️" : greeting === "afternoon" ? "🌥️" : "🌙️"}</div>
<div>
{weekDay}, {date} {timeString}
</div>
</h6>
</h5>
</div>
);
};

View File

@@ -1,4 +1,6 @@
import { FC } from "react";
// plane types
import { useTranslation } from "@plane/i18n";
// hooks
import { IUser } from "@plane/types";
import { useCurrentTime } from "@/hooks/use-current-time";
@@ -12,6 +14,8 @@ export const UserGreetingsView: FC<IUserGreetingsView> = (props) => {
const { user } = props;
// current time hook
const { currentTime } = useCurrentTime();
// store hooks
const { t } = useTranslation();
const hour = new Intl.DateTimeFormat("en-US", {
hour12: false,
@@ -37,16 +41,16 @@ export const UserGreetingsView: FC<IUserGreetingsView> = (props) => {
const greeting = parseInt(hour, 10) < 12 ? "morning" : parseInt(hour, 10) < 18 ? "afternoon" : "evening";
return (
<div>
<h3 className="text-xl font-semibold">
Good {greeting}, {user?.first_name} {user?.last_name}
</h3>
<h6 className="flex items-center gap-2 font-medium text-custom-text-400">
<div className="flex flex-col items-center my-6">
<h2 className="text-xl font-semibold text-center">
{t("good")} {t(greeting)}, {user?.first_name} {user?.last_name}
</h2>
<h5 className="flex items-center gap-2 font-medium text-custom-text-400">
<div>{greeting === "morning" ? "🌤️" : greeting === "afternoon" ? "🌥️" : "🌙️"}</div>
<div>
{weekDay}, {date} {timeString}
</div>
</h6>
</h5>
</div>
);
};