diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..b14d30ec --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +*.scss diff --git a/src/common/Button.tsx b/src/common/Button.tsx index 4e9fa2d6..5f4f93b0 100644 --- a/src/common/Button.tsx +++ b/src/common/Button.tsx @@ -7,11 +7,12 @@ export interface ButtonProps extends FlexProps { variant?: ColorVariantType; size?: ButtonSizeType; + disabled?: boolean; } export const Button: FC = props => { - const { variant = 'primary', size = null, classNames = [], ...rest } = props; + const { variant = 'primary', size = null, disabled = false, classNames = [], ...rest } = props; const getClassNames = useMemo(() => { @@ -21,10 +22,12 @@ export const Button: FC = props => if(size) newClassNames.push('btn-' + size); + if(disabled) newClassNames.push('disabled'); + if(classNames.length) newClassNames.push(...classNames); return newClassNames; - }, [ variant, size, classNames ]); + }, [ variant, size, disabled, classNames ]); return ; } diff --git a/src/common/Grid.tsx b/src/common/Grid.tsx index a580912c..dd91cbd1 100644 --- a/src/common/Grid.tsx +++ b/src/common/Grid.tsx @@ -17,7 +17,9 @@ export const Grid: FC = props => const getClassNames = useMemo(() => { - const newClassNames: string[] = [ 'h-100' ]; + const newClassNames: string[] = []; + + if(!grow) newClassNames.push('h-100'); if(inline) newClassNames.push('inline-grid'); else newClassNames.push('grid'); @@ -27,7 +29,7 @@ export const Grid: FC = props => if(classNames.length) newClassNames.push(...classNames); return newClassNames; - }, [ inline, gap, classNames ]); + }, [ grow, inline, gap, classNames ]); const getStyle = useMemo(() => { diff --git a/src/common/Text.tsx b/src/common/Text.tsx index 4f8dfc52..81612f2b 100644 --- a/src/common/Text.tsx +++ b/src/common/Text.tsx @@ -1,19 +1,22 @@ import { FC, useMemo } from 'react'; import { Base, BaseProps } from './Base'; import { ColorVariantType } from './types/ColorVariantType'; +import { FontSizeType } from './types/FontSizeType'; import { FontWeightType } from './types/FontWeightType'; export interface TextProps extends BaseProps { variant?: ColorVariantType; fontWeight?: FontWeightType; + fontSize?: FontSizeType; underline?: boolean; + truncate?: boolean; center?: boolean; } export const Text: FC = props => { - const { variant = 'black', fontWeight = null, underline = false, center = false, ...rest } = props; + const { variant = 'black', fontWeight = null, fontSize = 0, underline = false, truncate = false, center = false, ...rest } = props; const getClassNames = useMemo(() => { @@ -23,12 +26,16 @@ export const Text: FC = props => if(fontWeight) newClassNames.push('fw-' + fontWeight); + if(fontSize) newClassNames.push('fs-' + fontSize); + if(underline) newClassNames.push('text-decoration-underline'); + if(truncate) newClassNames.push('text-truncate'); + if(center) newClassNames.push('text-center'); return newClassNames; - }, [ variant, fontWeight, underline, center ]); + }, [ variant, fontWeight, fontSize, underline, truncate, center ]); return ; } diff --git a/src/common/types/FontSizeType.ts b/src/common/types/FontSizeType.ts new file mode 100644 index 00000000..a6b28c93 --- /dev/null +++ b/src/common/types/FontSizeType.ts @@ -0,0 +1 @@ +export type FontSizeType = 1 | 2 | 3 | 4 | 5; diff --git a/src/index.scss b/src/index.scss index d5baf038..d655fc16 100644 --- a/src/index.scss +++ b/src/index.scss @@ -1,4 +1,3 @@ -@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Condensed:wght@300;400;500&display=swap'); @import './assets/styles'; html, diff --git a/src/layout/card/header/NitroCardHeaderView.tsx b/src/layout/card/header/NitroCardHeaderView.tsx index 293f163a..17c580e8 100644 --- a/src/layout/card/header/NitroCardHeaderView.tsx +++ b/src/layout/card/header/NitroCardHeaderView.tsx @@ -1,3 +1,4 @@ +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FC, MouseEvent, useCallback } from 'react'; import { useNitroCardContext } from '../context/NitroCardContext'; import { NitroCardHeaderViewProps } from './NitroCardHeaderView.types'; @@ -21,7 +22,7 @@ export const NitroCardHeaderView: FC = props =>
{ headerText }
- +
@@ -35,7 +36,7 @@ export const NitroCardHeaderView: FC = props =>
{ headerText }
- +
diff --git a/src/views/shared/limited-edition/compact-plate/LimitedEditionCompactPlateView.tsx b/src/views/shared/limited-edition/compact-plate/LimitedEditionCompactPlateView.tsx index 29440b99..f458d88d 100644 --- a/src/views/shared/limited-edition/compact-plate/LimitedEditionCompactPlateView.tsx +++ b/src/views/shared/limited-edition/compact-plate/LimitedEditionCompactPlateView.tsx @@ -1,19 +1,30 @@ -import { FC } from 'react'; +import { FC, useMemo } from 'react'; +import { Base } from '../../../../common/Base'; import { LimitedEditionStyledNumberView } from '../styled-number/LimitedEditionStyledNumberView'; import { LimitedEditionCompactPlateViewProps } from './LimitedEditionCompactPlateView.types'; export const LimitedEditionCompactPlateView: FC = props => { - const { uniqueNumber = 0, uniqueSeries = 0 } = props; + const { uniqueNumber = 0, uniqueSeries = 0, classNames = [], children = null, ...rest } = props; + + const getClassNames = useMemo(() => + { + const newClassNames: string[] = [ 'unique-compact-plate', 'z-index-1' ]; + + if(classNames.length) newClassNames.push(...classNames); + + return newClassNames; + }, [ classNames ]); return ( -
+
-
+ { children } + ); } diff --git a/src/views/shared/limited-edition/compact-plate/LimitedEditionCompactPlateView.types.ts b/src/views/shared/limited-edition/compact-plate/LimitedEditionCompactPlateView.types.ts index 8eb893e2..10d371f2 100644 --- a/src/views/shared/limited-edition/compact-plate/LimitedEditionCompactPlateView.types.ts +++ b/src/views/shared/limited-edition/compact-plate/LimitedEditionCompactPlateView.types.ts @@ -1,4 +1,6 @@ -export interface LimitedEditionCompactPlateViewProps +import { BaseProps } from '../../../../common/Base'; + +export interface LimitedEditionCompactPlateViewProps extends BaseProps { uniqueNumber: number; uniqueSeries: number; diff --git a/src/views/shared/rarity-level/RarityLevelView.tsx b/src/views/shared/rarity-level/RarityLevelView.tsx index 50b3cdc3..1b99f36f 100644 --- a/src/views/shared/rarity-level/RarityLevelView.tsx +++ b/src/views/shared/rarity-level/RarityLevelView.tsx @@ -1,13 +1,24 @@ -import { FC } from 'react'; +import { FC, useMemo } from 'react'; +import { Base } from '../../../common/Base'; import { RarityLevelViewProps } from './RarityLevelView.types'; export const RarityLevelView: FC = props => { - const { level = 0 } = props; + const { level = 0, classNames = [], children = null, ...rest } = props; + + const getClassNames = useMemo(() => + { + const newClassNames: string[] = [ 'nitro-rarity-level' ]; + + if(classNames.length) newClassNames.push(...classNames); + + return newClassNames; + }, [ classNames ]); return ( -
+
{ level }
-
+ { children } + ); } diff --git a/src/views/shared/rarity-level/RarityLevelView.types.ts b/src/views/shared/rarity-level/RarityLevelView.types.ts index e0bc2d80..9abaab54 100644 --- a/src/views/shared/rarity-level/RarityLevelView.types.ts +++ b/src/views/shared/rarity-level/RarityLevelView.types.ts @@ -1,4 +1,6 @@ -export interface RarityLevelViewProps +import { BaseProps } from '../../../common/Base'; + +export interface RarityLevelViewProps extends BaseProps { level: number; }