fix styles

This commit is contained in:
UserX 2023-08-09 16:00:45 +03:00
parent e693462f0f
commit 7d3f76d230
14 changed files with 356 additions and 325 deletions

View File

@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>React App</title> <title>Crypto Converter</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>

View File

@ -1,25 +1,22 @@
body{ body {
background: #e5e5e5; background: #e5e5e5;
} }
.converter {
.converter{ max-width: 630px;
max-width: 610px;
margin: 50px auto; margin: 50px auto;
background: #fff; background: #fff;
padding: 15px; padding: 15px;
border-radius: 10px; border-radius: 10px;
&__head {
&__head{
font-weight: 700; font-weight: 700;
font-size: 25px; font-size: 25px;
text-align: center; text-align: center;
margin: 0 0 50px 0; margin: 0 0 50px 0;
} }
&__body{ &__body {
width: 100%; width: 100%;
height: 60px; height: 60px;
display: flex; display: flex;
@ -27,13 +24,13 @@ body{
gap: 10px; gap: 10px;
margin: 0 0 25px 0; margin: 0 0 25px 0;
justify-content: center; justify-content: center;
@media (max-width:768px) { @media (max-width: 768px) {
flex-direction: column; flex-direction: column;
height: auto; height: auto;
} }
} }
&__row{ &__row {
border-radius: 10px; border-radius: 10px;
height: 100%; height: 100%;
font-size: 24px; font-size: 24px;
@ -41,19 +38,15 @@ body{
align-items: center; align-items: center;
position: relative; position: relative;
justify-content: center; justify-content: center;
@media (max-width:908px) { @media (max-width: 908px) {
font-size: 20px; font-size: 20px;
} }
@media (max-width:768px) { @media (max-width: 768px) {
font-size: inherit; font-size: inherit;
} }
&_border{
}
} }
&__crypto-name {
&__crypto-name{
height: 100%; height: 100%;
vertical-align: middle; vertical-align: middle;
position: relative; position: relative;
@ -69,35 +62,37 @@ body{
border: 2px solid rgba(7, 28, 71, 0.12); border: 2px solid rgba(7, 28, 71, 0.12);
border-left: none; border-left: none;
border-radius: 0 10px 10px 0; border-radius: 0 10px 10px 0;
&-title{ &-title {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
gap: 3px; gap: 3px;
} }
img{ img {
width: 40px; width: 40px;
height: 20px; height: 20px;
} }
} }
&__arrow{ &__arrow {
height: 35px; height: 35px;
object-fit: contain; object-fit: contain;
cursor: pointer; cursor: pointer;
width: 20px; width: 20px;
background: #999; background: #999;
-webkit-mask: url(//yastatic.net/s3/web4static/_/v2/static/media/Swap_16.c0236c02.svg) no-repeat center; -webkit-mask: url(//yastatic.net/s3/web4static/_/v2/static/media/Swap_16.c0236c02.svg)
mask: url(//yastatic.net/s3/web4static/_/v2/static/media/Swap_16.c0236c02.svg) no-repeat center; no-repeat center;
mask: url(//yastatic.net/s3/web4static/_/v2/static/media/Swap_16.c0236c02.svg)
no-repeat center;
} }
&__input{ &__input {
border: 2px solid rgba(7, 28, 71, 0.12); border: 2px solid rgba(7, 28, 71, 0.12);
border-radius: 10px 0 0 10px; border-radius: 10px 0 0 10px;
height: 100%; height: 100%;
font-family: HelveticaNeue-Light,"Helvetica Neue Light",Helvetica,Arial,sans-serif; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', Helvetica, Arial,
sans-serif;
font-size: inherit; font-size: inherit;
text-align: right; text-align: right;
width: 201px; width: 201px;
@ -106,12 +101,11 @@ body{
top: 0; top: 0;
padding: 0 10px 0 0; padding: 0 10px 0 0;
outline: none; outline: none;
@media (max-width:768px) { @media (max-width: 768px) {
border-width: 0; border-width: 0;
} }
} }
&__footer{ &__footer {
font-size: 18px; font-size: 18px;
} }
} }

View File

@ -1,9 +1,8 @@
import React from 'react'; import { render, screen } from '@testing-library/react'
import { render, screen } from '@testing-library/react'; import App from './App'
import App from './App';
test('renders learn react link', () => { test('renders learn react link', () => {
render(<App />); render(<App />)
const linkElement = screen.getByText(/learn react/i); const linkElement = screen.getByText(/learn react/i)
expect(linkElement).toBeInTheDocument(); expect(linkElement).toBeInTheDocument()
}); })

View File

@ -1,195 +1,237 @@
import { ChangeEvent, useEffect, useRef, useState } from 'react'; import { ChangeEvent, useEffect, useRef, useState } from 'react'
import './App.scss';
import btc from '../src/assets/images/btc.svg' import btc from '../src/assets/images/btc.svg'
import usdt from '../src/assets/images/usdt.svg' import usdt from '../src/assets/images/usdt.svg'
import eth from '../src/assets/images/eth.svg' import eth from '../src/assets/images/eth.svg'
import useOnClickOutside from './hooks/useOnClickOutside'; import useOnClickOutside from './hooks/useOnClickOutside'
import { PopupConverter } from './Components/popup-converter/Popup-converter'; import { PopupConverter } from './Components/popup-converter/Popup-converter'
import { convert } from '.'; import { convert } from '.'
import { IValutions } from './models/IValutions'; import { IValutions } from './models/IValutions'
import './App.scss'
function App() { function App() {
const valuations: IValutions[] = [
{
title: 'BTC',
img: btc,
alt: 'Bitcoin'
},
{
title: 'USDT',
img: usdt,
alt: 'Tether'
},
{
title: 'ETH',
img: eth,
alt: 'Ethereum'
}
]
const valuations: IValutions[] = [ const ref = useRef<HTMLDivElement>(null)
{
title: 'BTC',
img: btc,
alt: 'Bitcoin'
},
{
title: 'USDT',
img: usdt,
alt: 'Tether'
},
{
title: 'ETH',
img: eth,
alt: 'Ethereum'
},
]
const ref = useRef<HTMLDivElement>(null); const [firstValue, setFirstValue] = useState<string>('1')
const [secondValue, setSecondValue] = useState<string>('1')
const [firstValuation, setFirstValuation] = useState<IValutions>(
valuations[0]
)
const [secondValuation, setSecondValuation] = useState<IValutions>(
valuations[1]
)
const [showFirstValuation, setShowFirstValuation] = useState<boolean>()
const [showSecondValuation, setShowSecondValuation] = useState<boolean>()
const [isSwap, setSwap] = useState(true)
const [firstValue, setFirstValue] = useState<string>('1') const regexInput = (e: ChangeEvent<HTMLInputElement>) => {
const [secondValue, setSecondValue] = useState<string>('1') let [_, sign, integer, decimals]: any = e.target.value
const [firstValuation, setFirstValuation] = useState<IValutions>(valuations[0]) .replace(/[^\d\.\-]/g, '')
const [secondValuation, setSecondValuation] = useState<IValutions>(valuations[1]) .replace(/(\..*?)\./g, '$1')
const [showFirstValuation, setShowFirstValuation] = useState<boolean>() .replace(/(.+)-/g, '$1')
const [showSecondValuation, setShowSecondValuation] = useState<boolean>() .match(/^(-?)(.*?)((?:\.\d*)?)$/)
const [isSwap, setSwap] = useState(true)
let pos: number = Number(e.target.selectionStart) - 1
if (!integer && decimals) pos += 2
const regexInput = (e: ChangeEvent<HTMLInputElement>) => { if (integer || decimals) {
integer = +integer
let [_, sign, integer, decimals]: any = e.target.value.replace(/[^\d\.\-]/g, "")
.replace(/(\..*?)\./g, "$1")
.replace(/(.+)-/g, "$1")
.match(/^(-?)(.*?)((?:\.\d*)?)$/);
let pos: number = Number(e.target.selectionStart) - 1;
if (!integer && decimals) pos += 2;
if (integer || decimals) {
integer = +integer;
}
const formatted = sign + integer + decimals;
if (formatted !== e.target.value) {
e.target.value = formatted;
e.target.setSelectionRange(pos, pos);
}
} }
const handlerInputOne = (e: ChangeEvent<HTMLInputElement>) => { const formatted = sign + integer + decimals
regexInput(e)
setFirstValue(e.target.value) if (formatted !== e.target.value) {
getSecondValuation(+e.target.value || 0) e.target.value = formatted
e.target.setSelectionRange(pos, pos)
} }
}
const handlerInputTwo = (e: ChangeEvent<HTMLInputElement>) => { const handlerInputOne = (e: ChangeEvent<HTMLInputElement>) => {
regexInput(e) regexInput(e)
setSecondValue(e.target.value) setFirstValue(e.target.value)
getFirstValuation(+e.target.value || 0) getSecondValuation(+e.target.value || 0)
}
const handlerInputTwo = (e: ChangeEvent<HTMLInputElement>) => {
regexInput(e)
setSecondValue(e.target.value)
getFirstValuation(+e.target.value || 0)
}
const openFirstListValuation = () => setShowFirstValuation(true)
const openSecondListValuation = () => setShowSecondValuation(true)
const getSecondValuation = async (value: number) => {
await convert.ready()
setSecondValue(
convert[firstValuation.title][secondValuation.title](value) || 0
)
}
const getFirstValuation = async (value: number) => {
await convert.ready()
setFirstValue(
convert[secondValuation.title][firstValuation.title](value) || 0
)
}
const swap = () => {
setSwap(true)
setSecondValuation(firstValuation)
setFirstValuation(secondValuation)
}
useOnClickOutside(ref, () => {
setShowSecondValuation(false)
setShowFirstValuation(false)
})
useEffect(() => {
getSecondValuation(+firstValue)
}, [firstValuation])
useEffect(() => {
if (isSwap) {
setSwap(false)
return
} }
getFirstValuation(+secondValue)
}, [secondValuation])
const openFirstListValuation = () => setShowFirstValuation(true) useEffect(() => {
const interval = setInterval(() => {
getSecondValuation(+firstValue)
}, 25000)
return () => clearInterval(interval)
}, [])
const openSecondListValuation = () => setShowSecondValuation(true) const getValuations = () =>
`${firstValue || 0} ${firstValuation.title} = ${secondValue || 0} ${
secondValuation.title
}`
const getSecondValuation = async (value: number) => { return (
await convert.ready() <div className='converter'>
setSecondValue(convert[firstValuation.title][secondValuation.title](value) || 0) <div className='converter__body'>
<div className='converter__row converter__row_border'>
} <input
const getFirstValuation = async (value: number) => { className='converter__input'
await convert.ready() type='text'
setFirstValue(convert[secondValuation.title][firstValuation.title](value) || 0) value={firstValue}
} onChange={handlerInputOne}
/>
const swap = () => { <span
setSwap(true) className='converter__crypto-name'
setSecondValuation(firstValuation) onClick={openFirstListValuation}
setFirstValuation(secondValuation) >
} <div className={'converter__crypto-name-title'}>
<img src={firstValuation.img} alt='' />
useOnClickOutside(ref, () => { {firstValuation.title}
setShowSecondValuation(false)
setShowFirstValuation(false)
});
useEffect(() => {
getSecondValuation(+firstValue)
}, [firstValuation])
useEffect(() => {
if (isSwap) {
setSwap(false)
return
}
getFirstValuation(+secondValue)
}, [secondValuation])
useEffect(() => {
const interval = setInterval(() => {
getSecondValuation(+firstValue)
}, 25000)
return () => clearInterval(interval)
}, [])
return (
<div className="converter">
<div className="converter__body">
<div className="converter__row converter__row_border">
<input className='converter__input' type="text" value={firstValue}
onChange={handlerInputOne} />
<span className='converter__crypto-name' onClick={openFirstListValuation}>
<div className={'converter__crypto-name-title'}>
<img src={firstValuation.img} alt="" />
{firstValuation.title}
</div>
<div>
<svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="8" height="14"><path
d="M4 0l4 6H0l4-6zm0 14l4-6H0l4 6z" /></svg>
</div>
</span>
{showFirstValuation && <div className='converter__popup popup-converter' ref={ref}>
{valuations.map((item, index) =>
<PopupConverter
key={index}
item={item}
setValuation={setFirstValuation}
valuation={firstValuation.title}
/>)}
</div>
}
</div>
<div className="converter__row">
<div className={'converter__arrow'} onClick={swap} />
</div>
<div className="converter__row converter__row_border">
<input className='converter__input' min={0} type="text" maxLength={20} value={secondValue}
onChange={handlerInputTwo} />
<span className='converter__crypto-name' onClick={openSecondListValuation}>
<div className={'converter__crypto-name-title'}>
<img src={secondValuation.img} alt="" />
{secondValuation.title}
</div>
<div>
<svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="8" height="14"><path
d="M4 0l4 6H0l4-6zm0 14l4-6H0l4 6z" /></svg>
</div>
</span>
{showSecondValuation && <div className='converter__popup popup-converter' ref={ref}>
{valuations.map((item, index) =>
<PopupConverter
key={index}
item={item}
valuation={secondValuation.title}
setValuation={setSecondValuation}
/>)}
</div>
}
</div>
</div> </div>
<footer className="converter__footer"> <div>
<b>{(firstValue || 0) + ' ' + firstValuation.title + ' = ' + (secondValue || 0) + ' ' + secondValuation.title}</b> <svg
<br /> focusable='false'
Данные носят ознакомительный характер {'\t'} xmlns='http://www.w3.org/2000/svg'
<b> width='8'
{ height='14'
new Date(convert.lastUpdated).toLocaleDateString() + ' ' + >
new Date(convert.lastUpdated).getHours() + ':' + <path d='M4 0l4 6H0l4-6zm0 14l4-6H0l4 6z' />
new Date(convert.lastUpdated).getMinutes().toString().padStart(2, '0') </svg>
} </div>
</b> </span>
</footer> {showFirstValuation && (
<div className='converter__popup popup-converter' ref={ref}>
{valuations.map((item, index) => (
<PopupConverter
key={index}
item={item}
setValuation={setFirstValuation}
valuation={firstValuation.title}
/>
))}
</div>
)}
</div> </div>
); <div className='converter__row'>
<div className={'converter__arrow'} onClick={swap} />
</div>
<div className='converter__row converter__row_border'>
<input
className='converter__input'
min={0}
type='text'
maxLength={20}
value={secondValue}
onChange={handlerInputTwo}
/>
<span
className='converter__crypto-name'
onClick={openSecondListValuation}
>
<div className={'converter__crypto-name-title'}>
<img src={secondValuation.img} alt='' />
{secondValuation.title}
</div>
<div>
<svg
focusable='false'
xmlns='http://www.w3.org/2000/svg'
width='8'
height='14'
>
<path d='M4 0l4 6H0l4-6zm0 14l4-6H0l4 6z' />
</svg>
</div>
</span>
{showSecondValuation && (
<div className='converter__popup popup-converter' ref={ref}>
{valuations.map((item, index) => (
<PopupConverter
key={index}
item={item}
valuation={secondValuation.title}
setValuation={setSecondValuation}
/>
))}
</div>
)}
</div>
</div>
<footer className='converter__footer'>
<b>{getValuations()}</b>
<br />
Данные носят ознакомительный характер {'\t'}
<b>
{new Date(convert.lastUpdated).toLocaleDateString() +
' ' +
new Date(convert.lastUpdated).getHours() +
':' +
new Date(convert.lastUpdated)
.getMinutes()
.toString()
.padStart(2, '0')}
</b>
</footer>
</div>
)
} }
export default App; export default App

View File

@ -1,42 +1,42 @@
.popup-converter{ .popup-converter {
position: absolute; position: absolute;
z-index: 2; z-index: 2;
inset: 75px auto auto 0; inset: 75px auto auto 0;
width: 100%; width: 100%;
box-shadow: 0 4px 24px rgba(0,0,0,.25); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
background: #fff; background: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 10px 0; padding: 10px 0;
border-radius: 5px; border-radius: 5px;
&__container{ &__container {
padding: 4px 12px; padding: 4px 12px;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; gap: 10px;
cursor: pointer; cursor: pointer;
&:hover{ &:hover {
background: #ffeca1; background: #ffeca1;
} }
} }
&__check{ &__check {
display: flex; display: flex;
flex: 0 0 16px; flex: 0 0 16px;
} }
&__body{ &__body {
display: flex; display: flex;
align-items: center; align-items: center;
} }
&__img{ &__img {
flex: 0 0 20px; flex: 0 0 20px;
height: 20px; height: 20px;
img{ img {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
} }
} }
&__button{ &__button {
background: transparent; background: transparent;
transition: 0.3s all ease; transition: 0.3s all ease;
// padding: 10px; // padding: 10px;
@ -44,11 +44,11 @@
font-weight: 700; font-weight: 700;
cursor: pointer; cursor: pointer;
border: none; border: none;
span{ span {
margin: 0 4px; margin: 0 4px;
font-size: 16px; font-size: 16px;
line-height: 24px; line-height: 24px;
color: rgba(84,96,122,.68); color: rgba(84, 96, 122, 0.68);
} }
} }
} }

View File

@ -1,42 +1,43 @@
import {Dispatch, FC, MouseEvent} from "react" import { FC, MouseEvent } from 'react'
import {IListValuationsName} from "../../models/IListValutionsName" import { IListValuationsName } from '../../models/IListValutionsName'
import './Popup-converter.scss' import './Popup-converter.scss'
export const PopupConverter: FC<IListValuationsName> = ({
item,
valuation,
setValuation
}) => {
const setActiveValuation = (e: MouseEvent<HTMLDivElement>) => {
setValuation({
img: item.img,
title: item.title
})
}
export const PopupConverter: FC<IListValuationsName> = ( return (
{ <div className={'popup-converter__container'} onClick={setActiveValuation}>
item, <div className={'popup-converter__check'}>
valuation, {valuation === item.title && (
setValuation, <svg
} focusable='false'
) => { xmlns='http://www.w3.org/2000/svg'
width='16'
const setActiveValuation = (e: MouseEvent<HTMLDivElement>) => { height='10'
setValuation({ >
img: item.img, <path d='M7.207 7.506L3.629 3.81 2.343 4.939l4.841 5.002 8.462-8.428L14.382.362z' />
title: item.title </svg>
}) )}
} </div>
<div className={'popup-converter__body'}>
return ( <img className={'popup-converter__img'} src={item.img} alt='icon' />
<div className={'popup-converter__container'} onClick={setActiveValuation}> <button
<div className={'popup-converter__check'}> type='button'
{valuation === item.title && className={'popup-converter__button'}
<svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="10"> value={item.title}
<path d="M7.207 7.506L3.629 3.81 2.343 4.939l4.841 5.002 8.462-8.428L14.382.362z"/> >
</svg>} {item.title} <span>{item.alt}</span>
</div> </button>
<div className={'popup-converter__body'}> </div>
<img className={'popup-converter__img'} src={item.img} alt="icon"/> </div>
<button type='button' )
className={'popup-converter__button'}
value={item.title}
>{item.title} <span>{item.alt}</span></button>
</div>
</div>
)
} }

View File

@ -1,22 +1,21 @@
import { useEffect } from 'react'; import { useEffect } from 'react'
export default function useOnClickOutside(
export default function useOnClickOutside(ref:React.RefObject<any>, handler:Function) { ref: React.RefObject<any>,
useEffect( handler: Function
() => { ) {
const listener = (event:MouseEvent|TouchEvent) => { useEffect(() => {
if (!ref.current || ref.current.contains(event.target)) { const listener = (event: MouseEvent | TouchEvent) => {
return; if (!ref.current || ref.current.contains(event.target)) {
} return
handler(event); }
}; handler(event)
document.addEventListener("mousedown", listener); }
document.addEventListener("touchstart", listener); document.addEventListener('mousedown', listener)
return () => { document.addEventListener('touchstart', listener)
document.removeEventListener("mousedown", listener); return () => {
document.removeEventListener("touchstart", listener); document.removeEventListener('mousedown', listener)
}; document.removeEventListener('touchstart', listener)
}, }
[ref, handler] }, [ref, handler])
); }
}

View File

@ -1,5 +1,5 @@
import axios from "axios" import axios from 'axios'
export const API_URL = 'https://testnet.binancefuture.com' export const API_URL = 'https://testnet.binancefuture.com'
export const $api = axios.create({ baseURL: API_URL }) export const $api = axios.create({ baseURL: API_URL })

View File

@ -1,34 +1,31 @@
import React from 'react'; import ReactDOM from 'react-dom/client'
import ReactDOM from 'react-dom/client'; import './index.css'
import './index.css'; import App from './App'
import App from './App'; import reportWebVitals from './reportWebVitals'
import reportWebVitals from './reportWebVitals'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import {QueryClient, QueryClientProvider} from "@tanstack/react-query";
const CryptoConvert = require("crypto-convert").default; const CryptoConvert = require('crypto-convert').default
export const convert = new CryptoConvert({ export const convert = new CryptoConvert({
cryptoInterval: 20000, //Crypto prices update interval in ms (default 5 seconds on Node.js & 15 seconds on Browsers) cryptoInterval: 20000, //Crypto prices update interval in ms (default 5 seconds on Node.js & 15 seconds on Browsers)
fiatInterval: (60 * 1e3 * 60), //Fiat prices update interval (default every 1 hour) fiatInterval: 60 * 1e3 * 60, //Fiat prices update interval (default every 1 hour)
calculateAverage: true, //Calculate the average crypto price from exchanges calculateAverage: true, //Calculate the average crypto price from exchanges
binance: true, //Use binance rates binance: true, //Use binance rates
bitfinex: true, //Use bitfinex rates bitfinex: true, //Use bitfinex rates
coinbase: true, //Use coinbase rates coinbase: true, //Use coinbase rates
kraken: true, //Use kraken rates kraken: true, //Use kraken rates
HTTPAgent: null //HTTP Agent for server-side proxies (Node.js only) HTTPAgent: null //HTTP Agent for server-side proxies (Node.js only)
}); })
const root = ReactDOM.createRoot( const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
document.getElementById('root') as HTMLElement
);
const queryClient = new QueryClient() const queryClient = new QueryClient()
root.render( root.render(
<QueryClientProvider client={queryClient}> <QueryClientProvider client={queryClient}>
<App /> <App />
</QueryClientProvider> </QueryClientProvider>
); )
// If you want to start measuring performance in your app, pass a function // If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log)) // to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals(); reportWebVitals()

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1,8 +1,8 @@
import { Dispatch } from "react"; import { Dispatch } from 'react'
import { IValutions } from "./IValutions"; import { IValutions } from './IValutions'
export interface IListValuationsName { export interface IListValuationsName {
item: IValutions, item: IValutions
setValuation: Dispatch<IValutions>, setValuation: Dispatch<IValutions>
valuation: string valuation: string
} }

View File

@ -1,5 +1,5 @@
export interface IValutions { export interface IValutions {
title: string, title: string
img: string, img: string
alt?: string alt?: string
} }

View File

@ -1,15 +1,15 @@
import { ReportHandler } from 'web-vitals'; import { ReportHandler } from 'web-vitals'
const reportWebVitals = (onPerfEntry?: ReportHandler) => { const reportWebVitals = (onPerfEntry?: ReportHandler) => {
if (onPerfEntry && onPerfEntry instanceof Function) { if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry); getCLS(onPerfEntry)
getFID(onPerfEntry); getFID(onPerfEntry)
getFCP(onPerfEntry); getFCP(onPerfEntry)
getLCP(onPerfEntry); getLCP(onPerfEntry)
getTTFB(onPerfEntry); getTTFB(onPerfEntry)
}); })
} }
}; }
export default reportWebVitals; export default reportWebVitals

View File

@ -2,4 +2,4 @@
// allows you to do things like: // allows you to do things like:
// expect(element).toHaveTextContent(/react/i) // expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom // learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom'; import '@testing-library/jest-dom'