UNLV-CS472-672 / 2024-S-GROUP3-Barbell

A workout-tracking app with a support website that does more than just track workouts. Cross platform in IOS and Android
4 stars 0 forks source link

Added library to environment #236

Closed bigboidanwithacan closed 5 months ago

bigboidanwithacan commented 5 months ago

What type of PR is this? (Check all that apply)

Description

What did you change? How did you change it? Added a component library that is to be used for the calendar in the streaks page.

Tests

How was this tested?

[Optional] Screenshots

image

screen shot shows the basic usage code which was used as a test.

Documentation

This library was installed locally, then added to the dependencies of our repository using the following command

pnpm add react-native-calendars -w

From there, I ensured it was set to be a field in devDependencies instead of dependencies (inside package.json).

Basic Usage

Here's a simple example of how to use the Calendar component:

import React from 'react'
import { StyleSheet, View } from 'react-native'
import { Calendar, DateData } from 'react-native-calendars'

const App: React.FC = () => {
  const handleDayPress = (day: DateData) => {
    console.log('Selected day:', day.dateString)
  }

  return (
    <View style={styles.container}>
      <Calendar
        onDayPress={handleDayPress}
        markedDates={{
          '2024-04-15': { selected: true, marked: true, selectedColor: '#48476D' }, // streak of 4 days
          '2024-04-17': { selected: true, marked: true, selectedColor: '#48476D' },
          '2024-04-18': { selected: true, marked: true, selectedColor: '#484765' },
          '2024-04-16': { selected: true, marked: true, selectedColor: '#484765' },
          '2024-04-20': { disabled: true, disableTouchEvent: true }, // rest day
        }}
      />
    </View>
  )
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
})

export default App

Features

Version

The current version is 1.1304.1.

Link to external documentation:

For more detailed documentation, see the official docs.

[Optional] Are there any post-deployment tasks we need to perform?

make sure to pnpm i after this is merged in.