Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Improvements #382

Merged
merged 4 commits into from
Apr 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
settings
  • Loading branch information
sinamics committed Apr 14, 2024
commit 601ea8e90b51abf240d482d148a056fe7b6847ec
102 changes: 63 additions & 39 deletions src/components/networkByIdPage/table/memberHeaderColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,46 +166,70 @@ export const MemberHeaderColumns = ({ nwid, central = false, organizationId }: I
header: () => <span>{c("header.authorized")}</span>,
id: "authorized",
cell: ({ getValue, row: { original } }) => {
// const options = [
// original?.activeBridge ? (
// <span className="text-sm text-primary tracking-tighter">
// <Br />
// </span>
// ) : null,
// original?.noAutoAssignIps ? <Aa /> : null,
// ]
// .filter(Boolean)
// .reduce(
// (acc, elem, index) => (
// <>
// {acc}
// {index > 0 ? "" : ""}
// {elem}
// </>
// ),
// null,
// );
return (
<label className="label cursor-pointer justify-center">
<input
type="checkbox"
checked={getValue()}
onChange={(event) => {
const authorized = event.target.checked;
if (me?.options?.deAuthorizeWarning && !authorized) {
callModal({
title: "Warning",
description: "Are you sure you want to deauthorize this member?",
yesAction: () => {
updateMember(
{
nwid,
memberId: original.id,
central,
organizationId,
updateParams: { authorized },
},
{ onSuccess: () => void refetchNetworkById() },
);
},
});
} else {
updateMember(
{
nwid,
memberId: original.id,
central,
organizationId,
updateParams: { authorized: event.target.checked },
},
{ onSuccess: () => void refetchNetworkById() },
);
}
}}
className="checkbox-success checkbox checkbox-xs sm:checkbox-sm"
/>
</label>
<span className="flex items-center gap-2">
<label className="label cursor-pointer justify-center">
{/* add a letter B if bridge has been enabled */}

<input
type="checkbox"
checked={getValue()}
onChange={(event) => {
const authorized = event.target.checked;
if (me?.options?.deAuthorizeWarning && !authorized) {
callModal({
title: "Warning",
description: "Are you sure you want to deauthorize this member?",
yesAction: () => {
updateMember(
{
nwid,
memberId: original.id,
central,
organizationId,
updateParams: { authorized },
},
{ onSuccess: () => void refetchNetworkById() },
);
},
});
} else {
updateMember(
{
nwid,
memberId: original.id,
central,
organizationId,
updateParams: { authorized: event.target.checked },
},
{ onSuccess: () => void refetchNetworkById() },
);
}
}}
className="checkbox-success checkbox checkbox-xs sm:checkbox-sm"
/>
</label>
{/* {options} */}
</span>
);
},
}),
Expand Down
Loading