Skip to content

Commit

Permalink
fix width
Browse files Browse the repository at this point in the history
  • Loading branch information
constantgillet committed Apr 28, 2024
1 parent 4aa1f88 commit ffac747
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
11 changes: 3 additions & 8 deletions app/components/PropertyTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,19 @@ import { TextField, Tooltip } from "@radix-ui/themes";
import { Icon } from "./Icon";
import { css } from "styled-system/css";
import { RootProps } from "node_modules/@radix-ui/themes/dist/esm/components/text-field";
import { forwardRef } from "react";

//Get default props of input
type PropertyTextFieldProps = RootProps & {
hasVariable: boolean;
icon?: React.ReactNode;
};

export const PropertyTextField = forwardRef(function PropertyTextFieldComponent(
props: PropertyTextFieldProps,
ref: React.Ref<HTMLInputElement>
) {
export const PropertyTextField = (props: PropertyTextFieldProps) => {
const { hasVariable, icon, ...inputProps } = props;

return (
<TextField.Root>
<TextField.Root {...inputProps}>
{icon ? <TextField.Slot>{icon}</TextField.Slot> : null}
<TextField.Root ref={ref} {...inputProps} />
{hasVariable ? (
<TextField.Slot
style={{
Expand Down Expand Up @@ -47,4 +42,4 @@ export const PropertyTextField = forwardRef(function PropertyTextFieldComponent(
) : null}
</TextField.Root>
);
});
};
4 changes: 2 additions & 2 deletions app/routes/_app._main-layout.account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function SettingsLayout() {
color="gray"
disabled={link.disabled}
className={css({
w: "100%",
w: "full!important",
textAlign: "left",
})}
style={{
Expand All @@ -64,7 +64,7 @@ export default function SettingsLayout() {
>
<div
className={css({
w: "100%",
w: "full!important",
textAlign: "left",
})}
>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/_auth.login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default function LoginPage() {
<FormSubmitButton
size="3"
className={css({
w: "full",
w: "full!important",
})}
variant="classic"
>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/_auth.register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default function LoginPage() {
<FormSubmitButton
size="3"
className={css({
w: "full",
w: "full!important",
})}
variant="classic"
>
Expand Down

0 comments on commit ffac747

Please sign in to comment.