👌 IMPROVE: Frontend refactoring, fixes etc
This commit is contained in:
parent
c36b0a46ab
commit
650bcac05a
@ -2,8 +2,8 @@ import Link from 'next/link';
|
|||||||
import { useState, forwardRef } from 'react';
|
import { useState, forwardRef } from 'react';
|
||||||
import date from 'date-and-time';
|
import date from 'date-and-time';
|
||||||
import Loader from '../Loader';
|
import Loader from '../Loader';
|
||||||
import './FunctionCard.css';
|
|
||||||
import { API_URL } from '../../utils/config/config';
|
import { API_URL } from '../../utils/config/config';
|
||||||
|
import './FunctionCard.css';
|
||||||
|
|
||||||
const FunctionCard = forwardRef((props, ref) => {
|
const FunctionCard = forwardRef((props, ref) => {
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|||||||
import { faPlay, faPause, faSync } from '@fortawesome/free-solid-svg-icons';
|
import { faPlay, faPause, faSync } from '@fortawesome/free-solid-svg-icons';
|
||||||
import api from '../../utils/api';
|
import api from '../../utils/api';
|
||||||
import '../../public/css/pages/FunctionComponent.css';
|
import '../../public/css/pages/FunctionComponent.css';
|
||||||
import '../../components/FunctionCard/FunctionCard.css';
|
|
||||||
import '../../public/css/pages/functions/chronometerTimer.css';
|
import '../../public/css/pages/functions/chronometerTimer.css';
|
||||||
|
|
||||||
let interval;
|
let interval;
|
||||||
@ -18,12 +17,12 @@ function convertSeconds(seconds) {
|
|||||||
return {
|
return {
|
||||||
minutes: Math.floor(seconds / 60),
|
minutes: Math.floor(seconds / 60),
|
||||||
seconds: seconds % 60
|
seconds: seconds % 60
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const Chronometer = () => {
|
const Chronometer = () => {
|
||||||
|
|
||||||
const [timeLength, setTimeLength] = useState(0); // seconds
|
const [timeLength, setTimeLength] = useState(0); // seconds
|
||||||
const [isPlaying, setIsPlaying] = useState(false);
|
const [isPlaying, setIsPlaying] = useState(false);
|
||||||
|
|
||||||
const handlePlayPause = () => {
|
const handlePlayPause = () => {
|
||||||
|
@ -14,7 +14,6 @@ import api from '../../utils/api';
|
|||||||
import copyToClipboard from '../../utils/copyToClipboard';
|
import copyToClipboard from '../../utils/copyToClipboard';
|
||||||
import 'notyf/notyf.min.css';
|
import 'notyf/notyf.min.css';
|
||||||
import '../../public/css/pages/FunctionComponent.css';
|
import '../../public/css/pages/FunctionComponent.css';
|
||||||
import '../../components/FunctionCard/FunctionCard.css';
|
|
||||||
|
|
||||||
const GenerateQuote = () => {
|
const GenerateQuote = () => {
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ import FunctionComments from '../../components/FunctionPage/FunctionComments/Fun
|
|||||||
import Loader from '../../components/Loader';
|
import Loader from '../../components/Loader';
|
||||||
import api from '../../utils/api';
|
import api from '../../utils/api';
|
||||||
import '../../public/css/pages/FunctionComponent.css';
|
import '../../public/css/pages/FunctionComponent.css';
|
||||||
import '../../components/FunctionCard/FunctionCard.css';
|
|
||||||
import '../../public/css/pages/functions/rightPrice.css';
|
import '../../public/css/pages/functions/rightPrice.css';
|
||||||
|
|
||||||
const PlayRightPrice = () => {
|
const PlayRightPrice = () => {
|
||||||
@ -140,7 +139,7 @@ const rightPrice = (props) => (
|
|||||||
<FunctionPage
|
<FunctionPage
|
||||||
FunctionTabManager={FunctionTabManager}
|
FunctionTabManager={FunctionTabManager}
|
||||||
{ ...props }
|
{ ...props }
|
||||||
tabNames={["⚙️ Utilisation", "📝 Article", "📬 Commentaires"]}
|
tabNames={["🕹️ Jouer", "📝 Article", "📬 Commentaires"]}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ import FunctionArticle from '../../components/FunctionPage/FunctionArticle';
|
|||||||
import FunctionComments from '../../components/FunctionPage/FunctionComments/FunctionComments';
|
import FunctionComments from '../../components/FunctionPage/FunctionComments/FunctionComments';
|
||||||
import api from '../../utils/api';
|
import api from '../../utils/api';
|
||||||
import '../../public/css/pages/FunctionComponent.css';
|
import '../../public/css/pages/FunctionComponent.css';
|
||||||
import '../../components/FunctionCard/FunctionCard.css';
|
|
||||||
import '../../public/css/pages/functions/toDoList.css';
|
import '../../public/css/pages/functions/toDoList.css';
|
||||||
|
|
||||||
const ManageToDo = () => {
|
const ManageToDo = () => {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
function copyToClipboard(text) {
|
function copyToClipboard(text) {
|
||||||
const elem = document.createElement('textarea');
|
const element = document.createElement('textarea');
|
||||||
elem.value = text;
|
element.value = text;
|
||||||
document.body.appendChild(elem);
|
document.body.appendChild(element);
|
||||||
elem.select();
|
element.select();
|
||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
document.body.removeChild(elem);
|
document.body.removeChild(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default copyToClipboard;
|
export default copyToClipboard;
|
Reference in New Issue
Block a user