* feat: replace team list view with org list view UI and fix team view user availability * update * update2 * some changes * Remove old team availability modal - fix flex direction * fix * fix type error * update * update * fix type error * update * upfate edit sheet * final update * fix flaky e2e * fix e2e * typo * profile update flow * fix type error and refactor * small update * NIT * update * chore: fix types * update --------- Co-authored-by: sean-brydon <sean@cal.com> Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com> Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
59 lines
1.4 KiB
TypeScript
59 lines
1.4 KiB
TypeScript
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
import { SheetClose, Button } from "@calcom/ui";
|
|
|
|
import { useEditMode } from "./store";
|
|
|
|
function EditModeFooter() {
|
|
const { t } = useLocale();
|
|
const setEditMode = useEditMode((state) => state.setEditMode);
|
|
const isPending = useEditMode((state) => state.mutationLoading);
|
|
|
|
return (
|
|
<>
|
|
<Button
|
|
color="secondary"
|
|
type="button"
|
|
className="justify-center"
|
|
onClick={() => {
|
|
setEditMode(false);
|
|
}}>
|
|
{t("cancel")}
|
|
</Button>
|
|
|
|
<Button type="submit" loading={isPending} className="justify-center">
|
|
{t("update")}
|
|
</Button>
|
|
</>
|
|
);
|
|
}
|
|
|
|
function MoreInfoFooter() {
|
|
const { t } = useLocale();
|
|
const setEditMode = useEditMode((state) => state.setEditMode);
|
|
|
|
return (
|
|
<>
|
|
<SheetClose asChild>
|
|
<Button color="secondary" type="button" className="justify-center">
|
|
{t("close")}
|
|
</Button>
|
|
</SheetClose>
|
|
<Button
|
|
type="button"
|
|
className="justify-center"
|
|
onClick={() => {
|
|
setEditMode(true);
|
|
}}
|
|
key="EDIT_BUTTON"
|
|
StartIcon="pencil">
|
|
{t("edit")}
|
|
</Button>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export function SheetFooterControls() {
|
|
const editMode = useEditMode((state) => state.editMode);
|
|
return <>{editMode ? <EditModeFooter /> : <MoreInfoFooter />}</>;
|
|
}
|