-
Notifications
You must be signed in to change notification settings - Fork 0
UI Improvements for GC Landing page #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
9f0c7e1
c23ec72
ff516f0
0c17f66
77277e0
ea70026
050c80f
4cb098e
32f93ea
22b5212
899c1e7
71de764
7e5ba85
191d450
846e5db
8033a99
e443a58
429eee1
62aced7
b644c2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| <script lang="ts" setup> | ||
| import { ref, computed, onMounted, onUnmounted } from "vue"; | ||
| import type { SupportedLocale } from "~/types/types"; | ||
| const { locale, locales, setLocale } = useI18n(); | ||
| const { t } = useI18n(); | ||
| interface Props { | ||
| theme?: 'purple' | 'white' | 'dark'; | ||
| } | ||
| const props = withDefaults(defineProps<Props>(), { | ||
| theme: 'white' | ||
| }); | ||
| // Populate available locales from i18n plugin | ||
| const availableLocales = computed(() => locales.value); | ||
| const currentLocaleName = computed(() => { | ||
| const currentLocale = locales.value.find( | ||
| (lang) => lang.code === locale.value, | ||
| ); | ||
| return currentLocale?.name || ""; | ||
| }); | ||
| const dropdownOpen = ref(false); | ||
| // Close dropdown when clicking outside | ||
| const handleClickOutside = (event: MouseEvent) => { | ||
| const target = event.target as HTMLElement; | ||
| if (!target.closest('.language-picker-container')) { | ||
| dropdownOpen.value = false; | ||
| } | ||
| }; | ||
| // Load locale from session storage on mount and set up click outside handler | ||
| onMounted(() => { | ||
| const savedLocale = sessionStorage.getItem("locale"); | ||
| if (savedLocale && locales.value.some((lang) => lang.code === savedLocale)) { | ||
| setLocale(savedLocale as SupportedLocale); | ||
| } | ||
| document.addEventListener('click', handleClickOutside); | ||
| }); | ||
| onUnmounted(() => { | ||
| document.removeEventListener('click', handleClickOutside); | ||
| }); | ||
| const changeLocale = (locale: { code: string }): void => { | ||
| setLocale(locale.code as SupportedLocale); | ||
| sessionStorage.setItem("locale", locale.code); | ||
| dropdownOpen.value = false; | ||
| }; | ||
| const dropdownClasses = computed(() => { | ||
| switch (props.theme) { | ||
| case 'white': | ||
| return "origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 z-50"; | ||
| case 'dark': | ||
| return "origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-gray-800 ring-1 ring-gray-600 z-50"; | ||
| case 'purple': | ||
| default: | ||
| return "origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-gray-200 z-50"; | ||
| } | ||
| }); | ||
| const itemClasses = computed(() => { | ||
| switch (props.theme) { | ||
| case 'white': | ||
| return "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-colors"; | ||
| case 'dark': | ||
| return "block px-4 py-2 text-sm text-white hover:bg-gray-700 transition-colors"; | ||
| case 'purple': | ||
| default: | ||
| return "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-colors"; | ||
| } | ||
| }); | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="relative inline-block text-left language-picker-container"> | ||
| <div> | ||
| <button | ||
| type="button" | ||
| class="relative w-10 h-10 rounded-full bg-white flex items-center justify-center hover:bg-gray-50 transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500" | ||
| @click.stop="dropdownOpen = !dropdownOpen" | ||
| :title="t('header.languagePicker')" | ||
| > | ||
| <svg | ||
| class="w-5 h-5 text-gray-600" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| fill="none" | ||
| viewBox="0 0 24 24" | ||
| stroke="currentColor" | ||
| > | ||
| <path | ||
| stroke-linecap="round" | ||
| stroke-linejoin="round" | ||
| stroke-width="2" | ||
| d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z" | ||
| /> | ||
| </svg> | ||
| </button> | ||
| </div> | ||
| <div | ||
| v-if="dropdownOpen" | ||
| :class="dropdownClasses" | ||
| @click.stop | ||
| > | ||
| <div class="py-1"> | ||
| <a | ||
| v-for="lang in availableLocales" | ||
| :key="lang.code" | ||
| href="#" | ||
| :class="itemClasses" | ||
| @click=" | ||
| ($event.preventDefault(), | ||
| $event.stopPropagation(), | ||
| changeLocale(lang)) | ||
| " | ||
| > | ||
| {{ lang.name }} | ||
| </a> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </template> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| { | ||
| "app": { | ||
| "title": "Guardian Connector Landing Page", | ||
| "community": "Community", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert. Let's use |
||
| "welcome": "Welcome to the Guardian Connector platform for {communityName}", | ||
| "welcomeSubtitle": "Access your community tools and resources in one place" | ||
| "partner": "Partner", | ||
| "welcome": "Empower {communityName} with data sovereignty and self-determination.", | ||
| "welcomeSubtitle": "Here you can find data, and manage {communityName}'s assets." | ||
conservationtimothy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }, | ||
| "auth": { | ||
| "signIn": "Sign In", | ||
|
|
@@ -13,7 +13,7 @@ | |
| "welcome": "Welcome, {user}", | ||
| "userManagement": "User Management", | ||
| "secureAccessRequired": "Secure Access Required", | ||
| "pleaseSignInToAccess": "Please sign in to access your community tools" | ||
| "pleaseSignInToAccess": "Please sign in to access your partner tools" | ||
|
||
| }, | ||
| "services": { | ||
| "superset": "Superset", | ||
|
|
@@ -25,8 +25,8 @@ | |
| "filebrowser": "Filebrowser", | ||
| "filebrowserDescription": "Secure file management and sharing", | ||
| "noServicesAvailable": "No Services Available", | ||
| "noServicesDescription": "No community services are currently deployed or accessible.", | ||
| "communityService": "Community service" | ||
| "noServicesDescription": "No partner services are currently deployed or accessible.", | ||
conservationtimothy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "communityService": "Partner service" | ||
conservationtimothy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }, | ||
| "userManagement": { | ||
| "title": "User Management", | ||
|
|
@@ -64,7 +64,11 @@ | |
| }, | ||
| "footer": { | ||
| "copyright": "© 2025 Guardian Connector.", | ||
| "community": "Community: {communityName}", | ||
| "partner": "Partner: {communityName}", | ||
| "services": "Services: {count}" | ||
| }, | ||
| "header": { | ||
| "adminAccess": "Admin Access", | ||
| "languagePicker": "Language Picker" | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use the same icon on
UserManagementThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also,
Auth0Loginhas a warning complaining about the absence ofLanguagePickercomponent. Could implement this there too to resolve that warning.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, I now see there is also a
LanguagePicker. Can we just use one?I'm not sure and haven't looked into it, but I suspect this warning for the
Auth0Loginpage could also be related:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is kinda nicer I think since we've redesigned maybe we use this one thru out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you didn't do this, which is fine. Shall we create an issue to do this work?
Actually, maybe that issue can just request implementing the same folder+tab header design for the User Management page. In order to have a consistent design across all pages of the this application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and then separately, an issue to track the warnings / errors in
Auth0LoginThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#38