mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-13 17:21:48 +02:00
Further remove labels
This commit is contained in:
@@ -39,7 +39,6 @@ export function CreateOrgLabelDialog({
|
|||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
const api = createApiClient(useEnvContext());
|
const api = createApiClient(useEnvContext());
|
||||||
const { isPaidUser } = usePaidStatus();
|
const { isPaidUser } = usePaidStatus();
|
||||||
const canManageLabels = isPaidUser(tierMatrix.labels);
|
|
||||||
const [isSubmitting, startTransition] = useTransition();
|
const [isSubmitting, startTransition] = useTransition();
|
||||||
|
|
||||||
async function createOrgLabel(data: { name: string; color: string }) {
|
async function createOrgLabel(data: { name: string; color: string }) {
|
||||||
@@ -84,11 +83,8 @@ export function CreateOrgLabelDialog({
|
|||||||
</CredenzaDescription>
|
</CredenzaDescription>
|
||||||
</CredenzaHeader>
|
</CredenzaHeader>
|
||||||
<CredenzaBody>
|
<CredenzaBody>
|
||||||
<PaidFeaturesAlert tiers={tierMatrix.labels} />
|
|
||||||
<OrgLabelForm
|
<OrgLabelForm
|
||||||
disabled={!canManageLabels}
|
|
||||||
onSubmit={(data) => {
|
onSubmit={(data) => {
|
||||||
if (!canManageLabels) return;
|
|
||||||
startTransition(async () => createOrgLabel(data));
|
startTransition(async () => createOrgLabel(data));
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -106,7 +102,7 @@ export function CreateOrgLabelDialog({
|
|||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
form="org-label-form"
|
form="org-label-form"
|
||||||
disabled={isSubmitting || !canManageLabels}
|
disabled={isSubmitting}
|
||||||
loading={isSubmitting}
|
loading={isSubmitting}
|
||||||
>
|
>
|
||||||
{t("labelCreate")}
|
{t("labelCreate")}
|
||||||
|
|||||||
@@ -44,8 +44,6 @@ export function EditOrgLabelDialog({
|
|||||||
}: EditOrgLabelDialogProps) {
|
}: EditOrgLabelDialogProps) {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
const api = createApiClient(useEnvContext());
|
const api = createApiClient(useEnvContext());
|
||||||
const { isPaidUser } = usePaidStatus();
|
|
||||||
const canManageLabels = isPaidUser(tierMatrix.labels);
|
|
||||||
const [isSubmitting, startTransition] = useTransition();
|
const [isSubmitting, startTransition] = useTransition();
|
||||||
|
|
||||||
async function editOrgLabel(data: { name: string; color: string }) {
|
async function editOrgLabel(data: { name: string; color: string }) {
|
||||||
@@ -90,12 +88,9 @@ export function EditOrgLabelDialog({
|
|||||||
</CredenzaDescription>
|
</CredenzaDescription>
|
||||||
</CredenzaHeader>
|
</CredenzaHeader>
|
||||||
<CredenzaBody>
|
<CredenzaBody>
|
||||||
<PaidFeaturesAlert tiers={tierMatrix.labels} />
|
|
||||||
<OrgLabelForm
|
<OrgLabelForm
|
||||||
disabled={!canManageLabels}
|
|
||||||
defaultValue={label}
|
defaultValue={label}
|
||||||
onSubmit={(data) => {
|
onSubmit={(data) => {
|
||||||
if (!canManageLabels) return;
|
|
||||||
startTransition(async () => editOrgLabel(data));
|
startTransition(async () => editOrgLabel(data));
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -113,7 +108,7 @@ export function EditOrgLabelDialog({
|
|||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
form="org-label-form"
|
form="org-label-form"
|
||||||
disabled={isSubmitting || !canManageLabels}
|
disabled={isSubmitting}
|
||||||
loading={isSubmitting}
|
loading={isSubmitting}
|
||||||
>
|
>
|
||||||
{t("labelEdit")}
|
{t("labelEdit")}
|
||||||
|
|||||||
Reference in New Issue
Block a user