Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-ncore-kanban

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-ncore-kanban

Kanban and Calendar component for NCore Mobile

  • 0.0.1-pre-alpha.3
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

React Native Kanban

Kanban and Calendar for NCore Mobile

Requirements

  • NCore Mobile Package

Installation

yarn add react-native-ncore-kanban

Usage

import React from "react";
import {
    View
} from "react-native";
import {
    useNCoreLocalization,
    useNCoreTheme,
    PageContainer,
    Text
} from "ncore-mobile";
import Kanban from "react-native-ncore-kanban";

const MOCK_DATA_FOR_ROWS = {
    "07:00": {
        title: "07:00"
    },
    "07:15": {
        title: "07:15"
    },
    "07:30": {
        title: "07:30"
    },
    "07:45": {
        title: "07:45"
    },
    "08:00": {
        title: "08:00"
    },
    "08:15": {
        title: "08:15"
    },
    "08:30": {
        title: "08:30"
    },
    "08:45": {
        title: "08:45"
    },
    "09:00": {
        title: "09:00"
    }
};

const MOCK_DATA_FOR_COLUMN_WITH_CALENDAR = [
    {
        id: uuid(),
        title: "Column 1",
        rows: {
            "07:00": {
                id: uuid(),
                title: "Column 1 - Row 1",
                bgColor: "#00c2a9"
            },
            "07:15": {
                id: uuid(),
                title: "Column 1 - Row 2",
                bgColor: "white"
            },
            "07:45": {
                id: uuid(),
                title: "Column 1 - Row 4",
                bgColor: "violet"
            }
        }
    },
    {
        id: uuid(),
        title: "Column 2",
        rows: {
            "07:00": {
                id: uuid(),
                title: "Column 2 - Row 1",
                bgColor: "red"
            },
            "07:15": {
                id: uuid(),
                title: "Column 2 - Row 2",
                bgColor: "blue"
            }
        }
    },
    {
        id: uuid(),
        title: "Column 3",
        rows: {
            "07:00": {
                id: uuid(),
                title: "Column 4 - Row 1",
                bgColor: "purple"
            },
            "07:15": {
                id: uuid(),
                title: "Column 4 - Row 2",
                bgColor: "pink"
            }
        }
    },
    {
        id: uuid(),
        title: "Column 4",
        rows: {
            "07:00": {
                id: uuid(),
                title: "Column 3 - Row 1",
                bgColor: "yellow"
            },
            "07:15": {
                id: uuid(),
                title: "Column 3 - Row 2",
                bgColor: "navi"
            }
        }
    }
];

const MOCK_DATA_FOR_COLUMN_WITH_KANBAN = [
    {
        id: uuid(),
        title: "Column 1",
        rows: [
            {
                id: uuid(),
                title: "07:00",
                bgColor: "#00c2a9"
            },
            {
                id: uuid(),
                title: "07:15",
                bgColor: "white"
            }
        ]
    },
    {
        id: uuid(),
        title: "Column 2",
        rows: [
            {
                id: uuid(),
                title: "07:00",
                bgColor: "orange"
            },
            {
                id: uuid(),
                title: "07:15",
                bgColor: "purple"
            }
        ]
    },
    {
        id: uuid(),
        title: "Column 3",
        rows: [
            {
                id: uuid(),
                title: "07:00",
                bgColor: "navy"
            },
            {
                id: uuid(),
                title: "07:15",
                bgColor: "brown"
            }
        ]
    },
    {
        id: uuid(),
        title: "Column 4",
        rows: [
            {
                id: uuid(),
                title: "07:00",
                bgColor: "teal"
            },
            {
                id: uuid(),
                title: "07:15",
                bgColor: "grey"
            }
        ]
    }
];

const Home = () => {
    const {
        spaces
    } = useNCoreTheme();
    const {
        localize
    } = useNCoreLocalization();

    return <PageContainer
        scrollable={false}
    >
        <Kanban
            outerVerticalSpacing={spaces.container * 1.5}
            data={TYPE === "kanban" ? MOCK_DATA_FOR_COLUMN_WITH_KANBAN : MOCK_DATA_FOR_COLUMN_WITH_CALENDAR}
            titlesOfRows={TYPE === "kanban" ? undefined : MOCK_DATA_FOR_ROWS}
            type={TYPE}
            renderItem={({
                item,
                index
            }) => {
                return <View
                    style={[
                        {
                            backgroundColor: item.bgColor
                        },
                        stylesheet.item
                    ]}
                >
                    <Text>
                        {item.title}
                    </Text>
                </View>;
            }}
        />
    </PageContainer>;
};
export default Home;

Keywords

FAQs

Package last updated on 28 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc