Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make calculator functional #83

Open
PuruVJ opened this issue Apr 20, 2021 · 14 comments
Open

Make calculator functional #83

PuruVJ opened this issue Apr 20, 2021 · 14 comments
Assignees
Labels
enhancement New feature or request

Comments

@PuruVJ
Copy link
Owner

PuruVJ commented Apr 20, 2021

Calculator, currently is non-function. Make it function:

  • Click on buttons to add numbers and symbols to the equation
  • If calculator is focused, what is typed is also taken for input
  • If the equation ends with an operator, replicate the whole structure on the right side
@PuruVJ PuruVJ self-assigned this Apr 20, 2021
@PuruVJ
Copy link
Owner Author

PuruVJ commented Apr 20, 2021

I'll be working on this myself, though if you got any suggestions, comment here. And if you wish to contribute, comment here, and while making the PR, choose feat/functional-calculator as the branch to merge to.

@PuruVJ PuruVJ added the enhancement New feature or request label Apr 20, 2021
@PuruVJ
Copy link
Owner Author

PuruVJ commented May 25, 2021

I'll not be working on this. If you wish to volunteer, you'll have my gratitude

@nirtamir2
Copy link
Contributor

I can take it

@PuruVJ
Copy link
Owner Author

PuruVJ commented May 25, 2021

Thanks. Please take a look at the naming conventions, try not too include any extra library if you can help it, and overall, just make it good. Will be waiting for your PR :)

@nirtamir2
Copy link
Contributor

nirtamir2 commented May 25, 2021

Great!
I checked in into the feat/functional-calculator branch and run yarn and yarn start to bootstrap the project.
But I got a blank page with styled mouse cursor and the error of:

Uncaught TypeError: Cannot set property default of #<Object> which has only a getter
    at _interopRequireWildcard (react-rnd.js:1831)
    at node_modules/react-draggable/build/cjs/Draggable.js (react-rnd.js:1787)
    at __require (chunk-KYLA5N2V.js:12)
    at node_modules/react-draggable/build/cjs/cjs.js (react-rnd.js:2276)
    at __require (chunk-KYLA5N2V.js:12)
    at react-rnd.js:2364

In Draggable.js:36.
Am I missing something?

UPDATE:
After removing:

import { Rnd } from 'react-rnd';

and its usage the problem solved

@PuruVJ
Copy link
Owner Author

PuruVJ commented May 25, 2021

Uhh yeah, I recommend you make your own branch and start over, that one has issues

@PuruVJ
Copy link
Owner Author

PuruVJ commented May 25, 2021

Its related to Vite's version. Its fixed in main branch. Make a branch off of main anf start, nothing much in function-calculator brqnch anyway

@nirtamir2
Copy link
Contributor

Alright, Thanks :)

@nirtamir2
Copy link
Contributor

It's still an issue - when pressing one of the apps in the bottom toolbar - I cannot open it and see this error in the console
Did you solve it in your environment?

@nirtamir2
Copy link
Contributor

@PuruVJ
Any update on it?
I updated the code to the latest version with the committed yarn.lock. NOTICE: the issue occurs only after I click some dock item to open the app window

@PuruVJ
Copy link
Owner Author

PuruVJ commented May 26, 2021

Uhh yeah, its because I have package-lock.json as lock file(we're using npm here), so yarn might be skipping it. Try using npm, and if you can't, install [email protected] exact. That fixes the problem

@nirtamir2
Copy link
Contributor

Thanks - it works, I installed it with npm 👍

@PuruVJ PuruVJ assigned nirtamir2 and unassigned PuruVJ May 26, 2021
@nirtamir2
Copy link
Contributor

Still WIP - I did not know that calculator logic contains so many edge cases.
I first try to write the logic straight-forward (https://github.com/nirtamir2/macos-web/tree/feat/calculator) and now I try to write it with TDD for incremental progression (https://github.com/nirtamir2/macos-web/tree/feat/calculator-tdd)

@PuruVJ
Copy link
Owner Author

PuruVJ commented Jun 21, 2021

That is great! I love the fact you're still at it after so long! 🤗

Using TDD here feels like a great way going forward. Document the functionality, and use it as a map going forward!! Kudos!

Looked at the code, and it looks great to me. Would be happy to merge when it is complete 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants