diff --git a/app/frontend/components/bill/creator/BillCreatorFormikForm.tsx b/app/frontend/components/bill/creator/BillCreatorFormikForm.tsx index 6dafaf5a..07bf8056 100644 --- a/app/frontend/components/bill/creator/BillCreatorFormikForm.tsx +++ b/app/frontend/components/bill/creator/BillCreatorFormikForm.tsx @@ -1,4 +1,4 @@ -import { Support } from "app/frontend/sway_constants"; +import { ROUTES, Support } from "app/frontend/sway_constants"; import { Form as FormikForm, useFormikContext } from "formik"; import { Button } from "react-bootstrap"; import { FiSave } from "react-icons/fi"; @@ -9,9 +9,10 @@ import SwaySpinner from "app/frontend/components/SwaySpinner"; import BillComponent from "app/frontend/components/bill/BillComponent"; -import { usePage } from "@inertiajs/react"; +import { router, usePage } from "@inertiajs/react"; import { ISubmitValues } from "app/frontend/components/admin/types"; import { TempBillStorage } from "app/frontend/components/bill/creator/TempBillStorage"; +import { useSearchParams } from "app/frontend/hooks/useSearchParams"; import { logDev } from "app/frontend/sway_utils"; import { forwardRef, useEffect, useMemo, useState } from "react"; @@ -124,11 +125,29 @@ const BillCreatorFormikForm = forwardRef(({ setCreatorDirty }: IProps, _summaryR [formik.values.legislator?.value, legislators], ); + const params = useSearchParams(); + return ( <> -
= 0 && countdown <= 3 ? "visible my-2" : "invisible my-2"}> - Store Temporary Bill in: {countdown} +
+
+ = 0 && countdown <= 3 ? "visible" : "invisible"}> + Store Temporary Bill in: {countdown} + +
+
+ +
diff --git a/app/frontend/components/bill/creator/BillOfTheWeekCreator.tsx b/app/frontend/components/bill/creator/BillOfTheWeekCreator.tsx index ab5f8eb4..066916e9 100644 --- a/app/frontend/components/bill/creator/BillOfTheWeekCreator.tsx +++ b/app/frontend/components/bill/creator/BillOfTheWeekCreator.tsx @@ -103,7 +103,7 @@ const BillOfTheWeekCreator_: React.FC = ({ bills, bill, user, tabKey = E
Sway Locale - +
@@ -119,8 +119,8 @@ const BillOfTheWeekCreator_: React.FC = ({ bills, bill, user, tabKey = E menuPortalTarget={document.body} menuPosition="fixed" onChange={(o) => { - handleChangeBill(o); TempBillStorage.remove(); + handleChangeBill(o); }} />
@@ -159,7 +159,7 @@ const BillOfTheWeekCreator_: React.FC = ({ bills, bill, user, tabKey = E }> - {tabKey === ETab.Creator && } + {(!tabKey || tabKey === ETab.Creator) && } diff --git a/app/frontend/components/user/LocaleSelector.tsx b/app/frontend/components/user/LocaleSelector.tsx index 41bc6252..e1388671 100644 --- a/app/frontend/components/user/LocaleSelector.tsx +++ b/app/frontend/components/user/LocaleSelector.tsx @@ -9,12 +9,12 @@ import { REACT_SELECT_STYLES } from "../../sway_utils"; interface IProps { containerStyle?: React.CSSProperties; - callback?: () => void; + callahead?: () => void; } const toSelectOption = (l: sway.ISwayLocale): ISelectOption => ({ label: toFormattedLocaleName(l.name), value: l.id }); -const LocaleSelector: React.FC = ({ callback }) => { +const LocaleSelector: React.FC = ({ callahead }) => { const { options } = useLocales(); const [locale, getLocale] = useLocale(); @@ -31,11 +31,11 @@ const LocaleSelector: React.FC = ({ callback }) => { const handleChange = useCallback( (o: SingleValue) => { if (o) { + callahead?.(); getLocale(Number(o.value)); - callback?.(); } }, - [getLocale, callback], + [getLocale, callahead], ); return (