From 9463493bd1dfe156fcc2e367c739f84dbef1a929 Mon Sep 17 00:00:00 2001 From: Andrei Soroker Date: Tue, 27 Aug 2024 12:32:36 -0700 Subject: [PATCH] vertical-lr to the rescue --- storefront/src/ui/Project.tsx | 61 +++++++++++++++++++++++----------- storefront/tailwind.config.cjs | 22 +++++++++++- 2 files changed, 62 insertions(+), 21 deletions(-) diff --git a/storefront/src/ui/Project.tsx b/storefront/src/ui/Project.tsx index ef87b99..83aeced 100644 --- a/storefront/src/ui/Project.tsx +++ b/storefront/src/ui/Project.tsx @@ -70,9 +70,9 @@ const SupabaseProject = ({ return (
- + Database - +
- + - +
{project.id}
- Version + Version
{project.database?.version}
- Region + Region
{project.region}
- Status + Status
- Created + Created
{dayjs(project.created_at).fromNow()} @@ -263,12 +263,15 @@ const SupafanaProject = ({ - + Grafana - + - State + State {state === "Running" && ( {plan !== "Trial" && ( - Plan - )} {plan === "Trial" && grafana.first_start_at && ( - {trialEnded ? Trial ended : Trial ends} + {trialEnded ? ( + Trial ended + ) : ( + Trial ends + )} - Created + Created @@ -412,7 +419,7 @@ const SupafanaProject = ({ )} {grafana.state === "Running" && ( - User/pass + User/pass + ); +}; + +const RowDivHeader = ({ children, className, }: { diff --git a/storefront/tailwind.config.cjs b/storefront/tailwind.config.cjs index d37df40..418096a 100644 --- a/storefront/tailwind.config.cjs +++ b/storefront/tailwind.config.cjs @@ -1,4 +1,6 @@ /** @type {import('tailwindcss').Config} */ +const plugin = require("tailwindcss/plugin"); + module.exports = { presets: [require("./src/supafana.tailwind.preset.js")], content: [ @@ -19,5 +21,23 @@ module.exports = { }), }, }, - plugins: [require("@tailwindcss/custom-forms"), require("@tailwindcss/typography")], + plugins: [ + require("@tailwindcss/custom-forms"), + require("@tailwindcss/typography"), + // https://github.com/tailwindlabs/tailwindcss/discussions/2494#discussion-22808 + plugin(function ({ addUtilities, addComponents, e, prefix, config }) { + const newUtilities = { + ".horizontal-tb": { + writingMode: "horizontal-tb", + }, + ".vertical-rl": { + writingMode: "vertical-rl", + }, + ".vertical-lr": { + writingMode: "vertical-lr", + }, + }; + addUtilities(newUtilities); + }), + ], };
- {state} + {state} @@ -361,19 +364,23 @@ const SupafanaProject = ({
+ Plan + {plan}
{dayjs(grafana.first_start_at).add(grafana.trial_length_min, "minute").fromNow()} @@ -404,7 +411,7 @@ const SupafanaProject = ({ */} {created && (
{created}
admin @@ -440,7 +447,21 @@ const ProjectRow = ({ children }: { children: JSX.Element[] }) => { ); }; -const RowHeader = ({ +const RowTdHeader = ({ + children, + className, +}: { + children: JSX.Element | string; + className?: string; +}) => { + return ( + + {children} +