Git Product home page Git Product logo

pickup-ui's Introduction

PICKUP UI // ui.playpickup.com

Test and Build GitHub issues npm bundle size npm npm

A collection of packages that make up the PickUp component universe.

πŸ’Ύ Installation

yarn add @playpickup/core @playpickup/icons

## or if npm is your jam

npm install @playpickup/core @playpickup/icons --save

🚦 Quick Start

Below is a quick start guide on how to use the Typography component in a simple React app, with Typescript.

import React from "react";
import ReactDOM from "react-dom";

import { ThemeProvider, Typography } from "@playpickup/core";

const App: React.FC = () => (
  <div>
    <ThemeProvider>
      <Typography variant="title">PlayPickUp!</Typography>
    </ThemeProvider>
  </div>
);

const el = document.getElementById("root");
ReactDOM.render(<App />, el);

Be sure to include ThemeProvider in your application. ThemeProvider should be included as far up the component tree as possible.

πŸ‘¨πŸΎβ€πŸŽ¨ Using @playpickup/core to style your App

@playpickup/core uses react-jss under the hood to style the components. We include these core methods in our package so you don't have to also include react-jss in your project. Below is an example of how you would use core to style a component. In this example, <ThemeProvider> is used at the top level of the application.

import React from "react";
import { ThemeProvider, createUseStyles, DefaultTheme } from "@playpickup/core";

const useStyles = createUseStyles((theme: DefaultTheme) => ({
  root: {
    display: "flex",
    position: "relative",
    backgroundColor: "red",
    color: theme.colors.primary,  // you can access default theme styles like so
    fontSize: 46,
    borderRadius: theme.borderRadius,
    padding: theme.spacing.base * 2, // double the base spacing size FANCY EYYY?
  },
}));

const SuperStyledDiv: React.FC = ({ children }) => {
  const classes = useStyles();
  return(
    <div className={classes.root}>{children}</div>;
  )
};

const App: React.FC = () => {
  return (
    <ThemeProvider>
      <SuperStyledDiv>
        I'm super styled!
      </SuperStyledDiv>
    </ThemeProvider>
  );
};

View it in action on Codesandbox

⚠ Project Status

This library is still under active development and we cannot garauntee breaking changes won't be introduced. It is reccomended not to use this library in production outside of the PickUp ecosystem.

Testing

When updating snapshots use yarn test -u instead of directly using Jest to update

pickup-ui's People

Contributors

andrewbarnhart avatar denvermullets avatar dependabot[bot] avatar dlars99 avatar erwstout avatar jimburch avatar katiejonesyo avatar krystinejannenga avatar pickup-bot avatar wliederer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

stridingman12

pickup-ui's Issues

Tagging System | Tag Search / List Component

Create a re-usable component that supports type ahead searching and tagging list to be used in our ecosystem.

@stout to design / provide examples

Acceptance Criteria

  • Jest Tests Written
  • Storybook documentation created
  • Mobile Responsive
  • Front End Only approach - (ex: no network requests in the component, pass API requests into component via props)
  • Debounces user input to avoid stacking network requests (waits say, 1000ms before throwing a request and only searches when tag is 2+ characters)
  • Displays list of current tags

PickUp UI | Progress Button

image.png
https://www.figma.com/file/Scd1HDkdG4YB8tBh3WYOzZ/PickUp-July-'21?node-id=178%3A5126

Create a Progress Button component that can show current progress towards points (or whatever goal) and then has a success state once the criteria is met that then can link a user to a new page, etc...

Acceptance Criteria

  • All content/data are prop drive
  • Background fill animates in when in viewport (check PickerButton component for how i approached the animation - will need some sort of library or magic to know when this button is in viewport))
  • Has a success/criteria met state that switches content/allows for an action to be completed on click
  • Tests have been written in Jest
  • Storybook Documentation has been added // updated

React footer

Need a frontend view of the rails footer recreated in react

Acceptance criteria

  • Mobile responsive

UI | Fix Progress Button

Some elements of the Progress Button are breaking styling and functionality in the new Marketplace.

Quests:
β˜‘οΈ Update to to accept an option that includes a state object, as well as a path
β˜‘οΈ Add className to component prop
β˜‘οΈ Eliminate the decimal in fan points when it's .0
β˜‘οΈ Fix the z-index so that the button doesn't float above the Nav bar and other headers

Switch from lodash to he for string unescaping

Currently in the Typography component, we are using lodash's unescape function when using useUnescape as a prop. The lodash library does not cover all HTML entities, so we should switch to the he library which has more support for all entities possible.

Acceptance Criteria

  • Lodash is removed from Typography component
  • he is installed and configured
  • he converts HTML entities properly

PickUp UI | Breadcrumbs

Vivid front has created a breadcrumbs component in the Affiliate landing page repo. Lets pick it up and move it into PickUp UI so we can use it everywhere!

image.png

Acceptance Criteria

  • Tests are written in Jest
  • Documentation is added to Storybook
  • Breadcrumbs are re-usable

Note: I'm not sure how they built these out so if you wanna have a quick dive holler

PickUp UI | Card Component

Create a Card component that can be used throughout the PickUp Ecosystem.

image.png
https://www.figma.com/file/Scd1HDkdG4YB8tBh3WYOzZ/PickUp-July-'21?node-id=178%3A5126

https://pickup-april-21.webflow.io/picker

^ feel free to use this Webflow I mocked up for front end reference as well @jimburch πŸ€·β€β™‚οΈ

Acceptance Criteria

  • Component accepts props for image
  • Scales correctly on desktop and mobile (in this case we probably want the card to be auto sizing, so 100% width and auto height, then when using the card in a project the parent div determines the width)
  • Accepts className and style overrides via props
  • Tests are written via Jest
  • Documentation vis Storybook is created // updated

Create Paper Component

We need a Paper component in the UI library since we have it used across our platform. This will ensure consistency across our styles.

Storybook Integration for PickUp-UI

Storybook was removed in a massive restructure of the initial pickup-ui bootstrapping.

Adding it back in, functional, and live on ui.playpickup.com would be πŸ’―

NestedInput | Allow Child Button to be Disabled

Add a prop to the top level of NestedInput called disabled that accepts a boolean. This should be passed to the underlying Button component when true.

Use case: submitting a form, while submititng the button should be disabled.

Status Icon

Create a component that returns the correct icon and color based off a given pick status. This should mimic the behavior of the dynamic icons in the Fan Profile page and FanpickDetail page.

Fab icon color override not working

Expected Behavior
Using the prop iconColor should change the color of the icon inside of the fab component.

Actual Behavior
Nothing Happens, however, adding a color prop to Icon works correctly.

Thoughts / Suggestions
It seems as though React.createElement is not passing the props correctly, or there is a disconnect from one parent component to the other. Needs a bit more investigation.

Marketplace: Allow unlimited use code

New partner is hoping to just use one code for all marketplace redemptions. They would update it with you quarterly to prevent code abuse.

@jimburch mentioned "I'm actually figuring out how the prize codes will work with the new contentful prize data"

Maybe we toss this his way?

Add Checkbox to PickUp UI

We need to build out a purple checkbox for PickUp UI.

Basic checkbox on left compared to PickUp Rails checkbox on right

image.png

Add Table Component

A big part of our component eco system are Tables. Using Material UI Tables as a base, we will surface a reusable table component to be used across our platforms.

UI / Storybook | Fix Form Examples

Currently, the form examples error out because they are not wrapped properly in a Formik form.

Adding a Formik form wrapper and using the Field component should supply the Error object that is missing currently.

Auto generate CNAME file

On merge to master, pickup-ui auto builds and deploys our storybook application.

In GitHub, when saving a custom domain it creates a file called CNAME with the contents ui.playpickup.com. On build this file is lost. After building the storybook app, GitHub actions should create the CNAME file so our custom domain stays in tact.

UI | Add NestedInput to Storybook

The NestedInput component does not have a corresponding StoryBook entry. This should be added so other developers can reference how to use it.

Acceptance Criteria:

  • StoryBook has a page for NestedInput
  • All props/options are represented

[UI - Core] Allow `e` as a param of `onClick` for Button

Current Functionality
Button component's onClick does not expect an event param, example:

image.png

Expected Functionality
e/event is typed as optional so it can be used if needed.

Example / Pseudo code:

// interface for Button --- type may be incorrect just off the top of my head
onClick: (e?: React.EventHandler<Mouse>) => // whatever yada yada

UI | TextInput Docs Missing Key Props

TextInput in the StoryBook documention is missing key props/functionality such as "Label". Needs a second look to see what is missing from the documentation. Can be derived from the typings:

export interface TextInputProps extends BaseFormikFieldsWithHandleChange {
  className?: string;
  innerClassName?: string;
  innerStyle?: React.CSSProperties;
  style?: React.CSSProperties;
  placeholder?: string;
  label?: string;
}

Status Icon

Create a component that returns the correct icon and color based off a given pick status. This should mimic the behavior of the dynamic icons in the Fan Profile page and FanpickDetail page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.