0.1.7 • Published 1 year ago

bettrdash-react v0.1.7

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

bettrdash-react

npm npm

A component that renders a users projects from the Bettrdash API.

Install

npm install --save bettrdash-react

or

yarn add bettrdash-react

Usage

Note: This component requires an API key to be passed in as a prop. If you do not have an API key, please visit BettrDash to get one.

BettrGrid Component

import { BettrGrid } from 'bettrdash-react';
import "bettrdash-react/styles.css";

const Component = () => {
  return (
    <BettrGrid
      apiKey="api-key"
      style={{
        imageBackgroundColor: 'black',
      }}
    />
  );
};

export default Component;

BettrList Component

import { BettrList } from 'bettrdash-react';
import "bettrdash-react/styles.css";

const Component = () => {
  return (
    <BettrList
      apiKey="api-key"
      style={{
        imageBackgroundColor: 'black',
      }}
    />
  );
};

export default Component;

BettrGrid/BettrList Component Props

PropertyTypeRequiredDefaultDescription
apiKeyStringtrue-Api key from BettrDash dashboard
stylesObjectfalse-How to style the cards (refer to style props table for styling optoins)

Card Component

The card component can also be imported directly from the library.

import { Card } from 'bettrdash-react';

const Component = () => {
  const project = {
    active: true,
    createdAt: '2022-06-09T02:09:52.026Z',
    description: 'The dashboard for developers',
    github_url: 'https://github.com/HelixHEX/bettrdash',
    image_url:
      'https://blog.addthiscdn.com/wp-content/uploads/2015/11/code.png',
    language: 'Javascript',
    live_url: 'https://bettrdash.eliaswambugu.com',
    name: 'BettrDash',
    updatedAt: '2022-09-12T17:52:50.992Z',
  };
  return (
    <Card
      style={{
        imageBackgroundColor: 'black',
      }}
      project={project}
    />
  );
};

export default Component;

ListCard Component

The list card component can also be imported directly from the library.

import { ListCard } from 'bettrdash-react';

const Component = () => {
  const project = {
    active: true,
    createdAt: '2022-06-09T02:09:52.026Z',
    description: 'The dashboard for developers',
    github_url: 'https://github.com/HelixHEX/bettrdash',
    image_url:
      'https://blog.addthiscdn.com/wp-content/uploads/2015/11/code.png',
    language: 'Javascript',
    live_url: 'https://bettrdash.eliaswambugu.com',
    name: 'BettrDash',
    updatedAt: '2022-09-12T17:52:50.992Z',
  };
  return (
    <ListCard
      style={{
        imageBackgroundColor: 'black',
      }}
      project={project}
    />
  );
};

export default Component;

Card/ListCard Component Props

PropertyTypeRequiredDefaultDescription
projectObjecttrue-Project object returned from the BettrDash API
stylesObjectfalse-How to style the cards (refer to style props table for styling optoins)

Style Props

Note: Styles can be further edited in the styles.css file located in (node_modules/bettrdash-react/styles.css)

PropertyTypeRequiredDefaultDescription
imageBackgroundColorStringfalse-Background color for the image if it's a png image
0.1.7

1 year ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years 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