1.3.0 • Published 1 year ago

antik-code-challenge v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

antik code challenge - react package

NPM version Build npm-typescriptLicense]github-license-url

Installation:

npm i antik-code-challenge

or

yarn add antik-code-challenge

Usage :

Add 'AntikCodeChallenge' to your component:

import { AntikCodeChallenge } from 'antik-code-challenge';

<>
  <AntikCodeChallenge
    productId={'123456'}
    price={45.99}
    currency={'€'}
    title={'Example title'}
    description={'Example description'}
    image={'https://placebear.com/g/200/200'}
    imageAlt='Example image alt'
  />
</>

Models :

interface AntikCodeChallengeProps {
    productId: string;
    price: number;
    currency: string;
    title?: string;
    description?: string;
    image?: string;
    imageAlt?: string;
    defaultButtonProps?: ButtonProps;
    modalProps?: ModalProps;
    customButton?: ReactNode;
}

Rich variety of possible customization: property "defaultButtonProps" gives possibility to customize button which initializes AntikCodeChallenge modal, if someone would like to use own initializing button, then "defaultButtonProps" property should persist undefined and "customButton" should be provided with desired button

interface ButtonProps {
    label: string;
    id?: string;
    type?: 'button' | 'submit' | 'reset';
    disabled?: boolean;
    fontSize?: string;
    margin?: string;
    padding?: string;
    backgroundColor?: string;
    borderRadius?: string;
    lineHeight?: string;
    textColor?: string;
    fontFamily?: string;
    fontWeight?: string;
    boxShadow?: string;
    border?: string;
    backgroundOnHover?: string;
    display?: string;
    position?: string;
    top?: string;
    left?: string;
    bottom?: string;
    right?: string;
    justifyContent?: string;
    width?: string;
}

There is also possibility to customize AntikCodeChallenge modal, by providing desired styles to "modalProps" property

interface ModalProps {
  position?: string;
  top?: string;
  left?: string;
  bottom?: string;
  right?: string;
  display?: string;
  width?: string;
  minHeight?: string;
  backgroundColor?: string;
  animation?: string | boolean;
  padding?: string;
  withCloseIcon?: boolean;
  justifyContent?: string;
  flexDirection?: string;
  alignItems?: string;
  textAlign?: string;
}
1.3.0

1 year ago

1.2.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago