Skip to content

Commit

Permalink
fix some minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
lendihop committed Nov 28, 2024
1 parent 4270b7d commit 665bfee
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/atoms/FormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ const ErrorCaption: React.FC<ErrorCaptionProps> = ({ errorCaption }) => {
const isPasswordStrengthIndicator = errorCaption === PASSWORD_ERROR_CAPTION;

return errorCaption && !isPasswordStrengthIndicator ? (
<div className="pl-1 text-xs text-red-500" {...setTestID(ErrorCaptionSelectors.inputError)}>
<div className="pl-1 text-font-description text-error" {...setTestID(ErrorCaptionSelectors.inputError)}>
{errorCaption}
</div>
) : null;
Expand Down
14 changes: 10 additions & 4 deletions src/app/layouts/PageLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface PageLayoutProps extends DefaultHeaderProps, ScrollEdgesVisibili
Header?: ComponentType;
noScroll?: boolean;
contentPadding?: boolean;
showTestnetModeIndicator?: boolean;
contentClassName?: string;
paperClassName?: string;
headerChildren?: ReactNode;
Expand All @@ -56,6 +57,7 @@ const PageLayout: FC<PropsWithChildren<PageLayoutProps>> = ({
children,
noScroll = false,
contentPadding = true,
showTestnetModeIndicator = true,
contentClassName,
paperClassName,
headerChildren,
Expand Down Expand Up @@ -86,6 +88,7 @@ const PageLayout: FC<PropsWithChildren<PageLayoutProps>> = ({
bottomEdgeThreshold={bottomEdgeThreshold}
onTopEdgeVisibilityChange={onTopEdgeVisibilityChange}
topEdgeThreshold={topEdgeThreshold}
showTestnetModeIndicator={showTestnetModeIndicator}
>
{Header ? <Header /> : <DefaultHeader {...headerProps}>{headerChildren}</DefaultHeader>}

Expand Down Expand Up @@ -125,15 +128,18 @@ const PageLayout: FC<PropsWithChildren<PageLayoutProps>> = ({

export default PageLayout;

type ContentPaperProps = PropsWithChildren<{ className?: string } & ScrollEdgesVisibilityProps>;
type ContentPaperProps = PropsWithChildren<
{ showTestnetModeIndicator?: boolean; className?: string } & ScrollEdgesVisibilityProps
>;

const ContentPaper: FC<ContentPaperProps> = ({
children,
className,
bottomEdgeThreshold,
topEdgeThreshold,
onBottomEdgeVisibilityChange,
onTopEdgeVisibilityChange
onTopEdgeVisibilityChange,
showTestnetModeIndicator = true
}) => {
const appEnv = useAppEnv();
const rootRef = useRef<HTMLDivElement>(null);
Expand All @@ -159,7 +165,7 @@ const ContentPaper: FC<ContentPaperProps> = ({
className
)}
>
<TestnetModeIndicator />
{showTestnetModeIndicator && <TestnetModeIndicator />}

{children}

Expand All @@ -177,7 +183,7 @@ const TestnetModeIndicator = memo(() => {
return (
<div
className={clsx(
'flex justify-center items-center sticky z-sticky top-0 bg-success',
'flex justify-center items-center sticky z-sticky top-0 bg-success overflow-hidden',
'transition-all ease-in-out duration-300',
enabled ? 'min-h-6 h-6' : 'min-h-0 h-0'
)}
Expand Down
7 changes: 6 additions & 1 deletion src/app/pages/Unlock/Unlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ const Unlock: FC<UnlockProps> = ({ canImportNew = true }) => {
}, [timelock, lockLevel, setTimeLock]);

return (
<PageLayout Header={EmptyHeader} contentPadding={false} contentClassName="relative">
<PageLayout
Header={EmptyHeader}
contentPadding={false}
contentClassName="relative"
showTestnetModeIndicator={false}
>
<PlanetsAnimation bottomGap={bottomGap} />
<div className="w-full min-h-full p-4 flex flex-col z-1">
<div className="w-full aspect-[2]" />
Expand Down

0 comments on commit 665bfee

Please sign in to comment.