Skip to content

Commit

Permalink
format: files
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTRy committed Dec 14, 2023
1 parent 7a6d0d3 commit fb21b71
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/Routes/ChipsRoute/ChipsRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import React from 'react';


import { DesignArea, DesignWrapper } from '../DesignWrapper/Wrapper';
import ClipBoardIconCheck from '../../components/icons/SVGClipBoardIconChecked/SVGClipBoardIconChecked';
import { FancyCard } from '@/components/atoms/FancyCard';
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/FancyPill/FancyPill.model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { CSSProp } from 'styled-components';

import { TLayer } from '@/interface/TLayer';
Expand All @@ -14,4 +13,4 @@ export interface IFancyPill {
isActive?: boolean;
}

export type IFancyPillProps= IFancyPill & React.HTMLAttributes<HTMLDivElement>;
export type IFancyPillProps = IFancyPill & React.HTMLAttributes<HTMLDivElement>;
2 changes: 1 addition & 1 deletion src/components/atoms/FancyPill/FancyPill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { StyledFancyPill } from '@/components/atoms/FancyPill/FancyPill.styled';
// --------------------------------------------------------------------------- //
// -------------- A Pill can be used for style and user actions ------------- //
// --------------------------------------------------------------------------- //
export default function FancyPill(props: IFancyPill ) {
export default function FancyPill(props: IFancyPill) {
const { layer, themeType, outlined, outlinedBackgroundStrength, externalStyle, ...htmlProps } = props;

return (
Expand Down
6 changes: 2 additions & 4 deletions src/components/molecules/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export type TChipProps = IChipProps & IFancyPillProps;
export default function Chip(props: TChipProps) {
const { outlined, themeType, layer, isActive, externalStyle, children, ...htmlProps } = props;


return (
<RawLI>
<FancyPill
Expand All @@ -34,7 +33,6 @@ export default function Chip(props: TChipProps) {
);
}


Chip.DeleteButton = ChipDeleteButton;
Chip.Img = ChipImg
Chip.Content = FancyContent
Chip.Img = ChipImg;
Chip.Content = FancyContent;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { FancyImage } from '@/components/atoms/FancyImage';

type IFancyChipImgProps = React.ComponentProps<typeof FancyImage>;
export default function ChipImg(props: IFancyChipImgProps) {

return (
<WrapperImage>
<FancyImage alt="chip" {...props} />
Expand Down
6 changes: 5 additions & 1 deletion src/components/organisms/FancyChipList/FancyChipList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export default function FancyChipList(props: ChipListProps) {
return (
<Fieldset label={label} fontVariantLegend="button">
<ChipList themeType={themeType} layer={layer} outlined={true} size={size} systemMessage={systemInformation}>
<FancyChip image='https://www.az-online.de/bilder/2019/08/23/12938342/2113799823-tobias-rester-2tyMMSkM2R73.jpg' label='Hiii' onDelete={() => console.log('assa')} />
<FancyChip
image="https://www.az-online.de/bilder/2019/08/23/12938342/2113799823-tobias-rester-2tyMMSkM2R73.jpg"
label="Hiii"
onDelete={() => console.log('assa')}
/>
{/* // Mapping through each chip in the state to render a FancyChip */}
{chipsWithKeys.map((chip, index) => (
<Chip
Expand Down
23 changes: 12 additions & 11 deletions src/components/templates/FancyChip/FancyChip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { TChipProps } from '@/components/molecules/Chip/Chip';
import { TSpacingPosition, generateSpacing } from '@/components/templates/FancyChip/utils/generateSpacings';
import { sizes } from '@/components/templates/FancyChip/sizeSettings';


type TFancyChip = {
image?: string;
label?: string;
Expand All @@ -15,7 +14,7 @@ type TFancyChip = {
sizes?: keyof typeof sizes;
} & TChipProps;
export default function FancyChip(props: TFancyChip) {
const { label, icon, image, onDelete, layer = 3, themeType, sizes, externalStyle,...htmlProps } = props;
const { label, icon, image, onDelete, layer = 3, themeType, sizes, externalStyle, ...htmlProps } = props;

// Define a function to calculate the spacing position for the chip
const clacPosition = (): TSpacingPosition => {
Expand All @@ -30,7 +29,7 @@ export default function FancyChip(props: TFancyChip) {
// Calculate the spacing position for the chip
const getCalcPosition = clacPosition();

console.log('getCalcPosition', getCalcPosition)
console.log('getCalcPosition', getCalcPosition);

return (
<Chip
Expand All @@ -43,15 +42,17 @@ export default function FancyChip(props: TFancyChip) {
`}
{...htmlProps}
>

{image && <Chip.Img src={image} />}
{label || icon && (
<Chip.Content>
{icon && <Chip.Content.Icon>{icon}</Chip.Content.Icon>}
<Chip.Content.Title bold={false} fontVariant='content'>{label}</Chip.Content.Title>
</Chip.Content>
)}
{onDelete && <Chip.DeleteButton />}
{label ||
(icon && (
<Chip.Content>
{icon && <Chip.Content.Icon>{icon}</Chip.Content.Icon>}
<Chip.Content.Title bold={false} fontVariant="content">
{label}
</Chip.Content.Title>
</Chip.Content>
))}
{onDelete && <Chip.DeleteButton />}
</Chip>
);
}

0 comments on commit fb21b71

Please sign in to comment.