Skip to content

Commit

Permalink
[ES-1991] [ES-2026] remove eye icon & language dropdown (#477)
Browse files Browse the repository at this point in the history
* [ES-1991] remove extra eye icon for edge

Signed-off-by: Zeeshan Mehboob <[email protected]>

* [ES-2026] remove language dropdown for ekyc video verification flow only

Signed-off-by: Zeeshan Mehboob <[email protected]>

---------

Signed-off-by: Zeeshan Mehboob <[email protected]>
  • Loading branch information
zesu22 authored Dec 17, 2024
1 parent f6965cb commit 1543f69
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 50 deletions.
5 changes: 5 additions & 0 deletions signup-ui/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ body {
@apply text-center text-2xl font-semibold;
}

input[type='password']::-ms-reveal,
input[type='password']::-ms-clear {
display: none;
}

@layer base {
:root {
--font-inter: "Inter";
Expand Down
113 changes: 63 additions & 50 deletions signup-ui/src/components/language.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { useCallback, useEffect, useRef } from "react";
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
import { useTranslation } from "react-i18next";
import { useLocation } from "react-router-dom";

import { ReactComponent as TranslationIcon } from "~assets/svg/translation-icon.svg";
import { EKYC_VERIFICATION } from "~constants/routes";
import { cn } from "~utils/cn";
import { replaceUILocales } from "~utils/link";
import {
Expand All @@ -14,6 +16,7 @@ import {
import { Icons } from "./ui/icons";

export const Language = () => {
const { pathname } = useLocation();
const { i18n } = useTranslation();
const langRef = useRef(null);
const { languages_2Letters, langFontMapping } = useLanguageStore(
Expand Down Expand Up @@ -67,57 +70,67 @@ export const Language = () => {
return (
<div className="flex">
<TranslationIcon className="mr-2 h-9 w-9" />
<DropdownMenu.Root>
<DropdownMenu.Trigger id="language-select-button" asChild>
<span
className="inline-flex items-center justify-center bg-white outline-none hover:cursor-pointer"
aria-label="Customise options"
>
{
languages_2Letters[
i18n.language as keyof typeof languages_2Letters
]
}
<Icons.chevronDown className="ml-1 h-4 w-4" />
</span>
</DropdownMenu.Trigger>
<DropdownMenu.Portal>
<DropdownMenu.Content
className={cn(
"relative z-50 rounded-md border border-[#BCBCBC] bg-white px-3 py-2 shadow-md outline-0 ",
"data-[side=top]:animate-slideDownAndFade data-[side=right]:animate-slideLeftAndFade data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade",
"top-[-0.5rem] min-w-[220px] will-change-[opacity,transform]"
)}
sideOffset={5}
>
{Object.entries(languages_2Letters).map(([key, value]) => (
<DropdownMenu.Item
id={key + "_language"}
key={key}
ref={langRef}
className={cn(
"group relative flex cursor-pointer select-none items-center py-2 text-[14px] leading-none outline-none first:border-b-[1px] hover:font-bold data-[disabled]:pointer-events-none",
langFontMapping[key],
{
"font-bold": i18n.language === key,
}
)}
onSelect={() => handleLanguageChange(key)}
>
{value}
<div className="ml-auto">
{i18n.language === key && (
<Icons.check className="h-4 w-4 text-primary" />
{pathname === EKYC_VERIFICATION && (
<span
className="inline-flex items-center justify-center bg-white text-[14px] outline-none"
aria-label="Customise options"
>
{languages_2Letters[i18n.language as keyof typeof languages_2Letters]}
</span>
)}
{pathname !== EKYC_VERIFICATION && (
<DropdownMenu.Root>
<DropdownMenu.Trigger id="language-select-button" asChild>
<span
className="inline-flex items-center justify-center bg-white text-[14px] outline-none hover:cursor-pointer"
aria-label="Customise options"
>
{
languages_2Letters[
i18n.language as keyof typeof languages_2Letters
]
}
<Icons.chevronDown className="ml-1 h-4 w-4" />
</span>
</DropdownMenu.Trigger>
<DropdownMenu.Portal>
<DropdownMenu.Content
className={cn(
"relative z-50 rounded-md border border-[#BCBCBC] bg-white px-3 py-2 shadow-md outline-0 ",
"data-[side=top]:animate-slideDownAndFade data-[side=right]:animate-slideLeftAndFade data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade",
"top-[-0.5rem] min-w-[220px] will-change-[opacity,transform]"
)}
sideOffset={5}
>
{Object.entries(languages_2Letters).map(([key, value]) => (
<DropdownMenu.Item
id={key + "_language"}
key={key}
ref={langRef}
className={cn(
"group relative flex cursor-pointer select-none items-center py-2 text-[14px] leading-none outline-none first:border-b-[1px] hover:font-bold data-[disabled]:pointer-events-none",
langFontMapping ? langFontMapping[key] : "",
{
"font-bold": i18n.language === key,
}
)}
</div>
</DropdownMenu.Item>
))}
<DropdownMenu.Arrow asChild>
<Icons.chevronUpSolid className="h-[7px] stroke-[#bcbcbc]" />
</DropdownMenu.Arrow>
</DropdownMenu.Content>
</DropdownMenu.Portal>
</DropdownMenu.Root>
onSelect={() => handleLanguageChange(key)}
>
{value}
<div className="ml-auto">
{i18n.language === key && (
<Icons.check className="h-4 w-4 text-primary" />
)}
</div>
</DropdownMenu.Item>
))}
<DropdownMenu.Arrow asChild>
<Icons.chevronUpSolid className="h-[7px] stroke-[#bcbcbc]" />
</DropdownMenu.Arrow>
</DropdownMenu.Content>
</DropdownMenu.Portal>
</DropdownMenu.Root>
)}
</div>
);
};

0 comments on commit 1543f69

Please sign in to comment.