Here you can read how to run it, and how to use all components. Lets start π
This project was bootstrapped with Create React App.
Ready, set, go!π€£
Seriously, in the project directory, you can run:
Runs the app in the development mode. π
Open http://localhost:3000 to view it in the browser.
Launches the test runner in the interactive watch mode. π§ͺ
But right now this feature isn't available. π
Builds the app for production to the build
folder. π
It correctly bundles React in production mode and optimizes the build for the best performance.
- App.js
- App.scss
- App.test.js
- components
- draw.io
- hooks
- icons
- index.css
- index.js
- logo.svg
- redux
- serviceWorker.js
- setupTests.js
Generated by markdown-tree
Button allows you to toggle change something.
Props | Type | Description |
---|---|---|
label | string | Text in button. |
onClick | function | Callback function. |
icon | string | Way to your icon. |
reversed | boolean | Change padding side (default side: left). |
big | boolean | Change font size to more bigger. |
active | boolean | If you need to has focus button state. |
Button allows you to call something on click.
Props | Type | Description |
---|---|---|
onClick | function | Callback function. |
Allows you to choose some option.
Props | Type | Description |
---|---|---|
list | array | Array of options to select. |
defaultOptionIndex | number | Selected option be default. |
onChoose | function | Function receiving selected element. |
Props | Type | Description |
---|---|---|
canRemove | boolean | Can it be deleted? |
remove | function | Function for card removing (on click remove button). |
baseStatus | boolean | Only one currency can be base. |
Convert algorithm. π¨βπ¬
Header of the App. Here you can change screen mode and theme
Column contains currencies, you can add and remove them.
Name | Type | Description |
---|---|---|
BaseColumn | base | Contains only one currency (base) |
Column | normal | Contains normal currencies. You add and remove them. |
BaseColumn props
Props | Type | Description |
---|---|---|
fullscreen | boolean | If fullscreen enabled, it has some styles. |
I used pretty custom scrollbar.
See react-custom-scrollbars docs
Allows you to tracks clicks outside the item to do something.
Argument | Type | Description |
---|---|---|
ref | useRef() | React link for your item. |
callback | function | Callback function. |
Example
import React, { useRef } from "react";
import { useClickOutside } from "way to useClickOutside";
//Component
export const Dropdown = () => {
const [opened, setOpened] = useState(false);
const toggleOpened = () => {
setOpened(!opened)
}
//Click outside track
const menuRef = useRef();
useClickOutside(menuRef, toggleOpened);
return(
<button>{opened ? 'Close' : 'Open'} menu </button>
{opened && <div ref={menuRef}>Menu</div>}
)
}
I'm using Redux to manage global state. See official redux and react-redux docs.
States description
Allows you to toggle change the theme.
Action | Argument | Description |
---|---|---|
applyTheme | boolean | Enable or disable dark theme. |
Allows you to toggle change the fullscreen mode.
Action | Argument | Description |
---|---|---|
applyFullscreen | boolean | Enable or disable fullscreen. |
Action | Argument | Description |
---|---|---|
applyTwoColumn | boolean | Enable or disable two column mode. |
The base currency value is basic for conversion to other currencies. It calls in all currencies. See algorithm docs.
Action | Argument | Description |
---|---|---|
updateBaseValue | number | Update base currency value. |
I'm using redux-thunk for async API requests.
Action | Argument | Description |
---|---|---|
fetchRates | string | Base currency short name (USD, EUR) |