From 635331e1ededaf657ae450a22dca1664c4a0c12e Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Fri, 6 Sep 2024 16:26:57 -0400 Subject: [PATCH] fix(vue): Fix subtitles, move into context --- packages/create-react/src/components/views/LoginView.tsx | 4 ++-- packages/create-react/src/context.ts | 2 ++ packages/create-vue/src/components/views/LoginView.vue | 2 +- packages/create-vue/src/context.ts | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/create-react/src/components/views/LoginView.tsx b/packages/create-react/src/components/views/LoginView.tsx index f668848..1557cb4 100644 --- a/packages/create-react/src/components/views/LoginView.tsx +++ b/packages/create-react/src/components/views/LoginView.tsx @@ -4,13 +4,13 @@ import { AppContext } from '../../context'; /** Login page, showing a button that redirects to login form. */ export default function LoginView() { - const { title, logo } = useContext(AppContext); + const { title, subtitle, logo } = useContext(AppContext); const { loginWithRedirect } = useAuth0(); return (
{logo && {logo.alt}}

{title}

-

Discover the power of developing with React

+

{subtitle}

diff --git a/packages/create-react/src/context.ts b/packages/create-react/src/context.ts index 2dffc1c..8b69611 100644 --- a/packages/create-react/src/context.ts +++ b/packages/create-react/src/context.ts @@ -3,6 +3,7 @@ import cartoLogo from '/carto.svg'; export interface AppContextProps { title: string; + subtitle: string; logo?: { src: string; alt: string; @@ -28,6 +29,7 @@ export interface AppContextProps { export const DEFAULT_APP_CONTEXT = { title: import.meta.env.VITE_APP_TITLE, + subtitle: 'Discover the power of developing with React', logo: { src: cartoLogo, alt: 'CARTO logo', diff --git a/packages/create-vue/src/components/views/LoginView.vue b/packages/create-vue/src/components/views/LoginView.vue index dd145f4..1f6247f 100644 --- a/packages/create-vue/src/components/views/LoginView.vue +++ b/packages/create-vue/src/components/views/LoginView.vue @@ -15,7 +15,7 @@ const { loginWithRedirect } = useAuth0(); :alt="context.logo.alt" />

{{ context.title }}

-

Discover the power of developing with React

+

{{ context.subtitle }}

diff --git a/packages/create-vue/src/context.ts b/packages/create-vue/src/context.ts index 2e61dd8..2750407 100644 --- a/packages/create-vue/src/context.ts +++ b/packages/create-vue/src/context.ts @@ -3,6 +3,7 @@ import cartoLogo from '/carto.svg'; export interface AppContext { title: string; + subtitle: string; logo?: { src: string; alt: string; @@ -27,6 +28,7 @@ export interface AppContext { export const DEFAULT_APP_CONTEXT: AppContext = { title: import.meta.env.VITE_APP_TITLE, + subtitle: 'Discover the power of developing with Vue', logo: { src: cartoLogo, alt: 'CARTO logo',