Skip to content

Commit

Permalink
feat(ui/Table): improve ui
Browse files Browse the repository at this point in the history
  • Loading branch information
suvashvishowkarma committed Jan 24, 2024
1 parent 53e2ff0 commit 15a77f5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 33 deletions.
13 changes: 7 additions & 6 deletions packages/ui/src/Table/common/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ const DataTable = <TData extends { id: string | number }>({
const defaultActionColumn: ColumnDef<TData, unknown> = {
id: "actions",
header: () => <i className="pi pi-cog"></i>,
width: "3rem",
maxWidth: "3rem",
minWidth: "3rem",
align: "center",
width: "4rem",
maxWidth: "4rem",
minWidth: "4rem",
cell: ({ row: { original } }) => {
const isVisibleActions =
typeof displayRowActions === "function"
Expand Down Expand Up @@ -199,9 +200,9 @@ const DataTable = <TData extends { id: string | number }>({
enableColumnFilter: false,
enableGlobalFilter: false,
align: "center",
width: "3rem",
maxWidth: "3rem",
minWidth: "3rem",
width: "4rem",
maxWidth: "4rem",
minWidth: "4rem",
},
...parsedColumns,
];
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/assets/css/files-table.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}

.table-files .column-actions {
max-width: 5rem;
min-width: 5rem;
width: 5rem;
max-width: 4rem;
min-width: 4rem;
width: 4rem;
}
6 changes: 0 additions & 6 deletions packages/user/src/assets/css/invitations-table.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,3 @@
max-width: 10rem;
min-width: 10rem;
}

.table-invitations .column-actions {
width: 5rem;
max-width: 5rem;
min-width: 5rem;
}
6 changes: 0 additions & 6 deletions packages/user/src/assets/css/users-table.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,3 @@
max-width: 10rem;
min-width: 10rem;
}

.table-users .column-actions {
width: 5rem;
max-width: 5rem;
min-width: 5rem;
}
6 changes: 1 addition & 5 deletions packages/user/src/components/Profile/ProfileForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ export const ProfileForm = () => {
}),
});

const handleCancel = useCallback(() => {
// reset form
}, []);

const handleSubmit = async (data: UpdateProfileInputType) => {
setSubmitting(true);
updateUserProfile(data, appConfig?.apiBaseUrl)
Expand Down Expand Up @@ -59,7 +55,7 @@ export const ProfileForm = () => {
surname: user?.surname,
}}
>
<ProfileFormFields handleCancel={handleCancel} submitting={submitting} />
<ProfileFormFields submitting={submitting} />
</Provider>
);
};
8 changes: 1 addition & 7 deletions packages/user/src/components/Profile/ProfileFormFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ import { Email, Input, useFormContext } from "@dzangolab/react-form";
import { useTranslation } from "@dzangolab/react-i18n";
import { Button, SubmitButton } from "@dzangolab/react-ui";

export const ProfileFormFields = ({
handleCancel,
submitting,
}: {
handleCancel: () => void;
submitting?: boolean;
}) => {
export const ProfileFormFields = ({ submitting }: { submitting?: boolean }) => {
const {
register,
getFieldState,
Expand Down

0 comments on commit 15a77f5

Please sign in to comment.