From 5edf1e2a766805d2745a29eadb7a9867abb9b583 Mon Sep 17 00:00:00 2001 From: MrTRyy Date: Sun, 17 Dec 2023 22:08:10 +0100 Subject: [PATCH] format: files --- src/Routes/BottonRoute/ButtonRoute.tsx | 6 +++--- src/Routes/MiniProfileRoute/MiniProfileroute.tsx | 5 ++--- src/Routes/ModalRoute/ModalRoute.tsx | 6 +++--- src/Routes/Switches/SwitchesRoute.tsx | 11 +++++++---- src/Routes/TabSwitchRoute/TabSwitchRoute.tsx | 1 - src/components/atoms/RawButton/index.ts | 2 +- src/components/molecules/Chip/sizeSettings.ts | 1 - .../molecules/FancyContent/FancyContent.model.ts | 3 +-- .../molecules/FancyContent/FancyContent.tsx | 2 +- .../molecules/FancyTabSwitch/FancyTabSwitch.tsx | 3 +-- .../FancyTabSwitchButton.style.tsx | 7 ++++--- .../molecules/InputWrapper/InputWrapper.style.tsx | 2 +- .../molecules/MiniProfile/MiniProfile.style.tsx | 4 +--- src/components/molecules/MiniProfile/MiniProfile.tsx | 5 +---- .../components/MiniProfileImage/MiniProfileImage.tsx | 9 +++------ src/components/molecules/MiniProfile/sizeSettings.ts | 8 ++++---- .../organisms/FancyChipList/FancyChipList.tsx | 2 +- src/components/templates/FancyChip/FancyChip.tsx | 2 +- .../templates/FancyChip/utils/generateSpacings.ts | 7 +++---- src/design/theme/globalSizes.ts | 7 +------ 20 files changed, 39 insertions(+), 54 deletions(-) diff --git a/src/Routes/BottonRoute/ButtonRoute.tsx b/src/Routes/BottonRoute/ButtonRoute.tsx index 5087fbc80..74dc277ba 100644 --- a/src/Routes/BottonRoute/ButtonRoute.tsx +++ b/src/Routes/BottonRoute/ButtonRoute.tsx @@ -30,9 +30,9 @@ export default function ButtonRoute() { - - - + + + diff --git a/src/Routes/MiniProfileRoute/MiniProfileroute.tsx b/src/Routes/MiniProfileRoute/MiniProfileroute.tsx index 010bd8285..cdd411197 100644 --- a/src/Routes/MiniProfileRoute/MiniProfileroute.tsx +++ b/src/Routes/MiniProfileRoute/MiniProfileroute.tsx @@ -12,13 +12,12 @@ export default function MiniProfileroute() {
- - +
- + - - - + + + ); } diff --git a/src/Routes/Switches/SwitchesRoute.tsx b/src/Routes/Switches/SwitchesRoute.tsx index d0c9f0843..9b790a816 100644 --- a/src/Routes/Switches/SwitchesRoute.tsx +++ b/src/Routes/Switches/SwitchesRoute.tsx @@ -13,9 +13,12 @@ export default function SwitchesRoute() { return ( - + } /> @@ -23,7 +26,7 @@ export default function SwitchesRoute() { - + diff --git a/src/Routes/TabSwitchRoute/TabSwitchRoute.tsx b/src/Routes/TabSwitchRoute/TabSwitchRoute.tsx index 600a5a38c..03e86b432 100644 --- a/src/Routes/TabSwitchRoute/TabSwitchRoute.tsx +++ b/src/Routes/TabSwitchRoute/TabSwitchRoute.tsx @@ -116,7 +116,6 @@ export default function TabSwitchRoute() { outlined rounded="complete" size="sm" - layer={3} values={switchValues1} currentSelect={test} diff --git a/src/components/atoms/RawButton/index.ts b/src/components/atoms/RawButton/index.ts index b2a72a4d8..7714b9dee 100644 --- a/src/components/atoms/RawButton/index.ts +++ b/src/components/atoms/RawButton/index.ts @@ -1 +1 @@ -export { default as RawButton } from './RawButton'; \ No newline at end of file +export { default as RawButton } from './RawButton'; diff --git a/src/components/molecules/Chip/sizeSettings.ts b/src/components/molecules/Chip/sizeSettings.ts index 9de7fd611..5bb76604e 100644 --- a/src/components/molecules/Chip/sizeSettings.ts +++ b/src/components/molecules/Chip/sizeSettings.ts @@ -1,4 +1,3 @@ - export const sizesSettings = { sm: { height: '16px', diff --git a/src/components/molecules/FancyContent/FancyContent.model.ts b/src/components/molecules/FancyContent/FancyContent.model.ts index 9cd1dab6e..0b84e6efe 100644 --- a/src/components/molecules/FancyContent/FancyContent.model.ts +++ b/src/components/molecules/FancyContent/FancyContent.model.ts @@ -5,5 +5,4 @@ export type TFancyContentProps = { gapBetweenText?: string; gapBetweenIcon?: string; children?: React.ReactNode; -} - +}; diff --git a/src/components/molecules/FancyContent/FancyContent.tsx b/src/components/molecules/FancyContent/FancyContent.tsx index 9aa6f5b7c..3c9d71792 100644 --- a/src/components/molecules/FancyContent/FancyContent.tsx +++ b/src/components/molecules/FancyContent/FancyContent.tsx @@ -42,7 +42,7 @@ function FancyContent(props: TFancyContentProps & React.HTMLAttributes {children} diff --git a/src/components/molecules/FancyTabSwitch/FancyTabSwitch.tsx b/src/components/molecules/FancyTabSwitch/FancyTabSwitch.tsx index a033a4d6e..3c1a76136 100644 --- a/src/components/molecules/FancyTabSwitch/FancyTabSwitch.tsx +++ b/src/components/molecules/FancyTabSwitch/FancyTabSwitch.tsx @@ -8,7 +8,6 @@ import { FancyBox } from '@/components/atoms/FancyBox'; import { tabSwitchSizes } from '@/components/molecules/TabSwitch/TabSwitch.style'; import { ITabSwitchProps } from '@/components/molecules/TabSwitch/TabSwitch.model'; - // --------------------------------------------------------------------------- // // ----- The FancyTabswich has more advanced features like Label etc. ------- // // --------------------------------------------------------------------------- // @@ -27,7 +26,7 @@ export default function FancyTabSwitch(props: ITabSwitchProps & { label?: string border-radius: ${rounded && borderRadius[rounded]}; overflow: hidden; background-color: ${themeType === 'transparent' && 'transparent'}; - border: ${themeType === 'transparent' && 'solid 1.5px transparent'}; + border: ${themeType === 'transparent' && 'solid 1.5px transparent'}; width: ${wide ? '100%' : 'fit-content'}; `} > diff --git a/src/components/molecules/FancyTabSwitchButton/FancyTabSwitchButton.style.tsx b/src/components/molecules/FancyTabSwitchButton/FancyTabSwitchButton.style.tsx index d23b001d0..bf231b920 100644 --- a/src/components/molecules/FancyTabSwitchButton/FancyTabSwitchButton.style.tsx +++ b/src/components/molecules/FancyTabSwitchButton/FancyTabSwitchButton.style.tsx @@ -71,9 +71,10 @@ export const SwitchButtonStyle = styled.div` text-align: center; cursor: pointer; user-select: none; - padding: ${({$size, theme}) => `${tabSwitchItemSizes[$size || 'sm'].padding} ${theme.spacing.md}` } ; - color: ${({theme, $textColor = 'secondary', $layer}) => getBackgroundColor({ theme, $themeType: $textColor, $layer })}; - ${({$hasIcon, $hasLabel, $iconAlign}) => $hasIcon && $hasLabel && generateIconAlignment({ $iconAlign })} + padding: ${({ $size, theme }) => `${tabSwitchItemSizes[$size || 'sm'].padding} ${theme.spacing.md}`}; + color: ${({ theme, $textColor = 'secondary', $layer }) => + getBackgroundColor({ theme, $themeType: $textColor, $layer })}; + ${({ $hasIcon, $hasLabel, $iconAlign }) => $hasIcon && $hasLabel && generateIconAlignment({ $iconAlign })} } input { diff --git a/src/components/molecules/InputWrapper/InputWrapper.style.tsx b/src/components/molecules/InputWrapper/InputWrapper.style.tsx index 7221da7b6..c5878f070 100644 --- a/src/components/molecules/InputWrapper/InputWrapper.style.tsx +++ b/src/components/molecules/InputWrapper/InputWrapper.style.tsx @@ -43,7 +43,7 @@ export const InputContainer = styled.div<{ css` padding-top: ${parseFloat(theme.spacing.lg) + 2 + 'px'}; `}; - + position: relative; input { diff --git a/src/components/molecules/MiniProfile/MiniProfile.style.tsx b/src/components/molecules/MiniProfile/MiniProfile.style.tsx index 596613dba..f77905bb8 100644 --- a/src/components/molecules/MiniProfile/MiniProfile.style.tsx +++ b/src/components/molecules/MiniProfile/MiniProfile.style.tsx @@ -3,8 +3,6 @@ import { styled } from 'styled-components'; import { FancyPill } from '@/components/atoms/FancyPill'; import { sizeSettings } from '@/components/molecules/MiniProfile/sizeSettings'; - - export const StyledMiniProfile = styled(FancyPill)` display: inline-flex; align-items: center; @@ -18,6 +16,6 @@ export const StyledMiniProfile = styled(FancyPill)` .profile_content span { margin-right: 4px; - line-height: 1.1 ; + line-height: 1.1; } `; diff --git a/src/components/molecules/MiniProfile/MiniProfile.tsx b/src/components/molecules/MiniProfile/MiniProfile.tsx index b5d8a4067..86b8e0d7a 100644 --- a/src/components/molecules/MiniProfile/MiniProfile.tsx +++ b/src/components/molecules/MiniProfile/MiniProfile.tsx @@ -2,8 +2,6 @@ import { StyledMiniProfile } from '@/components/molecules/MiniProfile/MiniProfil import { FancyImage } from '@/components/atoms/FancyImage'; import { FancyContent } from '@/components/molecules/FancyContent'; - - export default function MiniProfile() { return ( @@ -12,7 +10,7 @@ export default function MiniProfile() { src="https://www.az-online.de/bilder/2019/08/23/12938342/2113799823-tobias-rester-2tyMMSkM2R73.jpg" /> - + Tobiii @@ -24,5 +22,4 @@ export default function MiniProfile() { ); } - MiniProfile.Image = FancyImage; diff --git a/src/components/molecules/MiniProfile/components/MiniProfileImage/MiniProfileImage.tsx b/src/components/molecules/MiniProfile/components/MiniProfileImage/MiniProfileImage.tsx index dafa35f87..c17031cca 100644 --- a/src/components/molecules/MiniProfile/components/MiniProfileImage/MiniProfileImage.tsx +++ b/src/components/molecules/MiniProfile/components/MiniProfileImage/MiniProfileImage.tsx @@ -1,10 +1,7 @@ -import React from 'react' - -import { FancyProfilePicture } from '@/components/atoms/FancyProfilePicture' +import React from 'react'; +import { FancyProfilePicture } from '@/components/atoms/FancyProfilePicture'; export default function MiniProfileImage() { - return ( - - ) + return ; } diff --git a/src/components/molecules/MiniProfile/sizeSettings.ts b/src/components/molecules/MiniProfile/sizeSettings.ts index cb80cd076..8c38f0e7c 100644 --- a/src/components/molecules/MiniProfile/sizeSettings.ts +++ b/src/components/molecules/MiniProfile/sizeSettings.ts @@ -1,14 +1,14 @@ export const sizeSettings = { sm: { image: '24px', - gapImageText: '4px' + gapImageText: '4px', }, md: { image: '32px', - gapImageText: '6px' + gapImageText: '6px', }, lg: { image: '40px', - gapImageText: '8px' + gapImageText: '8px', }, -} \ No newline at end of file +}; diff --git a/src/components/organisms/FancyChipList/FancyChipList.tsx b/src/components/organisms/FancyChipList/FancyChipList.tsx index 575636c54..26862296c 100644 --- a/src/components/organisms/FancyChipList/FancyChipList.tsx +++ b/src/components/organisms/FancyChipList/FancyChipList.tsx @@ -56,7 +56,7 @@ export default function FancyChipList(props: ChipListProps) { {/* // Mapping through each chip in the state to render a FancyChip */} {chipsWithKeys.map((chip, index) => ( -
  • +
  • {image && } {(label || icon) && ( - + {icon && {icon}} {label} diff --git a/src/components/templates/FancyChip/utils/generateSpacings.ts b/src/components/templates/FancyChip/utils/generateSpacings.ts index 1e70cc60b..cb595b979 100644 --- a/src/components/templates/FancyChip/utils/generateSpacings.ts +++ b/src/components/templates/FancyChip/utils/generateSpacings.ts @@ -1,10 +1,9 @@ import { css } from 'styled-components'; -import { themeStore } from "@/design/theme/themeStore"; -import { TComponentSizes } from "@/interface/TComponentSizes"; +import { themeStore } from '@/design/theme/themeStore'; +import { TComponentSizes } from '@/interface/TComponentSizes'; export type TSpacingPosition = 'left' | 'right' | 'booth'; - const getSpacingFromTheme = themeStore.getState().theme.spacing; const sizesSettings = { sm: { @@ -22,7 +21,7 @@ const sizesSettings = { paddingRight: getSpacingFromTheme.sm, paddingLeft: getSpacingFromTheme.md, }, -} +}; // Define a function to generate the spacing based on the spacing position interface IGenerateSpacing { diff --git a/src/design/theme/globalSizes.ts b/src/design/theme/globalSizes.ts index 6e79fad6c..bedb2dc2e 100644 --- a/src/design/theme/globalSizes.ts +++ b/src/design/theme/globalSizes.ts @@ -1,6 +1,3 @@ - - - // - **XXS (Extra Extra Small)** // - **Padding/Margin**: 4px (0.5x base unit) // - **Font Size**: 10px or 12px @@ -36,8 +33,6 @@ // - **Font Size**: 24px or larger // - **Element Size**: 64px or more (e.g., major screen elements, large icons) - - // eslint-disable-next-line @typescript-eslint/no-unused-vars const globalSizes = { xxs: { @@ -75,4 +70,4 @@ const globalSizes = { fontSize: '24px', elementSize: '64px', }, -} \ No newline at end of file +};