From 84868b3d52df4df18f2ede5a6d46d42910c7a085 Mon Sep 17 00:00:00 2001 From: honzapatCZ Date: Thu, 17 Oct 2024 23:19:38 +0200 Subject: [PATCH] move to nru --- Flag.tsx | 12 -------- Form/index.js | 0 Parts/Badge.js | 17 +++++++++++ globalStyle.js | 75 ----------------------------------------------- styledRegistry.js | 25 ---------------- 5 files changed, 17 insertions(+), 112 deletions(-) delete mode 100644 Flag.tsx delete mode 100644 Form/index.js create mode 100644 Parts/Badge.js delete mode 100644 globalStyle.js delete mode 100644 styledRegistry.js diff --git a/Flag.tsx b/Flag.tsx deleted file mode 100644 index 799775c..0000000 --- a/Flag.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { Country } from "@services/accounting-api"; -import { lazy, Suspense } from 'react'; - -export default function Flag({ country, ...props }: { country: Country | "EU" }) { - const FlagIcon = lazy(() => import(`country-flag-icons/react/3x2`).then(module => ({ default: module[country] }))); - - return ( - ...}> - - - ); -} \ No newline at end of file diff --git a/Form/index.js b/Form/index.js deleted file mode 100644 index e69de29..0000000 diff --git a/Parts/Badge.js b/Parts/Badge.js new file mode 100644 index 0000000..385b58c --- /dev/null +++ b/Parts/Badge.js @@ -0,0 +1,17 @@ +import { useTranslation } from "react-i18next"; +import tw, { styled } from "twin.macro"; +import "styled-components/macro"; + +export function Badge({ color, text, ...props }) { + const colors = { + yellow: tw`bg-yellow-500`, + gray: tw`bg-gray-500`, + red: tw`bg-red-700`, + }; + + const realColor = (typeof(color) === "string" && color in colors) ? colors[color] : color; + + return ( +

{text}

+ ); +} diff --git a/globalStyle.js b/globalStyle.js deleted file mode 100644 index 7852492..0000000 --- a/globalStyle.js +++ /dev/null @@ -1,75 +0,0 @@ -import { createGlobalStyle } from "styled-components" -import tw, { theme, GlobalStyles as BaseStyles } from "twin.macro" - -const CustomStyles = createGlobalStyle` -body { - -webkit-tap-highlight-color: ${theme`colors.accent`}; -} - -:root{ - --primary: #3d3d3d; - --secondary: #535353; - --trinary: #2c2c2c; - - --primary-text: #ffffff; - --secondary-text: #a0a0a0; - - --primary-invert: #f3f3f3; - --secondary-invert: #dbdbdb; - --trinary-invert: #ffffff; - - --primary-invert-text: #3d3d3d; - --secondary-invert-text: #535353; - - --accent: #00C800; - --accent-dark: #008f00; - --accent-light: #00ed00; - --accent2: #3080FF; - --accent2-dark: #225ab4; - --accent3: #804000; - --accent3-dark: #472400; - --accent4: #F8B02C; - --accent4-dark: #bd8724; - --accent5: #9E3086; - --accent5-dark: #6b215b; -} - -.light\-theme{ - --primary: #f3f3f3; - --secondary: #dbdbdb; - --trinary: #ffffff; - --primary-text: #3d3d3d; - --secondary-text: #535353; - - - --primary-invert: #3d3d3d; - --secondary-invert: #535353; - --trinary-invert: #2c2c2c; - --primary-text-invert: #ffffff; - --secondary-text-invert: #a0a0a0; -} - - -::-webkit-scrollbar { - width: 0.5rem; -} -::-webkit-scrollbar-track { - background: transparent; -} -::-webkit-scrollbar-thumb { - background: var(--secondary); - border-radius: 0.25rem; -} -::-webkit-scrollbar-thumb:hover { - background: var(--accent-dark); -} -` - -const GlobalStyles = ({dontApplyBaseStyles}) => { - return <> - {(!dontApplyBaseStyles) &&} - - -} - -export default GlobalStyles \ No newline at end of file diff --git a/styledRegistry.js b/styledRegistry.js deleted file mode 100644 index 10da128..0000000 --- a/styledRegistry.js +++ /dev/null @@ -1,25 +0,0 @@ -'use client' - -import React, { useState } from 'react' -import { useServerInsertedHTML } from 'next/navigation' -import { ServerStyleSheet, StyleSheetManager } from 'styled-components' - -export default function StyledComponentsRegistry({ children }) { - // Only create stylesheet once with lazy initial state - // x-ref: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state - const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet()) - - useServerInsertedHTML(() => { - const styles = styledComponentsStyleSheet.getStyleElement() - styledComponentsStyleSheet.instance.clearTag() - return <>{styles} - }) - - if (typeof window !== 'undefined') return <>{children} - - return ( - - {children} - - ) -} \ No newline at end of file