mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-24 02:12:01 +08:00
* add: quota bar * add: openLink helper function * add: styled elements and visits link placeholder * update: remove hover state from the box * add: quota notices * update: quota access and usage calculations * add: logic to calculate plan usage * update: move logic to calculate plan usage to hook * add: todo note * add: todos * add: mixpanel events * fix: hide quota bar when sidebar is minimized * fix: settings panel was not expanding when sidebar is minimized * update: text and structure of the bar * update: quota calculation logic * update: remove TODOs * update: text and values * fix: height of the container for icon settings * update: golinks * update: golinks
30 lines
567 B
JavaScript
30 lines
567 B
JavaScript
import API from '../api';
|
|
import { GOLINKS } from '../constants';
|
|
|
|
export const useAuth = () => {
|
|
const { subscriptionId } = 123;
|
|
|
|
const redirectToConnect = async () => {
|
|
const link = await getConnectLink();
|
|
|
|
window.open(link, '_self').focus();
|
|
};
|
|
|
|
const getConnectLink = async () => {
|
|
return API.initConnect();
|
|
};
|
|
|
|
const getUpgradeLink = () => {
|
|
const url = new URL(GOLINKS.UPGRADE);
|
|
|
|
url.searchParams.append('subscription_id', subscriptionId);
|
|
|
|
return url.toString();
|
|
};
|
|
|
|
return {
|
|
redirectToConnect,
|
|
getConnectLink,
|
|
getUpgradeLink,
|
|
};
|
|
};
|