From d66069add9b4daefde9de5bf6c08123cd3ff6a3f Mon Sep 17 00:00:00 2001 From: Carlos Jorge Rodriguez Date: Fri, 5 Jan 2024 21:49:54 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20use=20dropdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 19 +++++++ src/components/Header/LocaleSelector.astro | 59 +++++++++++++++++----- src/layouts/Layout.astro | 5 +- tailwind.config.cjs | 7 ++- 5 files changed, 75 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index bcef9cd..44d05cf 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@astrojs/tailwind": "^5.1.0", "astro": "^4.0.8", "astro-compressor": "^0.4.1", + "flowbite": "^2.2.1", "tailwindcss": "^3.4.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 240b0f7..fa5dc70 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ dependencies: astro-compressor: specifier: ^0.4.1 version: 0.4.1 + flowbite: + specifier: ^2.2.1 + version: 2.2.1 tailwindcss: specifier: ^3.4.0 version: 3.4.0 @@ -786,6 +789,10 @@ packages: fastq: 1.15.0 dev: false + /@popperjs/core@2.11.8: + resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} + dev: false + /@rollup/rollup-android-arm-eabi@4.7.0: resolution: {integrity: sha512-rGku10pL1StFlFvXX5pEv88KdGW6DHUghsxyP/aRYb9eH+74jTGJ3U0S/rtlsQ4yYq1Hcc7AMkoJOb1xu29Fxw==} cpu: [arm] @@ -1628,6 +1635,13 @@ packages: engines: {node: '>=8'} dev: false + /flowbite@2.2.1: + resolution: {integrity: sha512-iiZyBTtriEDRHrqXZgpKHaxl4B2J8HZUP8Yn1RXozUDKszWHDVj4GxQqMMB9AJHRWOgXV/4E/LJZ/zqQgBUhWA==} + dependencies: + '@popperjs/core': 2.11.8 + mini-svg-data-uri: 1.4.4 + dev: false + /fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} dev: false @@ -2507,6 +2521,11 @@ packages: engines: {node: '>=12'} dev: false + /mini-svg-data-uri@1.4.4: + resolution: {integrity: sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==} + hasBin: true + dev: false + /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: diff --git a/src/components/Header/LocaleSelector.astro b/src/components/Header/LocaleSelector.astro index e0ebaa7..4ad5380 100644 --- a/src/components/Header/LocaleSelector.astro +++ b/src/components/Header/LocaleSelector.astro @@ -5,6 +5,7 @@ export interface Props { ENGLISH: string; } const { SPANISH, ENGLISH } = Astro.props; +const CURRENT_LANGUAGE = currentLocale === 'es' ? SPANISH : ENGLISH; // TODO: improve design using a Select with dropdown https://flowbite.com/docs/components/dropdowns/ --- @@ -18,18 +19,50 @@ const { SPANISH, ENGLISH } = Astro.props; } } - - +
  • + {SPANISH} +
  • +
  • + {ENGLISH} +
  • + + diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 403eea2..42846a9 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -63,11 +63,14 @@ const { title } = Astro.props; as="font" href="https://fonts.googleapis.com/css?family=Lato:400italic%27&display=swap" /> - {title} + diff --git a/tailwind.config.cjs b/tailwind.config.cjs index ebbf059..6c432ad 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -1,6 +1,9 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'], + content: [ + './src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}', + './node_modules/flowbite/**/*.js', + ], theme: { extend: { fontSize: { @@ -39,5 +42,5 @@ module.exports = { '500ms ease 400ms forwards show-presentation', }, }, - plugins: [], + plugins: [require('flowbite/plugin')], };