Skip to content

Commit

Permalink
Merge pull request #165 from burnt-labs/nerve/mobileZoomFix
Browse files Browse the repository at this point in the history
Added mobile zoom fix
  • Loading branch information
BurntNerve authored Apr 26, 2024
2 parents 586a0a1 + a9e702a commit 6c09d7a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/smooth-clouds-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"abstraxion-dashboard": minor
"@burnt-labs/ui": minor
---

Added prop for more direct access to input styles
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,12 @@ export const AbstraxionSignin = () => {
</h2>
</div>
<Input
baseInputClassName="!ui-text-[16px]"
placeholder="Verification Code"
value={otp}
onChange={handleOtpChange}
error={otpError}
onKeyDown={(e) => e.key === "Enter" && handleOtp(e)}
/>
<div className="ui-flex ui-w-full ui-flex-col ui-items-center ui-gap-4">
<Button fullWidth={true} onClick={handleOtp} disabled={!!otpError}>
Expand All @@ -151,11 +153,13 @@ export const AbstraxionSignin = () => {
</h2>
</div>
<Input
baseInputClassName="!ui-text-[16px]"
placeholder="Email address"
value={email}
onChange={handleEmailChange}
error={emailError}
onBlur={validateEmail}
onKeyDown={(e) => e.key === "Enter" && handleEmail(e)}
/>
<Button
fullWidth={true}
Expand Down
10 changes: 9 additions & 1 deletion packages/ui/src/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ type BaseInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "prefix">;
export interface ITextFieldProps extends BaseInputProps {
className?: string;
error?: string;
baseInputClassName?: string;
onKeyDown?: (e: any) => false | Promise<void>;
}
export function Input({
className,
placeholder,
// This should only be used for specific classes that can't override the base input styles.
baseInputClassName,
value,
error,
onBlur,
onKeyDown,
...props
}: ITextFieldProps) {
const [isInputFocused, setIsInputFocused] = useState(false);
Expand Down Expand Up @@ -46,11 +51,14 @@ export function Input({
</label>
<input
{...props}
className={`ui-z-10 ui-block ui-h-8 ui-w-full ui-border-b ui-relative ${
className={`${
baseInputClassName || ""
} ui-z-10 ui-block ui-h-8 ui-w-full ui-border-b ui-relative ${
error ? "ui-border-red-400" : ""
} ui-bg-transparent ui-font-akkuratLL ui-text-sm ui-text-zinc-100 ui-font-normal ui-leading-tight ui-outline-none`}
onBlur={handleBlur}
onFocus={handleFocus}
onKeyDown={onKeyDown}
value={value}
/>
</div>
Expand Down

0 comments on commit 6c09d7a

Please sign in to comment.