From 40dd6b2cbb13ecbb9acdb1eca45ec9d2bed11e2b Mon Sep 17 00:00:00 2001 From: ErwannRousseau Date: Thu, 5 Dec 2024 17:40:00 +0100 Subject: [PATCH] feat: rename getFormatPrice to formatPrice, update Tailwind config, and adjust base template structure --- README.md | 2 +- src/Twig/Components/Price.php | 2 +- tailwind.config.js | 1 - templates/base.html.twig | 6 +++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1908804..243d88f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This project is a demonstration of using Tailwind CSS with Twig Components in a 1. Clone the repository: ```bash - git clone https://github.com/ErwannRousseau/symfony-tailwind-twig-components + git clone https://github.com/KnpLabs/symfony-tailwind-twig-components.git cd symfony-tailwind-twig-components ``` diff --git a/src/Twig/Components/Price.php b/src/Twig/Components/Price.php index 46c82d3..63a2287 100644 --- a/src/Twig/Components/Price.php +++ b/src/Twig/Components/Price.php @@ -13,7 +13,7 @@ final class Price public float $price; public string $locale = 'en_US'; - public function getFormatPrice(): string + public function formatPrice(): string { $formatter = new NumberFormatter($this->locale, NumberFormatter::CURRENCY); return $formatter->formatCurrency($this->price, 'USD'); diff --git a/tailwind.config.js b/tailwind.config.js index 6cd8b03..a6e7ea7 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,6 +1,5 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - darkMode: ["class"], content: [ "./assets/**/*.js", "./templates/**/*.html.twig", diff --git a/templates/base.html.twig b/templates/base.html.twig index 4fdf386..2c0d71b 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -4,11 +4,11 @@ Tailwind + Twig Components - {% block javascripts %} - {% block importmap %}{{ importmap('app') }}{% endblock %} + {% block stylesheets %} + {% endblock %} - +
{% block body %}{% endblock %}