mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 19:57:52 +01:00
feat: allow plan adjustment via hash
This commit is contained in:
@@ -90,9 +90,10 @@ export function showAddNotebookDialog() {
|
||||
));
|
||||
}
|
||||
|
||||
export function showBuyDialog(couponCode) {
|
||||
export function showBuyDialog(plan, couponCode) {
|
||||
return showDialog((Dialogs, perform) => (
|
||||
<Dialogs.BuyDialog
|
||||
plan={plan}
|
||||
couponCode={couponCode}
|
||||
onCancel={() => perform(false)}
|
||||
/>
|
||||
|
||||
@@ -114,7 +114,7 @@ function BuyDialog(props) {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [error, setError] = useState();
|
||||
const [prices, setPrices] = useState();
|
||||
const [plan, setPlan] = useState("monthly");
|
||||
const [plan, setPlan] = useState(props.plan || "monthly");
|
||||
const isLoggedIn = useUserStore((store) => store.isLoggedIn);
|
||||
const user = useUserStore((store) => store.user);
|
||||
|
||||
|
||||
@@ -111,7 +111,10 @@ const hashroutes = {
|
||||
showBuyDialog();
|
||||
},
|
||||
"/buy/:code": ({ code }) => {
|
||||
showBuyDialog(code);
|
||||
showBuyDialog("monthly", code);
|
||||
},
|
||||
"/buy/:plan/:code": ({ plan, code }) => {
|
||||
showBuyDialog(plan, code);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user