From 864e592bc5ba4bd8296fae4919afcef6e1c02fc6 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Thu, 13 Jul 2023 16:51:08 +0530 Subject: [PATCH] fix: onboarding screen design issues (#1517) * fix: projects empty state flicker * fix: tour images padding * chore: add greeting icon on the dashboard * chore: update email id font weight * fix: placeholder color --- apps/app/components/onboarding/invite-members.tsx | 2 +- apps/app/components/onboarding/tour/root.tsx | 9 +++++++-- apps/app/components/onboarding/user-details.tsx | 2 +- apps/app/components/ui/input/index.tsx | 2 +- apps/app/components/ui/text-area/index.tsx | 2 +- apps/app/helpers/array.helper.ts | 4 ++-- apps/app/hooks/use-projects.tsx | 4 +++- apps/app/pages/[workspaceSlug]/index.tsx | 1 + apps/app/pages/onboarding.tsx | 2 +- apps/app/styles/editor.css | 2 +- 10 files changed, 19 insertions(+), 11 deletions(-) diff --git a/apps/app/components/onboarding/invite-members.tsx b/apps/app/components/onboarding/invite-members.tsx index 99a7021ab..fa58cf64f 100644 --- a/apps/app/components/onboarding/invite-members.tsx +++ b/apps/app/components/onboarding/invite-members.tsx @@ -200,7 +200,7 @@ export const InviteMembers: React.FC = ({ workspace, user, stepChange }) onClick={appendField} > - Add more + Add another
diff --git a/apps/app/components/onboarding/tour/root.tsx b/apps/app/components/onboarding/tour/root.tsx index 30ce2c578..30a720f8f 100644 --- a/apps/app/components/onboarding/tour/root.tsx +++ b/apps/app/components/onboarding/tour/root.tsx @@ -82,7 +82,8 @@ export const TourRoot: React.FC = ({ onComplete }) => { const { user } = useUser(); - const currentStep = TOUR_STEPS.find((tourStep) => tourStep.key === step); + const currentStepIndex = TOUR_STEPS.findIndex((tourStep) => tourStep.key === step); + const currentStep = TOUR_STEPS[currentStepIndex]; return ( <> @@ -124,7 +125,11 @@ export const TourRoot: React.FC = ({ onComplete }) => {
-
+
{currentStep?.title}
diff --git a/apps/app/components/onboarding/user-details.tsx b/apps/app/components/onboarding/user-details.tsx index 7d43ab9e0..42ee00cd5 100644 --- a/apps/app/components/onboarding/user-details.tsx +++ b/apps/app/components/onboarding/user-details.tsx @@ -144,7 +144,7 @@ export const UserDetails: React.FC = ({ user }) => { value ? ( value.toString() ) : ( - Select your role... + Select your role... ) } input diff --git a/apps/app/components/ui/input/index.tsx b/apps/app/components/ui/input/index.tsx index 06668b3e7..17dfa639b 100644 --- a/apps/app/components/ui/input/index.tsx +++ b/apps/app/components/ui/input/index.tsx @@ -34,7 +34,7 @@ export const Input: React.FC = ({ register && register(name).onChange(e); onChange && onChange(e); }} - className={`block rounded-md bg-transparent text-sm focus:outline-none ${ + className={`block rounded-md bg-transparent text-sm focus:outline-none placeholder-custom-text-400 ${ mode === "primary" ? "rounded-md border border-custom-border-100" : mode === "transparent" diff --git a/apps/app/components/ui/text-area/index.tsx b/apps/app/components/ui/text-area/index.tsx index b4c242259..05f8640fd 100644 --- a/apps/app/components/ui/text-area/index.tsx +++ b/apps/app/components/ui/text-area/index.tsx @@ -66,7 +66,7 @@ export const TextArea: React.FC = ({ onChange && onChange(e); setTextareaValue(e.target.value); }} - className={`no-scrollbar w-full bg-transparent ${ + className={`no-scrollbar w-full bg-transparent placeholder-custom-text-400 ${ noPadding ? "" : "px-3 py-2" } outline-none ${ mode === "primary" diff --git a/apps/app/helpers/array.helper.ts b/apps/app/helpers/array.helper.ts index f8134b440..bcadbe3c8 100644 --- a/apps/app/helpers/array.helper.ts +++ b/apps/app/helpers/array.helper.ts @@ -12,9 +12,9 @@ export const orderArrayBy = ( key: string, ordering: "ascending" | "descending" = "ascending" ) => { - const array = [...orgArray]; + if (!orgArray || !Array.isArray(orgArray) || orgArray.length === 0) return []; - if (!array || !Array.isArray(array) || array.length === 0) return []; + const array = [...orgArray]; if (key[0] === "-") { ordering = "descending"; diff --git a/apps/app/hooks/use-projects.tsx b/apps/app/hooks/use-projects.tsx index f7c9f235c..3fc93cdb2 100644 --- a/apps/app/hooks/use-projects.tsx +++ b/apps/app/hooks/use-projects.tsx @@ -26,7 +26,9 @@ const useProjects = () => { ?.slice(0, 3); return { - projects: orderArrayBy(projects ?? [], "is_favorite", "descending") as IProject[] | undefined, + projects: projects + ? (orderArrayBy(projects, "is_favorite", "descending") as IProject[]) + : undefined, recentProjects: recentProjects || [], mutateProjects, }; diff --git a/apps/app/pages/[workspaceSlug]/index.tsx b/apps/app/pages/[workspaceSlug]/index.tsx index 9f7b8589c..e53e310e6 100644 --- a/apps/app/pages/[workspaceSlug]/index.tsx +++ b/apps/app/pages/[workspaceSlug]/index.tsx @@ -133,6 +133,7 @@ const WorkspacePage: NextPage = () => { Good {greeting}, {user?.first_name} {user?.last_name}
+ {greeting === "morning" ? "🌤️" : greeting === "afternoon" ? "🌥️" : "🌙️"} {DAYS[today.getDay()]}, {renderShortDate(today)} {render12HourFormatTime(today)}
diff --git a/apps/app/pages/onboarding.tsx b/apps/app/pages/onboarding.tsx index e9373fc10..57b121648 100644 --- a/apps/app/pages/onboarding.tsx +++ b/apps/app/pages/onboarding.tsx @@ -158,7 +158,7 @@ const Onboarding: NextPage = () => {
)} -
+
{user?.email}
diff --git a/apps/app/styles/editor.css b/apps/app/styles/editor.css index 41169e968..ea4b2e601 100644 --- a/apps/app/styles/editor.css +++ b/apps/app/styles/editor.css @@ -1,6 +1,6 @@ .empty-node::after { content: attr(data-placeholder); - color: #9ca3af; + color: rgb(var(--color-text-400)); position: absolute; pointer-events: none;