From 7fb820e79036541a69754181c982d2d4efdf5ac7 Mon Sep 17 00:00:00 2001 From: Tadas Krivickas Date: Thu, 9 Sep 2021 11:22:14 +0300 Subject: [PATCH] Rename smart to quick connect --- src/app/config/store.ts | 14 +++++++------- src/app/connection/store.ts | 5 ++--- src/app/navigation/locations.ts | 2 +- .../views/consumer/Proposals/ProposalsView.tsx | 8 ++++---- ...artConnectView.tsx => QuickConnectView.tsx} | 18 +++++++++--------- .../consumer/Proposals/SwitchConnectView.tsx | 14 +++++++------- ...nnect.json => animation_quick_connect.json} | 0 src/shared/analytics/actions.ts | 2 +- 8 files changed, 31 insertions(+), 32 deletions(-) rename src/app/views/consumer/Proposals/{SmartConnectView.tsx => QuickConnectView.tsx} (87%) rename src/app/views/consumer/Proposals/{animation_smart_connect.json => animation_quick_connect.json} (100%) diff --git a/src/app/config/store.ts b/src/app/config/store.ts index d876c03f..fc0031af 100644 --- a/src/app/config/store.ts +++ b/src/app/config/store.ts @@ -32,7 +32,7 @@ export interface DesktopConfig { onboarded?: boolean dns?: DNSOption "nat-compatibility"?: "auto" | "off" - "smart-connect"?: boolean + "quick-connect"?: boolean filters?: ProposalFilters } @@ -77,8 +77,8 @@ export class ConfigStore { setAutoNATCompatibility: action, onboarded: computed, setOnboarded: action, - smartConnect: computed, - setSmartConnect: action, + quickConnect: computed, + setQuickConnect: action, }) } @@ -155,11 +155,11 @@ export class ConfigStore { return this.updateConfigPartial({ "nat-compatibility": enabled ? "auto" : "off" }) } - get smartConnect(): boolean { - return this.config.desktop?.["smart-connect"] !== false + get quickConnect(): boolean { + return this.config.desktop?.["quick-connect"] !== false } - setSmartConnect = async (enabled: boolean): Promise => { - return this.updateConfigPartial({ "smart-connect": enabled }) + setQuickConnect = async (enabled: boolean): Promise => { + return this.updateConfigPartial({ "quick-connect": enabled }) } } diff --git a/src/app/connection/store.ts b/src/app/connection/store.ts index 564681d6..8d4368b9 100644 --- a/src/app/connection/store.ts +++ b/src/app/connection/store.ts @@ -164,18 +164,17 @@ export class ConnectionStore { } } - async smartConnect(): Promise { + async quickConnect(): Promise { if (!this.root.identity.identity) { return } - log.info("Smart connect preset:", this.root.filters.presetID, "country:", this.root.filters.country) this.setConnectInProgress(true) this.setGracePeriod() this.root.proposals.setActiveProposal(_.sample(this.root.proposals.filteredProposals)) if (!this.root.proposals.active) { return } - userEvent(ConnectionAction.SmartConnect, this.root.proposals.active.country) + userEvent(ConnectionAction.QuickConnect, this.root.proposals.active.country) try { await tequilapi.connectionCreate( { diff --git a/src/app/navigation/locations.ts b/src/app/navigation/locations.ts index efc0f924..83a451b3 100644 --- a/src/app/navigation/locations.ts +++ b/src/app/navigation/locations.ts @@ -32,7 +32,7 @@ export const locations = { consumer: "/consumer", proposals: "/consumer/proposals", proposalsManualConnect: "/consumer/proposals/manual-connect", - proposalsSmartConnect: "/consumer/proposals/smart-connect", + proposalsQuickConnect: "/consumer/proposals/quick-connect", connection: "/consumer/connection", referrals: "/referrals", help: "/help", diff --git a/src/app/views/consumer/Proposals/ProposalsView.tsx b/src/app/views/consumer/Proposals/ProposalsView.tsx index c849889c..5cef6b9e 100644 --- a/src/app/views/consumer/Proposals/ProposalsView.tsx +++ b/src/app/views/consumer/Proposals/ProposalsView.tsx @@ -12,21 +12,21 @@ import { locations } from "../../../navigation/locations" import { useStores } from "../../../store" import { ManualConnectView } from "./ManualConnectView" -import { SmartConnectView } from "./SmartConnectView" +import { QuickConnectView } from "./QuickConnectView" export const ProposalsView: React.FC = observer(() => { const { config } = useStores() return ( <> - - + + diff --git a/src/app/views/consumer/Proposals/SmartConnectView.tsx b/src/app/views/consumer/Proposals/QuickConnectView.tsx similarity index 87% rename from src/app/views/consumer/Proposals/SmartConnectView.tsx rename to src/app/views/consumer/Proposals/QuickConnectView.tsx index bc0610e6..e6ade110 100644 --- a/src/app/views/consumer/Proposals/SmartConnectView.tsx +++ b/src/app/views/consumer/Proposals/QuickConnectView.tsx @@ -22,7 +22,7 @@ import { brand } from "../../../ui-kit/colors" import { Preset } from "../../../proposals/components/Preset/Preset" import { RippleButton } from "../../../ui-kit/components/Button/RippleButton" -import animationSmartConnect from "./animation_smart_connect.json" +import animationQuickConnect from "./animation_quick_connect.json" import { SwitchConnectView } from "./SwitchConnectView" const Sidebar = styled(ViewSidebar)` @@ -66,7 +66,7 @@ const SideBot = styled.div` } ` -const SmartConnectButtonContainer = styled.div` +const QuickConnectButtonContainer = styled.div` position: absolute; bottom: 0; box-sizing: border-box; @@ -76,7 +76,7 @@ const SmartConnectButtonContainer = styled.div` background: ${brand}; ` -const SmartConnectButton = styled(RippleButton)` +const QuickConnectButton = styled(RippleButton)` width: 222px; height: 73px; padding-top: 10px; @@ -84,12 +84,12 @@ const SmartConnectButton = styled(RippleButton)` font-size: 18px; ` -export const SmartConnectView: React.FC = observer(() => { +export const QuickConnectView: React.FC = observer(() => { const { proposals, connection } = useStores() const handleConnectClick = async (): Promise => { if (connection.status === ConnectionStatus.NOT_CONNECTED) { try { - return await connection.smartConnect() + return await connection.quickConnect() } catch (reason) { toast.error(function errorToast() { return ( @@ -118,16 +118,16 @@ export const SmartConnectView: React.FC = observer(() => { - - Connect - + + Quick Connect +
diff --git a/src/app/views/consumer/Proposals/SwitchConnectView.tsx b/src/app/views/consumer/Proposals/SwitchConnectView.tsx index e01a3ef7..ced717a3 100644 --- a/src/app/views/consumer/Proposals/SwitchConnectView.tsx +++ b/src/app/views/consumer/Proposals/SwitchConnectView.tsx @@ -45,22 +45,22 @@ const SwitchLink = styled.div<{ active: boolean }>` export const SwitchConnectView: React.FC = observer(() => { const { router, config } = useStores() const manual = router.location.pathname == locations.proposalsManualConnect - const smart = router.location.pathname == locations.proposalsSmartConnect + const quick = router.location.pathname == locations.proposalsQuickConnect return ( - - {!smart ? ( - config.setSmartConnect(true)}> - Smart Connect + + {!quick ? ( + config.setQuickConnect(true)}> + Quick Connect ) : ( - Smart Connect + Quick Connect )} {!manual ? ( - config.setSmartConnect(false)}> + config.setQuickConnect(false)}> Manual Connect ) : ( diff --git a/src/app/views/consumer/Proposals/animation_smart_connect.json b/src/app/views/consumer/Proposals/animation_quick_connect.json similarity index 100% rename from src/app/views/consumer/Proposals/animation_smart_connect.json rename to src/app/views/consumer/Proposals/animation_quick_connect.json diff --git a/src/shared/analytics/actions.ts b/src/shared/analytics/actions.ts index d59481b0..ad1fdfff 100644 --- a/src/shared/analytics/actions.ts +++ b/src/shared/analytics/actions.ts @@ -37,7 +37,7 @@ export enum ProposalViewAction { export enum ConnectionAction { Connect = "Connect", - SmartConnect = "Smart Connect", + QuickConnect = "Quick Connect", Disconnect = "Disconnect", }