Git Product home page Git Product logo

pen-pals's Introduction

Pen Pals

Production Build License: MIT Contributor Covenant Netlify Status

What's this? This is a template repository that sets up a few minor systems for a React micro-app, which is something that we've done frequently at Teach LA. Here's what it does:

  • has GitHub Actions automatically set up for testing and linting builds
  • has a default Dependabot config for yarn (with monthly audits)
  • has Netlify redirects set up for multi-route SPAs
  • has Webpack that helps bundle JS/TS files for browser usage
  • Husky for Git Hooks which enforces linting rules for files on commit
  • ESLint for our .TS and .TSX files
  • StyleLint with SASS guidelines for CSS, SASS, SCSS stylesheets.
  • includes the Contributor Covenant in CODE_OF_CONDUCT.md
  • has a little bit of documentation for new people!
  • Some extra stuff like changing the app logo to TeachLA's logo and setting up the src directory for further development!

Overview

... explain what your project is here! What technology you used, who made it, and what it was for!

Things You Should Do (and then delete this section)

Thanks for using our template! We hope this makes your life developing significantly easier.

Things you should do after using this as a template:

  • find-and-replace pen-pals with your GitHub repo's project name in this README (it's in a few places, so use an editor!)
  • set up Netlify for this app - talk to jiin (@doubleiis02) if you need access to the Teach LA Netlify team.
  • turn on "Automatically delete head branches" in GitHub Settings > Options
  • in Settings > Branches, create a branch protection rule for main that requires PR reviews. Also require status checks, like passing build.
  • only enable squash merging in Github Settings > Options > Merge Button (and disable merge commits and rebase merging).
  • this is a reminder to periodically run accessibility checks & Search Engine Optimization on your project by running inspect element / developer tools > Lighthouse
  • update the README badges for the GitHub Actions and Netlify with the correct links!
  • update and delete this documentation!
  • update public/index.html to have a description and title
  • update public/favicon.svg and public/favaicon512.png as needed
  • contact Regina Wang (@reginawang99), Matthew Nieva (@matthewcn56), or Jiin Kim (@doubleiis02) with any questions about our quickstarter template set-up.

Development Setup

We'll use a really common Node.js project workflow + Yarn! First, let's clone our repository, and install all of our yarn dependencies:

git clone https://github.com/uclaacm/pen-pals.git
cd pen-pals

The instructions to install Node.js will be different based on which platform you're running. It's heavily advised to install your Node.js using NVM (Node Version Manager) because it's easy to manage a standardized version and update it as needed.

macOS or Linux

Instructions for installing NVM on macOS and Linux (including WSL) are here.

At this point you can run nvm install. Assuming you've already cded into the correct directory as mentioned earlier, this will download the LTS (Long-Term Support) version of Node.js for you. Then, run nvm use to make sure you've switched to the right version; if it tells you Now using Node v16.13.2 or something similar, you're good to go!

Windows

If you're on Windows, you can use NVM for Windows, a separate version manager whose installation instructions can be found here. Once you've done that, you can run nvm install 16.13.2 to install the LTS version of Node.js, and nvm use 16.13.2 to switch to it.

If you don't have yarn installed...

npm install --global yarn

Then install our dependencies!

yarn install
yarn prepare

(If the above commands don't work even after installing yarn via npm, check this npm installation guide, click on alternatives, choose your operating system, and follow the steps there!)

(We handle the yarn and npm conflict issues within our .gitignore we set up so dw about it!) To start our app, you just need to run yarn start!

yarn start

And to build our project for production (with CRA and Webpack's bundling with all that goodness),

yarn run build

Contribution Workflow

Thanks for your interest in contributing to pen-pals! ❀️

Here's a quick guide on how to get started.

  1. Either make a new branch or a fork of this repository. main is a protected branch, so you cannot push to it.
  2. Follow the instructions in "Development Setup" above. If you're on a fork, replace the URL with the fork's URL; if you're on a different branch, check it out using git checkout.
  3. Beep boop away!
  4. Before you push, make sure your app runs with yarn start. If there are any errors, our CI/CD service will reject your build.
  5. Once you're ready, stage and commit your changes!
  6. Make a pull request with your changes, and let someone on your project team know. a. Netlify has a neat feature called "Deploy Previews" that give you a link to preview your changes; see the blog post for more info!
  7. If your code passes code review, then we can squash and merge it into main. Congratulations! If you'd like, it's now safe to delete your branch/fork.

Helpful Commands

By running yarn lint-fix we can use the linter that we set-up to format our code the way that passes our style checks! Before you commit your changes and submit a pull request, make sure to run

yarn lint-fix

With Husky, we run yarn lint-staged automatically before you commit! If you want to lint before commiting, you can run yarn lint-fix.

FAQs

Some lint is unnecessary :( How do I disable it?

There are actually 2 main ways to disable lint. Disabling the "rule" entirely, or in just a single line or file!

Disabling the rule entirely.

** Make sure this is what you really want!! It is often likely that you want to disable for just a single file. **

Depending on whether it's from stylelint or eslint, you can go to stylelintrc.json and add to `"rules"

<rule-name>: null

or eslintrc.json and add

'<rule-name>': 'off',

Disabling a rule for a single line or file

Take a look at the eslint docs for this: https://eslint.org/docs/user-guide/configuring/rules#disabling-rules

Or the stylelint docs for this: https://stylelint.io/user-guide/ignore-code/

It's pretty simple though, it'd look something like

/* eslint-disable <rule-name> */

or

// eslint-disable-next-line

The process for stylelint is very similar.

Husky is yelling at me and not letting me commit :(

Add the -n flag to your commit message to skip Husky's auto-linting.

EG: git commit -m "changes" -n

Assets are angry and won't accept

Our webpack set-up currently accepts asset files with the following extensions: png, svg, jpg/jpeg, gif, mp3, ttf

Code for it can be seen in line 22 webpack.dev.js and in webpack.prod.js

      {
        test: /\.(png|svg|jpe?g|gif|mp3|ttf)$/i, // we use regex to test different file types
        use: {
          loader: 'file-loader',
          options: {
            name: 'assets/[name].[ext]',
          },
        },
      },

If you want to add more assets like .pdf, .wav, .mp4, <YOUR_ASSET_TYPE> etc.

  • Update webpack.dev.js file. Change test: /\.(png|svg|jpe?g|gif|mp3)$/i to test: /\.(png|svg|jpe?g|gif|mp3|<YOUR_ASSET_TYPE>)$/i
  • Update webpack.prod.js file. Change test: /\.(png|svg|jpe?g|gif|mp3)$/i, to test: /\.(png|svg|jpe?g|gif|mp3|<YOUR_ASSET_TYPE>)$/i
  • (If typing is needed) add a folder under custom_typing => import-<YOUR_ASSET_TYPE>
  • (If typing is needed) create a file like import-<YOUR_ASSET_TYPE>.d.ts
  • (If typing is needed) add in:
/* eslint-disable @typescript-eslint/no-explicit-any */
declare module '*.<YOUR_ASSET_TYPE>' {
  const value: <YOUR_ASSET_TYPE-TYPE>;
  export default value;
}

How can I tell if my asset is actually being served?

Take a look at <YOUR_PROJECT_PATH>/asset-manifest.json. Like this!

Some More Helpful Tools

  • Preloading Images - if rendering images gets annoying because it's slow: Link Example here

Licensing & Attribution

This project and its code are licensed under the MIT License. You're free to use them however you wish, though we'd love to hear from you if you found this useful!

pen-pals's People

Contributors

8bitrobot avatar arushram avatar flobythebay avatar jennifer2430 avatar johannemoresco avatar jpaten avatar mbajji avatar michellelee0718 avatar my1040 avatar notamaia avatar rakilkim avatar reginawang3495 avatar royalascot1 avatar sanjnat41756 avatar shenranchen avatar sunnyyvinay avatar tiffwang27 avatar tombinford avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pen-pals's Issues

πŸš€ Feature: Make LessonSide pull text from JSON file and update based on the current exercise

Remove all text hardcoding on the lessonside and move it to pull text from a file containing each levelNum and a list of paragraphs. Paragraphs should contain the text of the paragraph and the css class used for that paragraph.

Use Case

We need the lesson side to have different instructions depending on the current exercise.

Proposed Solution

TBD, needs #48 and #54 to be implemented first

  • πŸ‘‹ I may be able to implement this feature request

This is a πŸš€ Feature Request

πŸš€ Feature: Better organize LessonSide

Use Case

Right now the Lesson Side is all just hardcoded. In order to allow it to switch when we change components, we'll need to make it read from a parameter instead of a single variable

Proposed Solution

  • Look at components/shared/LessonSide/index.tsx
  • Create a new component LessonText taking a property text_string
  • text_array should be an array containing objects of the following form: `{"id": "lesson-side-body", "text": "some random text"}
  • The component should map text_array to create a sequence div tags with the id equal to "id" and the body text equal to text, allowing the contents of text_array to be rendered on the page with the correct formatting
  • This should be possible just by using the JS map function along with a function returning each individual div tag
  • Replace the existing divs with a single LessonText component

This is a πŸš€ Feature Request

πŸš€ Feature: Add hover for lesson selector

Make it so that when the user hovers over a circle in the lesson circle, it appears as filled

Proposed Solution

  • Add a CSS hover selector for the level-button css class in LessonSide.scss
  • Make it so that this fills in the button, similar to the existing filled in level selector

This is a πŸš€ Feature Request

πŸš€ Feature: Add input validation and customization to the UnitCircleInput

Make the UnitCircleInput component take prop for the question text and answers, and add input validation. It can still be hardcoded to have three questions.

Use Case

We want to add more versions of the UnitCircleExercise and make them actually work!

Proposed Solution

  • Add a string[] prop called questions and a string[] prop called answers
  • Use the questions array to get the question text, instead of having it hardcoded
  • Use React state variable to record the input in each text box
  • Change the OnClick function to verify the input in each textbox before calling nextExercise
  • πŸ‘‹ I may be able to implement this feature request

This is a πŸš€ Feature Request

πŸš€ Feature: Create a Unit Circle Input Module

Create a dummy input component for Unit circle input similar to the AxisInput component. It should look like the version on the Figma on level 4, with the label in italics, the left/right after an equals sign and in regular text. For now this can just be a dummy component, it doesn't need to validate any input or take any input, just have it look like the Figma


This is a πŸš€ Feature Request

πŸš€ Feature: Axis Exercise Inputs

In this ticket, you'll be making the exercise component that renders the input boxes where the user types in answers for the axis exercise.

This component will likely need to carry a "counter" indicating how many exercises have been completed, as a state variable. Each time a question gets answered correctly, the counter can increase and the component can render the next exercise. Feel free to play around with fading animations and stuff to make it interesting :-)

Until the Exercise Side component is finished, just render this anywhere in the exercise side to test it.

Thanks!

πŸš€ Feature: Make the GraphExercise and GraphInput match the Figma

We have the GraphExercise component mostly finished, but the test implementation doesn't match the figma. Please add another call to GraphExercise matching "Turtle LL Level 2" on the Figma](https://www.figma.com/file/2ScrsUFHT5EZPxkV5xw6zL/Pen-Pals-Turtle-LL?type=design&node-id=65-355&mode=design&t=zkVIwERaBuC9t8Dj-0)

Proposed Solution

  • Look at the section of ExerciseSide.tsx where GraphExercise is used, and make a copy of the whole if statement
  • Within this copy, change the line that says if (exercises[completeExercises] == 'graph') to use graph1, and within the original version change it to be graph0
  • Update the availableExercises list to have graph1, then graph2
  • You may also need to increment other places whree the number of levels is hardcoded as 6 to 7 instead, and you may have issues with LessonSide, if that happens let me know!
  • πŸ‘‹ I may be able to implement this feature request

This is a πŸš€ Feature Request

πŸš€ Feature: Make UnitCircleInput validate inputs and match Figma

Use Case

Proposed Solution

  • Change the invocation of UnitCircleExercise match how it looks in the figma
  • Have it check the inputs and only allow you to continue if it's correct, otherwise show a similar message to AxisInput, for now these values can be hardcoded because we only have one invocation of UnitCircleExercise
  • πŸ‘‹ I may be able to implement this feature request

This is a πŸš€ Feature Request

πŸš€ Feature: Axis Exercises

In this ticket, you'll be making the exercise component that renders a single axis for the user to fill in blanks.

This component will likely need, as props, information such as the axis window, the orientation, locations of numerical markings, location of labels, and the location of the little animated turtle. Feel free to include any other necessary (or even convenient) props at your own discretion.

Until the Exercise Side component is finished, just render this anywhere in the exercise side to test it. Don't include the box-shadowed container as part of this component; that container is part of the Exercise Side ticket.

Thanks!

πŸš€ Feature: Fixing Up The Footer

Currently, the footer is bright white with unstyled text and a heart emoji. Let's make it look a little nicer :)

I've added a footer design to Figma. Some notes:

  • The heart is an icon that you should download from Figma (as an SVG) and then add to the footer in the correct spot. You'll have to put the text before and after it properly instead of just putting extra spaces between the words and putting the heart on top (which is what I did in the design, for the sake of visuals).
  • Some of the lines in the TeachLA icon vector might be a bit finicky due to sizing. There's already a TeachLA icon in the assets folder that you should use, but if it doesn't work feel free to try downloading the one in Figma to replace it. If neither works, let me know and we can figure it out together.

This is a πŸš€ Feature Request

πŸš€ Feature: Congratulations Page Layout

The Congratulations page is the very last screen in the lab, which people will see upon completing all of the levels associated with a particular exercise. Your task is to implement a static version of this page.

Unlike the other screens, this one must be independent of the standard lesson/exercise layout. You don't have to worry about making the root React component dynamic to handle this switch; that will be done in a later ticket. You can also download the turtle, speech bubble, cat, and dog images from the Figma. Note that the boxes and stuff will still have to be rendered using HTML/CSS; it's just the elaborate images and drawings that can be downloaded and added in (preferably as a vector).

image

Thanks!

🐾 Minor Update: Add instruction text for the AxisExercise

Use Case

Proposed Solution

Add a prop to the AxisInput component for explanation text, and display it matching the Figma. The Axis exercise is the one with the number line in the first couple of figma slides. Alter the AxisParent component to pass in this text (it can be hardcoded)

  • πŸ‘‹ I may be able to implement this update request

This is a 🐾 Minor Update

πŸš€ Feature: Create component for Graph Exercise input

Use Case

We need to take input for the graph input module!

Proposed Solution

For now, create a component that displays the input from the first GraphInput slide on the Figma ("Turtle LL Level 2"). This component should have the same input boxes and be formatted similarly to AxisInput. It also needs to have a Check button, identical to AxisInput.

  • πŸ‘‹ I may be able to implement this feature request

This is a πŸš€ Feature Request

πŸ‘€ Tracking: Onboarding

Overview:

Onboard new members for Fall 2023!

Checklist:

  • Clone Repo - git clone [email protected]:uclaacm/pen-pals.git
  • Install Node - should be able to run node --version
  • Run npm i
  • Run npm start
  • Get added to the Git repo so you can contribute!

This is a πŸ‘€ Tracking Issue

πŸš€ Feature: Connect Lesson Selector to progress

Use Case

Allow the user to view their progress through the exercises

Proposed Solution

The bottom left corner of the screen contains a lesson selector, which takes props for the number of levels, the total levels, and the max level reached. This should be updated to match the current level, potentially by passing the value for the currently active exercise to the LessonSide component. You may find it helpful to alter the level selection code to be a bit neater, right now it's in a bit of a rushed state

  • πŸ‘‹ I may be able to implement this feature request

This is a πŸš€ Feature Request

πŸš€ Feature: Scaffolding the Lesson Side

The Lesson Side of the learning lab is the green-background section containing the header and logo, some introductory text, a turtle with motivational messages, and a level picker at the bottom. Your task is to, using the Figma design here, add in some placeholders for each of these.

You will need to:

  1. Add in the header and logo. This is as simple as downloading the logo image (as a vector) from Figma and inserting it at the top of the section along with the header text.
  2. Add the body text. You can either copy paste some text from the Figma or generate lorem-ipsum text to fill this in.
  3. Add the turtle and its speech bubble as an image. The text part will be dynamic and you'll need to place it on the speech bubble using code; however, the turtle and bubble themselves can be an image. Again, you can either copy text from the design or use lorem-ipsum; eventually, we'll make it all context-dependent so the placeholders won't matter.
  4. Ensure the spacing is accurate to the design in percentages. Don't use pixel values, as those aren't responsive to screen size; instead, use percentages.

Thanks!

πŸš€ Feature: Make turtle changeable, probably using a component

Make the "encouraging turtle" easily changeable

Use Case

We want to change what the beloved encouraging turtle is saying between lessons, to make the experience more interactive for users.

Proposed Solution

Let's refactor the turtle to be it's own component, with a parameter to allow changing the particular turtle based on some ID. Document the ids in a comment somewhere(ideally using a custom TypeScript type, lmk if you need help with this) and download at least two additional turtles from Figma to demonstrate(you don't need to do them all for now!)


This is a πŸš€ Feature Request

πŸš€ Feature: Change Question Descriptions to match the actual task

Change the lesson side text to match the activity that is on the lesson side, so it looks like how it is on the figma.

Use Case

The LessionSide text does not match up with the ExerciseSide exercise, creating confusion on the instructions of the activity πŸ˜΅β€πŸ’«.

Proposed Solution

  • change the ordering of the descriptions in LessonSideContent.JSON so that it matches with the order the exercises are in.
  • figma for the design.
  • πŸ‘‹ I may be able to implement this feature request

This is a πŸš€ Feature Request

πŸš€ Feature: Add "next page" component to exercise side

Use Case

We need to display something to the user when the user successfully completes an exercise. This ticket is to design and implement such a component

Details

Your component should:

  • Congratulate the player for completing an exercise, the name of which should be passed as a parameter
  • Include some encouraging imagery(you can use the encouraging turtle image for now, if you want something more let me know and I can reach out to design)
  • Have a dummy button the user can press to continue

This is a πŸš€ Feature Request

πŸš€ Feature: Input module for graph exercise

Overview

Looking at the axis input module, make a similar module that allows for "fill in the blanks" code questions, where a text box can be surrounded by arbitrary text. See the graph module pages on Figma for an image. For now, try and get a set of arbitrary hardcoded questions(take them from the Figma and just code the text with the input boxes in between along with the button, don't worry about validation yet.


This is a πŸš€ Feature Request

πŸš€ Feature: Graph Layout

In this ticket, you'll make the layout for the graph component, which fits into the exercise side.

The component will need to display two axes (x and y), as well as lighter markings for the other coordinate points. In addition, it should have a cursor (whose position can be controlled by a prop) and a list of points that it would need to "navigate" to.

For now, as props, this component will need the window, a list of points (and, for some of them, alphabetical labels), and the location of the cursor. Feel free to include any other necessary (or even convenient) props at your own discretion.

As an additional note, make sure that the alphabetical labels' position relative to the point they indicate can be controlled by the props. In other words, include an additional field for whether the label should be on the top left, top right, bottom left, or bottom right of the point; this helps to make the exercises easier to read.

Just like with the axis ticket, until the Exercise Side component is finished, just render this anywhere in the exercise side to test it. Don't include the box-shadowed container as part of this component; that container is part of the Exercise Side ticket.

In a future ticket, we'll add in other features like previously-filled paths and cursor progress; you can ignore those for now. Refer to Turtle LL Level 2 for an idea of points and paths with which you can demonstrate the functionality.

Thanks!

πŸš€ Feature: Make level selector buttons clickable so users can move between levels

Whenever a user clicks on a level selector button, it should take them to the level with that number. Level selector buttons should also appear as clickable so users know to click on them.

Proposed Solution

  • Add a prop the LessonSide component to pass a function to update the current exerciseCount state kept in App.tsx, then pass this function further into LevelSelector.tsx
  • Update LessonSelector.tsx to make clicking on the level button divs call that function with the correct value to go to their level
  • πŸ‘‹ I may be able to implement this feature request

This is a πŸš€ Feature Request

πŸš€ Feature: Add all Axis exercises from Figma

Use Case

The Axis Exercise is fully inplemented, except that there's only two versions of it. We need to add more!

Proposed Solution

  • Refer to the Figma to find each possible axis exercise

  • Add props to AxisParent and AxisParentProps to allow a list of orientations and turtle locations to be passed

  • Add each of these props where AxisParent is called in ExerciseSide.tsx

  • You shouldn't need to mess with the confusing math in AxisInput.tsx

  • πŸ‘‹ I may be able to implement this feature request


This is a πŸš€ Feature Request

πŸ› Bug: LevelNum has a weird typing error

Is there an existing issue for this?

  • I have searched existing issues

What happened?

typescript

What was the expected behavior?

No response

Steps To Reproduce

No response

Relevant log output

No response

Anything else?

No response

🐾 Minor Update: Add Instructions for GraphExercise

Use Case

Currently it's hard to tell the purpose of the graph exercise input

Proposed Solution

Add a prop to the GraphInput module for explanation text, and display it matching the Figma. The GraphInput module is the one with the picture of a graph with an arrow on it

  • πŸ‘‹ I may be able to implement this update request

This is a 🐾 Minor Update

πŸš€ Feature: Add check button for the UnitCircleInput component,

Right now there's no way to continue from the UnitCircle input, this needs to be fixed by adding a "Check" button similar to the other exercises. For now, this doesn't have to support validation, it just needs to move to the next exercise

Proposed Solution

  • Add a nextExercise prop that takes a () => void function to the UnitCircleInput component
  • Create a button similar to the other next buttons that calls this function
  • Initialize the component inExerciseSide.tsxusing a similar function to the ones used for other component, if possible refactor this so we're not repeating it
  • πŸ‘‹ I may be able to implement this feature request

This is a πŸš€ Feature Request

πŸš€ Feature: Connect axis input to axis exercise

Description

Right now, we have an axis input component, which displays questions the user can input, and an axis exercise module, which shows a number line associated with the question. We want to allow these modules to be consistent, so the markers on the axis exercise number line correspond to questions on the axis input. You can do this however you want, however the best way may be to create a component wrapping both the input and exercise module. This will likely require adding a function to the axis input module's props to change a state variable in a parent component(which you will likely have to create), then using that to update the values passed to the axis exercise.

First step

Try to just create the component to wrap the axis exercise and axis input and keep them consistent for the first question. Later on, we can get the axis input and axis exercise changed so they update consistently


This is a πŸš€ Feature Request

πŸš€ Feature: The Level Picker

The level picker is the little string of circles with numbers in them at the bottom of the Lesson Side. Your task is to implement that component.

You will need to:

  1. Make the circles, along with the appropriate styling.
  2. Pick one of the circles and style it according to the "selected level" styles (white background, green text instead of transparent background, white text).
  3. Add some lines between circles. Eventually we'll be making this dynamic, but for now you can just add the lines in between the first few circles.

Thanks!

🐾 Minor Update: Add key property to LevelSelector divs

The LevelSelector component creates a list of divs by mapping over a dummy array. Because a key property is not present in the divs, React generates a warning. (I believe it's a performance concern.)

The fix is already implemented for the divs in the AxisSelector. Simply add a key property to the div created in the map lambda and set it to some unique value like i.

  • πŸ‘‹ I may be able to implement this update request

This is a 🐾 Minor Update

🐾 Minor Update: Fix Encouraging Turtle

The turtle is too small and looks like it's in the wrong position

Proposed Solution

  • Change the CSS around the turtle, footer, and lesson selector to make it match the Figma

  • πŸ‘‹ I may be able to implement this update request


This is a 🐾 Minor Update

πŸš€ Feature: Data Format for Exercises

In order to make the pages dynamic and easy to create, we need a data format for storing them. This data should ideally be stored in JavaScript object format (though not necessarily JSON, as a global object in a JS file exported would work just as well.

This data should store, for each page,

  • a title for the lesson side,
  • a body for the lesson side,
  • a message for the turtle’s speech bubble,
  • the level number, and
  • the contents of the exercise.

Each exercise should contain

  • a type of exercise (axis, circle, graph), and
  • some exercise-specific content.

For axes, the exercise-specific content would be

  • an orientation (x or y), and
  • a list of objects containing:
    • a label, and
    • a correct answer.

For the unit circle, the exercise-specific content would be

  • a list of objects containing:
    • a label, and
    • a correct answer.

For the graph, the exercise-specific content would be

  • the window of the graph (minX, maxX, minY, maxY),
  • the cursor’s starting position as a coordinate pair, and
  • a list of objects containing:
    • a label,
    • a prompt (e.g. turtle.forward(__)), and
    • a correct answer.

Note that, wherever possible, the structure of the object at the root should be identical. In other words, don't do

{
    β€œtype”: β€œgraph”,
    β€œg1”: 1,
    β€œg2”: 2,
},
{
    β€œtype”: β€œaxis”,
    β€œa1”: 1,
    β€œa2”: 2,
}

when you could instead do

{
    β€œtype”: β€œgraph”,
    β€œcontent”: {
        β€œg1”: 1,
        β€œg2”: 2,
    }
},
{
    β€œtype”: β€œaxis”,
    β€œcontent”: {
        β€œa1”: 1,
        β€œa2”: 2,
    }
}

In the first example, the root of the object has different attributes depending on the type; in the second, both objects have a type and a content and only the content is different. Doing this ensures that the page data is easier to follow as a developer, and it makes coding more uniform as well.

Thanks!

🧹 Refactor: Create file format for LessonSide

Make the LessonSide text read from a file instead of being hardcoded

Use Case

Right now the lesson side text is all placeholder, we want to make it read from a file so we can change it when the lesson increments

Proposed Solution

  • Create a json file called lessons.json in /src/ with the following format, and extend it by adding the contents and id of each div tag (starting with the title) in /src/components/shared/LessonSide/index.tsx
[
    {
        "lesson": "LESSON_1", 
         "text":[
              {"id":"lesson-side-header", "body": Positioning In Computers"}, 
               ...
          ]
     },
    ...
]

(also make sure the indentation is consistent because it's hard in the Github text box)

  • Import this file into the index.tsx module so it can be accessed by the rest of the program (we can figure out exactly how to do this at the standup meeting!)

This is a 🧹 Refactor Request

πŸš€ Feature: Scaffolding the Exercise Side

The Exercise Side is the white-background right-half of the screen with a graph, some exercises, and a check button. Your task is to, using the Figma design here, add in some placeholders for each of these.

You will need to:

  1. Add in an empty box for the graph. Make sure to add the appropriate styling to the box (e.g. box shadow and rounding), but the inside of the box can be left blank.
  2. Add the body text. You should fill in a placeholder for the prompt (e.g. "Type the answers in the blanks!") and leave sufficient empty space for the code samples and actual exercises. We'll eventually be implementing syntax highlighting for the code samples, so no need to fill anything in here.
  3. Add the Check button. As with the other parts, make sure to add the appropriate styling.

Thanks!

🐾 Minor Update: Fix the axinput CSS so it matches the Figma

Take a look at our Figma mockup, and try to make the axis input match it better. In particular:

  • Ensure the font sizes and styles are correct
  • Make them spaced in a left-aligned block spaced together similarly to how they are on Figma
  • Make sure it still scales when the number of labels change on the page

This is a 🐾 Minor Update

πŸš€ Feature: Create logic to switch between components on ExerciseSide

Right now, we don't have a way to switch between different exercises and other pages. Once we get this done, we should have the main functionality for ExerciseSide! In order to get this working, I think you'll need the following:

  • Give all input modules a void function that takes no parameters as a prop, and make it so that function is ran after successful completion of the exercise
  • Create an integer state variable to store how many exercises the user has completed
  • Create a string type which can store values of the form "axis", "unit_circle", etc. for all the exercise
    • To create a simple string type you do type blah = "blah 1" | "blah 2". Then, any variable of type blah will be constrained to be blah 1 or blah 2
  • Create an array of the type above, storing the order of the exercises we want to execute, containing exercises. For now, this should just be something like `[axis, congrats]' since the only finished component is the axis exercise and the congratulations page
  • Change the ExerciseSide component to return the component corresponding to the component the user is currently on, as determined through that state variable and the exercise array.

This is a πŸš€ Feature Request

πŸš€ Feature: Unit Circle Exercises

In this ticket, you'll be making the exercise component that renders half a unit circle for the user to fill in blanks.

This component will likely need, as props: the turtle's current angle, a list of which ticks should be labeled with numbers, and a similar list for which ones are exercises. Feel free to rearrange the above or include any other necessary (or even convenient) props at your own discretion.

Until the Exercise Side component is finished, just render this anywhere in the exercise side to test it. This circle doesn't have its own box-shadowed container, so you'll probably have to download the vector of the unit circle outline from Figma and give it the appropriate styling.

Thanks!

Here's a screenshot of what the component should end up looking like:

image

πŸ› Bug: Refreshing loses progress

Is there an existing issue for this?

  • I have searched existing issues

What happened?

Refreshing the page loses all progress.

What was the expected behavior?

Refreshing the page returns me to the same section.

Steps To Reproduce

  1. Go to a middle section
  2. Refresh the page
  3. Observe that you're back at the start.

Relevant log output

No response

Anything else?

No response

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.