DHaire92 / Flash-Cardio

0 stars 1 forks source link

My feature #1

Closed DHaire92 closed 1 month ago

DHaire92 commented 1 month ago

Summary by Sourcery

Refactor the application to use a centralized QuestionContext for managing questions, introduce navigation buttons for improved user flow, and update the UI styling. Update Firebase configuration and enhance the Login, Home, and QuestionList components to align with the new context and navigation structure.

New Features:

Enhancements:

Build:

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This pull request implements several changes to improve the structure and functionality of a React application. The changes include updating the login page, refactoring the question list component, modifying the main App component, updating styles, and adding new components for navigation and state management.

File-Level Changes

Change Details Files
Refactored the Login component
  • Updated the logo image source
  • Replaced CreateAccountButton with CreateAccountNavButton
  • Simplified the component structure
src/pages/Login.js
Refactored the QuestionList component to use context
  • Replaced useState with useContext
  • Added error handling for empty question list
  • Updated the component to be a default export
src/models/QuestionList.js
Updated the main App component
  • Added Editor route
  • Wrapped the Routes in a QuestionProvider
  • Updated Firebase configuration
src/pages/App.js
Updated styles
  • Changed color scheme
  • Added styles for question text
  • Extended input styles to text inputs
src/css/styles.css
Refactored the Home component
  • Removed unused useState import
  • Added QuestionList component
  • Added navigation buttons
src/pages/Home.js
Updated the CreateAccount component
  • Improved component structure
  • Added BackToLoginButton
  • Updated styling
src/pages/CreateAccount.js
Minor update to AddQuestion component
  • Changed button class from 'button2' to 'button1'
src/components/AddQuestion.js
Updated import in Editor component
  • Changed import path for BackToHomeButton
src/pages/Editor.js
Added NavigationButtons component
  • Created reusable navigation buttons
  • Implemented routing logic using useNavigate
src/components/NavigationButtons.js
Added QuestionContext for state management
  • Created QuestionContext and QuestionProvider
  • Initialized questions state with sample data
src/components/QuestionContext.js

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.